Package com.openshift.client

Examples of com.openshift.client.OpenShiftException


   * @see com.openshift.client.IApplication#hasEnvironmentVariable(java.lang.String)
   */
    @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


        String url = link.getHref(server, SERVICE_PATH, urlParameters);
        try {
            String response = request(new URL(url), link.getHttpMethod(), requestMediaType, timeout, parameters);
            return factory.get(response);
        } catch (EncodingException e) {
            throw new OpenShiftException(e, e.getMessage());
    } catch (MalformedURLException e) {
      throw new OpenShiftException(e, e.getMessage());
        } catch (UnauthorizedException e) {
            throw new InvalidCredentialsOpenShiftException(url, e, getRestResponse(e));
        } catch (NotFoundException e) {
            throw new NotFoundOpenShiftException(url, e, getRestResponse(e));
        } catch (HttpClientException e) {
View Full Code Here

    case DELETE:
      return client.delete(url, mediaType, timeout, parameters);
    case PATCH:
      return client.patch(url, mediaType, timeout, parameters);
    default:
      throw new OpenShiftException("Unexpected HTTP method {0}", httpMethod.toString());
    }
   
   
  }
View Full Code Here

  }

  @Override
  public void update(String newValue) throws OpenShiftException {
    if (newValue == null) {
      throw new OpenShiftException("Value for environment variable \"{0}\" not given.", name);
    }
    EnvironmentVariableResourceDTO environmentVariableResourceDTO =
        new UpdateEnvironmentVariableRequest().execute(newValue);
    updateEnvironmentVariable(environmentVariableResourceDTO);
    /*
 
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.