Package com.metamx.http.client.response

Examples of com.metamx.http.client.response.StatusResponseHandler


        log.info("Submitting action for task[%s] to overlord[%s]: %s", task.getId(), serviceUri, taskAction);

        try {
          response = httpClient.post(serviceUri.toURL())
                               .setContent("application/json", dataToSend)
                               .go(new StatusResponseHandler(Charsets.UTF_8))
                               .get();
        }
        catch (Exception e) {
          Throwables.propagateIfInstanceOf(e.getCause(), IOException.class);
          Throwables.propagateIfInstanceOf(e.getCause(), ChannelException.class);
View Full Code Here


                      long startTime = System.currentTimeMillis();
                      long startTime2 = 0;
                      try {
                        ListenableFuture<StatusResponseHolder> go =
                            client.get(new URL("http://localhost:9999/slow/hello"))
                                  .go(new StatusResponseHandler(Charset.defaultCharset()));
                        startTime2 = System.currentTimeMillis();
                        go.get();
                      }
                      catch (Exception e) {
                        e.printStackTrace();
View Full Code Here

                try {
                  StatusResponseHolder res = httpClient
                      .delete(new URL(cancelUrl))
                      .setContent(objectMapper.writeValueAsBytes(query))
                      .setHeader(HttpHeaders.Names.CONTENT_TYPE, isSmile ? "application/smile" : "application/json")
                      .go(new StatusResponseHandler(Charsets.UTF_8))
                      .get();
                  if (res.getStatus().getCode() >= 500) {
                    throw new RE(
                        "Error cancelling query[%s]: queriable node returned status[%d] [%s].",
                        res.getStatus().getCode(),
View Full Code Here

  )
  {
    this.brokerSelector = brokerSelector;
    this.httpClient = httpClient;
    this.jsonMapper = jsonMapper;
    this.responseHandler = new StatusResponseHandler(Charsets.UTF_8);
  }
View Full Code Here

TOP

Related Classes of com.metamx.http.client.response.StatusResponseHandler

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.