Package com.apitrary.api.client.exception

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


        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

   * @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

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

   * @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

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

      // 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

        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

Related Classes of com.apitrary.api.client.exception.CommunicationErrorException

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.