Package com.cloudcontrolled.api.client.util

Examples of com.cloudcontrolled.api.client.util.Timer


   * @return a {@link com.cloudcontrolled.api.response.Response} object.
   */
  protected <T> Response<T> doGet(WebClient webClient, Request<T> request) {
    webClient = webClient.path(inquirePath(request));

    Timer timer = Timer.tic();
    javax.ws.rs.core.Response cxfResponse = webClient.get();
    timer.toc();

    log.debug(cxfResponse.getStatus() + " " + webClient.getCurrentURI() + " took " + timer.getDifference() + "ms");

    Response<T> response = toResponse(timer, cxfResponse, request);

    log.debug(response);

View Full Code Here


   * @return a {@link com.cloudcontrolled.api.response.Response} object.
   */
  protected <T> Response<T> doPost(WebClient webClient, Request<T> request) {
    webClient = webClient.path(inquirePath(request));

    Timer timer = Timer.tic();
    javax.ws.rs.core.Response cxfResponse = webClient.post(RequestUtil.getBodyAsMultiValuedMap(request));
    timer.toc();

    log.debug(cxfResponse.getStatus() + " " + webClient.getCurrentURI() + " took " + timer.getDifference() + "ms");

    Response<T> response = toResponse(timer, cxfResponse, request);

    log.debug(response);

View Full Code Here

   * @return a {@link com.cloudcontrolled.api.response.Response} object.
   */
  protected <T> Response<T> doPut(WebClient webClient, Request<T> request) {
    webClient = webClient.path(inquirePath(request));

    Timer timer = Timer.tic();
    javax.ws.rs.core.Response cxfResponse = webClient.put(RequestUtil.getBodyAsMultiValuedMap(request));
    timer.toc();

    log.debug(cxfResponse.getStatus() + " " + webClient.getCurrentURI() + " took " + timer.getDifference() + "ms");

    Response<T> response = toResponse(timer, cxfResponse, request);

    log.debug(response);

View Full Code Here

   * @return a {@link com.cloudcontrolled.api.response.Response} object.
   */
  protected <T> Response<T> doDelete(WebClient webClient, Request<T> request) {
    webClient = webClient.path(inquirePath(request));

    Timer timer = Timer.tic();
    javax.ws.rs.core.Response cxfResponse = webClient.delete();
    timer.toc();

    log.debug(cxfResponse.getStatus() + " " + webClient.getCurrentURI() + " took " + timer.getDifference() + "ms");

    Response<T> response = toResponse(timer, cxfResponse, request);

    log.debug(response);

View Full Code Here

TOP

Related Classes of com.cloudcontrolled.api.client.util.Timer

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.