Package com.ning.http.client.AsyncHttpClient

Examples of com.ning.http.client.AsyncHttpClient.BoundRequestBuilder.build()


            path = _pathFinder.appendStoreEntryPath(path);
            path = _keyConverter.appendToPath(path, contentId);
            BoundRequestBuilder reqBuilder = path.headRequest(_httpClient);

            HeadHandler<K> hh = new HeadHandler<K>(this, _server, startTime);
            ListenableFuture<Object> futurama = _httpClient.executeRequest(reqBuilder.build(), hh);
            // First, see if we can get the answer without time out...
            try {
              futurama.get(timeout, TimeUnit.MILLISECONDS);
            } catch (TimeoutException e) {
                return new AHCHeadCallResult(CallFailure.timeout(_server, startTime, System.currentTimeMillis()));
View Full Code Here


        BoundRequestBuilder reqBuilder = path.putRequest(_httpClient);
        Generator<K> gen = new Generator<K>(content, _keyConverter);
        int checksum = gen.getChecksum();
        reqBuilder = addCheckSum(reqBuilder, checksum);
        reqBuilder = reqBuilder.setBody(gen);
        ListenableFuture<Response> futurama = _httpClient.executeRequest(reqBuilder.build());

        // First, see if we can get the answer without time out...
        Response resp;
        try {
            resp = futurama.get(timeout, TimeUnit.MILLISECONDS);
View Full Code Here

        int statusCode = -1;
        UncompressingAsyncHandler<T> handler = new UncompressingAsyncHandler<T>(processor);
       
        try {
            T resp = null;
            ListenableFuture<T> futurama = _httpClient.executeRequest(reqBuilder.build(), handler);
            try {
                resp = futurama.get(timeout, TimeUnit.MILLISECONDS);
            } catch (TimeoutException e) {
                return new AHCGetCallResult<T>(CallFailure.timeout(_server, startTime, System.currentTimeMillis()));
            }
View Full Code Here

        path = _pathFinder.appendStoreEntryPath(path);
        path = _keyConverter.appendToPath(path, contentId);     
        BoundRequestBuilder reqBuilder = path.deleteRequest(_httpClient);

        try {
            Future<Response> futurama = _httpClient.executeRequest(reqBuilder.build());
            // First, see if we can get the answer without time out...
            Response resp;
            try {
                resp = futurama.get(timeout, TimeUnit.MILLISECONDS);
            } catch (TimeoutException e) {
View Full Code Here

                path = params.appendToPath(path, contentId);
            }
            BoundRequestBuilder reqBuilder = path.headRequest(_httpClient);

            HeadHandler<K,P> hh = new HeadHandler<K,P>(this, _server, startTime);
            ListenableFuture<Object> futurama = _httpClient.executeRequest(reqBuilder.build(), hh);
            // First, see if we can get the answer without time out...
            try {
                futurama.get(timeout, TimeUnit.MILLISECONDS);
            } catch (TimeoutException e) {
                return new AHCHeadCallResult(CallFailure.timeout(_server, startTime, System.currentTimeMillis()));
View Full Code Here

                    .addQueryParameter(ClusterMateConstants.QUERY_PARAM_LAST_SEEN, toBase64(lastSeen.asBytes()));
        }

        InputStream in = null;
        try {
            Future<Response> futurama = _httpClient.executeRequest(reqBuilder.build());
            // First, see if we can get the answer without time out...
            Response resp;
            try {
                resp = futurama.get(timeout, TimeUnit.MILLISECONDS);
            } catch (TimeoutException e) {
View Full Code Here

        path = path.addParameter(ClusterMateConstants.QUERY_PARAM_CHECKSUM,
                (checksum == 0) ? "0" : String.valueOf(checksum));

        BoundRequestBuilder reqBuilder = path.putRequest(_httpClient);
        reqBuilder = reqBuilder.setBody(gen);
        ListenableFuture<Response> futurama = _httpClient.executeRequest(reqBuilder.build());

        // First, see if we can get the answer without time out...
        Response resp;
        try {
            resp = futurama.get(timeout, TimeUnit.MILLISECONDS);
View Full Code Here

        int statusCode = -1;
        UncompressingAsyncHandler<T> handler = new UncompressingAsyncHandler<T>(processor);
       
        try {
            T resp = null;
            ListenableFuture<T> futurama = _httpClient.executeRequest(reqBuilder.build(), handler);
            try {
                resp = futurama.get(timeout, TimeUnit.MILLISECONDS);
            } catch (TimeoutException e) {
                return new AHCGetCallResult<T>(CallFailure.timeout(_server, startTime, System.currentTimeMillis()));
            }
View Full Code Here

            pathBuilder = params.appendToPath(pathBuilder, contentId);
        }
        BoundRequestBuilder reqBuilder = pathBuilder.deleteRequest(_httpClient);

        try {
            Future<Response> futurama = _httpClient.executeRequest(reqBuilder.build());
            // First, see if we can get the answer without time out...
            Response resp;
            try {
                resp = futurama.get(timeout, TimeUnit.MILLISECONDS);
            } catch (TimeoutException e) {
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.