Package com.openshift.client

Examples of com.openshift.client.OpenShiftException


        final IGearProfile gearProfile, final String initialGitUrl, final int timeout,
        Map<String, String> environmentVariables, Collection<ICartridge> cartridges)
        throws OpenShiftException {
      if (cartridges == null
          || cartridges.size() == 0) {
        throw new OpenShiftException("Cartridges are mandatory but none were provided.");
      }

      Parameters parameters = new Parameters()
          .add(IOpenShiftJsonConstants.PROPERTY_NAME, name)
          .addCartridges(cartridges)
View Full Code Here


   * @throws OpenShiftException
   *             the open shift exception
   */
  protected ModelNode getModelNode(final String content) throws OpenShiftException {
    if (content == null) {
      throw new OpenShiftException("Could not unmarshall response: no content.");
    }
    final ModelNode node = ModelNode.fromJSONString(content);
    if (!node.isDefined()) {
      throw new OpenShiftException("Could not unmarshall response: erroneous content.");
    }

    return node;
  }
View Full Code Here

  public IDomain createDomain(String id) throws OpenShiftException {
    Assert.notNull(id);

    if (hasDomain(id)) {
      throw new OpenShiftException("Domain {0} already exists", id);
    }

    final DomainResourceDTO domainDTO = new AddDomainRequest().execute(id);
    final IDomain domain = new DomainResource(domainDTO, this);
    this.domains.add(domain);
View Full Code Here

    return this;
  }
 
  public ParameterValueMap add(Parameter parameter) {
    if (getValue().put(parameter.getName(), parameter) != null) {
      throw new OpenShiftException(
          "Duplicate parameter found. There's already a parameter named {0}", parameter.getName());
    }
    return this;
  }
View Full Code Here

          && !isTimeouted(timeout, startTime)) {
        Thread.sleep(APPLICATION_WAIT_RETRY_DELAY);
      }
      return canResolv(applicationUrl);
    } catch (MalformedURLException e) {
      throw new OpenShiftException(e,
          "Could not wait for application {0} to become accessible, it has an invalid URL \"{1}\": {2}",
          name, applicationUrl, e.getMessage());
    }
  }
View Full Code Here

  }

  @Override
  public IEnvironmentVariable addEnvironmentVariable(String name, String value) throws OpenShiftException {
    if (name == null) {
      throw new OpenShiftException("Environment variable name is mandatory but none was given.");
    }
    if (value == null) {
      throw new OpenShiftException("Value for environment variable \"{0}\" not given.", name);
    }
    if (hasEnvironmentVariable(name)) {
      throw new OpenShiftException("Environment variable with name \"{0}\" already exists.", name);
    }

    EnvironmentVariableResourceDTO environmentVariableResourceDTO =
        new AddEnvironmentVariableRequest().execute(name, value);
    IEnvironmentVariable environmentVariable = new EnvironmentVariableResource(environmentVariableResourceDTO, this);
View Full Code Here

  }

  @Override
  public IEnvironmentVariable updateEnvironmentVariable(String name, String value) throws OpenShiftException {
    if (name == null) {
      throw new OpenShiftException("Environment variable name is mandatory but none was given.");
    }
    if (value == null) {
      throw new OpenShiftException("Value for environment variable \"{0}\" not given.", name);
    }
    if (!hasEnvironmentVariable(name)) {
      throw new OpenShiftException("Environment variable with name \"{0}\" does not exist.", name);
    }

    IEnvironmentVariable environmentVariable = getEnvironmentVariable(name);
    environmentVariable.update(value);
View Full Code Here

  }

  @Override
  public void removeEnvironmentVariable(IEnvironmentVariable environmentVariable){
    if(getEnvironmentVariable(environmentVariable.getName()) == null)
      throw new OpenShiftException("IEnvironmentVariable with supplied name does not exist.");
    environmentVariable.destroy();
    environmentVariablesMap.remove(environmentVariable.getName());

  }
View Full Code Here

  }

  @Override
  public boolean hasEnvironmentVariable(String name) throws OpenShiftException {
    if (StringUtils.isEmpty(name)) {
      throw new OpenShiftException("Environment variable name is mandatory but none was given.");
    }
    return getEnvironmentVariable(name) != null;

  }
View Full Code Here

  public IDomain createDomain(String id) throws OpenShiftException {
    Assert.notNull(id);

    if (hasDomain(id)) {
      throw new OpenShiftException("Domain {0} already exists", id);
    }

    final DomainResourceDTO domainDTO = new AddDomainRequest().execute(id);
    final IDomain domain = new DomainResource(domainDTO, this);
    this.domains.add(domain);
View Full Code Here

TOP

Related Classes of com.openshift.client.OpenShiftException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.