Package com.cloudcontrolled.api.client.exception

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


    CreateTokenResponse createTokenResponse;
    try {
      createTokenResponse = send(createTokenRequest);
    } catch (ValidationConstraintViolationException vcve) {
      throw new AuthorizationException(vcve);
    }

    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);
      }
    }
View Full Code Here


   * @param request
   * @return
   */
  private <T> Response<T> toResponse(Timer timer, javax.ws.rs.core.Response cxfResponse, Request<T> request) {
    if (!(request instanceof CreateTokenRequest) && cxfResponse.getStatus() == HttpStatus.Unauthorized.ordinal()) {
      throw new AuthorizationException(HttpStatus.Unauthorized.toString());
    }

    InputStream inputStream = (InputStream) cxfResponse.getEntity();
    Response<T> response = null;

View Full Code Here

TOP

Related Classes of com.cloudcontrolled.api.client.exception.AuthorizationException

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.