Package com.openshift.internal.client.response

Examples of com.openshift.internal.client.response.Link


public abstract class AbstractOpenShiftConnectionFactory {
 
  @SuppressWarnings("unchecked")
  protected IOpenShiftConnection getConnection(IRestService service, final String login, final String password) throws IOException, OpenShiftException {
    RestResponse response =
        (RestResponse) service.request(new Link("Get API", "/api", HttpMethod.GET));
    return new APIResource(login, password, service, (Map<String, Link>) response.getData());
  }
View Full Code Here


   * @return the link with the given name
   * @throws OpenShiftException
   *             thrown if no link with the given name exists
   */
  protected Link getLink(String linkName) throws OpenShiftException {
    Link link = null;
    if (getLinks() != null) {
      link = getLinks().get(linkName);
    }
    if (link == null) {
      throw new OpenShiftRequestException(
View Full Code Here

  }

  @Override
  public boolean canCreateApplicationWithEnvironmentVariables() {
    try {
      Link link = getLink(LINK_ADD_APPLICATION);
      return link.hasParameter(IOpenShiftJsonConstants.PROPERTY_ENVIRONMENT_VARIABLES);
    } catch (OpenShiftRequestException e) {
      return false;
    }
  }
View Full Code Here

 
  @SuppressWarnings("unchecked")
  protected IOpenShiftConnection getConnection(IRestService service, final String login, final String password) throws IOException, OpenShiftException {
    RestResponse response =
        (RestResponse) service.request(
            new Link("Get API", "/api", HttpMethod.GET),
            IHttpClient.NO_TIMEOUT,
            Collections.<Parameter> emptyList(),
            Collections.<Parameter> emptyList());
    return new APIResource(login, password, service, (Map<String, Link>) response.getData());
  }
View Full Code Here

      return resource.getLink(linkName);
    }
  }
 
  public <DTO> DTO execute(final ServiceParameter... parameters) throws OpenShiftException {
    final Link link = getLink();
    if (link == null) {
      throw new OpenShiftException("Could not request resource, no link present");
    }
    // avoid concurrency issues, to prevent reading the links map while it
    // is still being retrieved
View Full Code Here

public abstract class AbstractOpenShiftConnectionFactory {
 
  @SuppressWarnings("unchecked")
  protected IOpenShiftConnection getConnection(IRestService service, final String login, final String password) throws FileNotFoundException, IOException, OpenShiftException {
    RestResponse response =
        (RestResponse) service.request(new Link("Get API", "/api", HttpMethod.GET));
    return new APIResource(login, password, service, (Map<String, Link>) response.getData());
  }
View Full Code Here

   * @return the link
   * @throws OpenShiftException
   *             the open shift exception
   */
  protected Link getLink(String linkName) throws OpenShiftException {
    Link link = null;
    if (getLinks() != null) {
      link = getLinks().get(linkName);
    }
    if (link == null) {
      throw new OpenShiftRequestException(
View Full Code Here

    protected ServiceRequest(String linkName) {
      this.linkName = linkName;
    }

    protected <DTO> DTO execute(ServiceParameter... parameters) throws OpenShiftException {
      Link link = getLink(linkName);
      RestResponse response = getService().request(link, parameters);
     
      // in some cases, there is not response body, just a return code to
      // indicate that the operation was successful (e.g.: delete domain)
      if (response == null) {
View Full Code Here

  }

  @Override
  public boolean canCreateApplicationWithEnvironmentVariables() {
    try {
      Link link = getLink(LINK_ADD_APPLICATION);
      return link.hasParameter(IOpenShiftJsonConstants.PROPERTY_ENVIRONMENT_VARIABLES);
    } catch (OpenShiftRequestException e) {
      return false;
    }
  }
View Full Code Here

  }

  @Test
  public void shouldNotThrowIfNoReqiredParameter() throws Exception {
    // operation
    Link link = new TestLink("0 required parameter", "/dummy", HttpMethod.GET);
    service.request(link, IHttpClient.NO_TIMEOUT, Collections.<Parameter> emptyList(), Collections.<Parameter> emptyList());
  }
View Full Code Here

TOP

Related Classes of com.openshift.internal.client.response.Link

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.