Examples of APIStateResponse


Examples of com.apitrary.api.response.APIStateResponse

   *
   * @return a {@link com.apitrary.orm.core.internal.model.APIState} object.
   */
  public APIState getAPIState() {
    APIStateRequest request = new APIStateRequest();
    APIStateResponse response = resolveApitraryClient().send(request);

    APIState apiState = null;
    if (HttpStatus.OK.ordinal() == response.getStatusCode()) {
      String result = response.getResult();

      ObjectMapper objectMapper = new ObjectMapper();
      try {
        apiState = objectMapper.readValue(result, APIState.class);
      } catch (Exception e) {
        throw new MappingException(e);
      }
    } else {
      throw new CommunicationErrorException(HttpStatus.getStatus(response.getStatusCode()));
    }
    return apiState;
  }
View Full Code Here

Examples of com.apitrary.api.response.APIStateResponse

   *
   * @return a {@link com.apitrary.orm.core.internal.model.APIState} object.
   */
  public APIState getAPIState() {
    APIStateRequest request = new APIStateRequest();
    APIStateResponse response = resolveApitraryClient().send(request);

    APIState apiState = null;
    if (HttpStatus.OK.ordinal() == response.getStatusCode()) {
      String result = response.getResult();

      ObjectMapper objectMapper = new ObjectMapper();
      try {
        apiState = objectMapper.readValue(result, APIState.class);
      } catch (Exception e) {
        throw new MappingException(e);
      }
    } else {
      throw new CommunicationErrorException(HttpStatus.getStatus(response.getStatusCode()));
    }
    return apiState;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.