Examples of executeRequest()


Examples of com.netflix.genie.common.client.BaseGenieClient.executeRequest()

    private Job forwardJobKill(final String killURI) throws GenieException {
        try {
            final BaseGenieClient client = new BaseGenieClient(null);
            final HttpRequest request = BaseGenieClient.buildRequest(Verb.DELETE, killURI, null, null);
            return (Job) client.executeRequest(request, null, Job.class);
        } catch (final IOException ioe) {
            throw new GenieServerException(ioe.getMessage(), ioe);
        }
    }
View Full Code Here

Examples of com.ning.http.client.AsyncHttpClient.executeRequest()

        Request request = setupHttpRequest(cr, ncos, os);
        Response response;

        try {
            response = asyncHttpClient.executeRequest(request, new AsyncCompletionHandlerBase()
            {
                @Override
                public Response onCompleted(final Response response) throws Exception {
                    logger.debug("Response received: {}", response);
                    return super.onCompleted(response);
View Full Code Here

Examples of com.ning.http.client.AsyncHttpClient.executeRequest()

        Request request = setupHttpRequest(cr, ncos, os);
        Response response;
        final AtomicReference<Throwable> failureHolder = new AtomicReference<Throwable>();

        try {
            response = asyncHttpClient.executeRequest(request, new AsyncCompletionHandlerBase()
            {
                @Override
                public Response onCompleted(final Response response) throws Exception {
                    logger.trace("Response received: {}", response);
                    return super.onCompleted(response);
View Full Code Here

Examples of org.apache.cloudstack.storage.resource.SecondaryStorageResourceHandler.executeRequest()

        if(handler == null) {
          s_logger.error("No handler can be found for hypervisor type in command context, hypervisor: " + hypervisor);
          return defaultAction(cmd);
        }
       
        return handler.executeRequest(cmd);
      }

        return defaultAction(cmd);
    }
   
View Full Code Here

Examples of org.apache.cloudstack.storage.resource.SecondaryStorageResourceHandler.executeRequest()

            if (handler == null) {
                s_logger.error("No handler can be found for hypervisor type in command context, hypervisor: " + hypervisor);
                return defaultAction(cmd);
            }

            return handler.executeRequest(cmd);
        }

        return defaultAction(cmd);
    }
View Full Code Here

Examples of org.asynchttpclient.AsyncHttpClient.executeRequest()

            final AtomicBoolean err = new AtomicBoolean(false);
            final LinkedBlockingQueue<String> queue = new LinkedBlockingQueue<String>();
            final AtomicBoolean status = new AtomicBoolean(false);
            final AtomicInteger headers = new AtomicInteger(0);
            final CountDownLatch latch = new CountDownLatch(1);
            ahc.executeRequest(ahc.prepareGet(getTargetUrl()).build(), new AsyncHandler<Object>() {
                public void onThrowable(Throwable t) {
                    fail("Got throwable.", t);
                    err.set(true);
                }
View Full Code Here

Examples of org.asynchttpclient.AsyncHttpClient.executeRequest()

        AsyncHttpClient c = getAsyncHttpClient(config);
        try {
            Request r = new RequestBuilder("GET").setUrl(servletEndpointRedirectUrl).build();

            ListenableFuture<Response> response = c.executeRequest(r);
            Response res = null;
            res = response.get();
            assertNotNull(res.getResponseBody());
            assertEquals(res.getUri().toString(), BASE_URL + "/overthere");
View Full Code Here

Examples of org.asynchttpclient.AsyncHttpClient.executeRequest()

                return ctx;
            }
        }).build());
        try {
            Request request = new RequestBuilder("POST").setUrl(getTargetUrl()).addFormParam("q", "a b").addHeader("x-redirect", +status + "@" + "http://localhost:" + port1 + "/foo/bar/baz").addHeader("x-negative", "true").build();
            Future<Integer> responseFuture = p.executeRequest(request, new AsyncCompletionHandler<Integer>() {

                @Override
                public Integer onCompleted(Response response) throws Exception {
                    return response.getStatusCode();
                }
View Full Code Here

Examples of org.asynchttpclient.AsyncHttpClient.executeRequest()

                return ctx;
            }
        }).build());
        try {
            Request request = new RequestBuilder("POST").setUrl(getTargetUrl()).addFormParam("q", "a b").addHeader("x-redirect", +status + "@" + "http://localhost:" + port1 + "/foo/bar/baz").build();
            Future<Integer> responseFuture = p.executeRequest(request, new AsyncCompletionHandler<Integer>() {

                @Override
                public Integer onCompleted(Response response) throws Exception {
                    return response.getStatusCode();
                }
View Full Code Here

Examples of org.asynchttpclient.AsyncHttpClient.executeRequest()

        AsyncHttpClient client = getAsyncHttpClient(null);
        try {
            final CountDownLatch l = new CountDownLatch(1);
            Request request = new RequestBuilder("HEAD").setUrl("http://127.0.0.1:" + port1 + "/Test").build();

            client.executeRequest(request, new AsyncCompletionHandlerBase() {
                @Override
                public Response onCompleted(Response response) throws Exception {
                    l.countDown();
                    return super.onCompleted(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.