Examples of CommunicationErrorException


Examples of com.apitrary.api.client.exception.CommunicationErrorException

      // if(HttpStatus.Internal_Server_Error.ordinal() ==
      // response.getStatusCode()){
      // throw new
      // CommunicationErrorException(HttpStatus.Internal_Server_Error);
      // }
      throw new CommunicationErrorException(HttpStatus.getStatus(response.getStatusCode()));
    }
  }
View Full Code Here

Examples of com.apitrary.api.client.exception.CommunicationErrorException

        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.client.exception.CommunicationErrorException

   * @return a T object.
   */
  public <T> T send(Request<T> request) {

    if (request == null) {
      throw new CommunicationErrorException("Request cannot be null.");
    }
    RequestUtil.validate(request);

    @SuppressWarnings("unchecked")
    T response = (T) dispatchByMethod(request);
View Full Code Here

Examples of com.apitrary.api.client.exception.CommunicationErrorException

      case PUT:
        return doPut(request);
      case DELETE:
        return doDelete(request);
      default:
        throw new CommunicationErrorException(HttpStatus.Not_Implemented);
    }
  }
View Full Code Here

Examples of com.apitrary.api.client.exception.CommunicationErrorException

   * @return a T object.
   */
  public <T> T send(Request<T> request) {

    if (request == null) {
      throw new CommunicationErrorException("Request cannot be null.");
    }
    RequestUtil.validate(request);

    @SuppressWarnings("unchecked")
    T response = (T) dispatchByMethod(request);
View Full Code Here

Examples of com.apitrary.api.client.exception.CommunicationErrorException

      case PUT:
        return doPut(webClient, request);
      case DELETE:
        return doDelete(webClient, request);
      default:
        throw new CommunicationErrorException(HttpStatus.Not_Implemented);
    }
  }
View Full Code Here

Examples of com.apitrary.api.client.exception.CommunicationErrorException

      // if(HttpStatus.Internal_Server_Error.ordinal() ==
      // response.getStatusCode()){
      // throw new
      // CommunicationErrorException(HttpStatus.Internal_Server_Error);
      // }
      throw new CommunicationErrorException(HttpStatus.getStatus(response.getStatusCode()), response.getResult());
    }
  }
View Full Code Here

Examples of com.apitrary.api.client.exception.CommunicationErrorException

        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.cloudcontrolled.api.client.exception.CommunicationErrorException

    HttpStatus status = HttpStatus.getStatus(createTokenResponse.getStatusCode());
    if (status.isError()) {
      if (status.equals(HttpStatus.Unauthorized)) {
        throw new AuthorizationException(HttpStatus.Unauthorized.toString());
      } else {
        throw new CommunicationErrorException(status);
      }
    }

    String newToken = createTokenResponse.getToken();
    tokenStore.setToken(newToken);
View Full Code Here

Examples of com.cloudcontrolled.api.client.exception.CommunicationErrorException

  @Override
  @SuppressWarnings("unchecked")
  public <T> T send(Request<T> request) {

    if (request == null) {
      throw new CommunicationErrorException("Request cannot be null.");
    }
    PathUtil.infixPotentialDefaults(request);
    ValidationUtil.validate(request);

    T response;
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.