Package com.proofpoint.http.client

Examples of com.proofpoint.http.client.Request


    {
        if (!enabled) {
            return;
        }

        Request request = preparePost()
                .setUri(UPLOAD_URI)
                .setHeader("Content-Type", "application/gzip")
                .setBodyGenerator(new CompressBodyGenerator(systemTimeMillis, collectedData))
                .build();
        try {
View Full Code Here


            if (!uri.toString().endsWith("/")) {
                uri = URI.create(uri.toString() + '/');
            }
            uri = uri.resolve(request.getUri());

            Request subRequest = Request.Builder.fromRequest(request)
                    .setUri(uri)
                    .build();

            if (attemptsLeft <= 1) {
                retryingResponseHandler = new RetryingResponseHandler<>(request, responseHandler, true);
View Full Code Here

        if (!uri.toString().endsWith("/")) {
            uri = URI.create(uri.toString() + '/');
        }
        uri = uri.resolve(request.getUri());

        Request subRequest = Request.Builder.fromRequest(request)
                .setUri(uri)
                .build();

        --attemptsLeft;
        HttpResponseFuture<T> future = httpClient.executeAsync(subRequest, retryingResponseHandler);
View Full Code Here

{
    @Test
    public void testExceptionFromProcessor()
            throws Exception
    {
        Request request = prepareGet()
                .setUri(URI.create("http://example.org"))
                .build();

        final RuntimeException expectedException = new RuntimeException("test exception");
View Full Code Here

    @Test
    public void testExceptionFromProcessorWithDefaultingHandler()
            throws Exception
    {
        Request request = prepareGet()
                .setUri(URI.create("http://example.org"))
                .build();

        final RuntimeException testingException = new RuntimeException("test exception");
        final Object expectedResponse = new Object();
View Full Code Here

                this.attempt = attempt;
                this.subFuture = future;
                this.uri = uri;
            }
            final RetryFuture<T, E> retryFuture = this;
            final Request request = this.request;
            final ResponseHandler<T, E> responseHandler = this.responseHandler;
            Futures.addCallback(future, new FutureCallback<T>()
            {
                @Override
                public void onSuccess(T result)
View Full Code Here

            Announcement announcement = new Announcement(nodeInfo.getEnvironment(), nodeInfo.getNodeId(), nodeInfo.getPool(), nodeInfo.getLocation(), services);
            builder = preparePut()
                    .setHeader("Content-Type", MEDIA_TYPE_JSON.toString())
                    .setBodyGenerator(jsonBodyGenerator(announcementCodec, announcement));
        }
        Request request = builder
                .setUri(URI.create("v1/announcement/" + nodeInfo.getNodeId()))
                .setHeader("User-Agent", nodeInfo.getNodeId())
                .build();

        return httpClient.executeAsync(request, new DiscoveryResponseHandler<Duration>("Announcement")
View Full Code Here

    }

    @Override
    public ListenableFuture<Void> unannounce()
    {
        Request request = prepareDelete()
                .setUri(URI.create("v1/announcement/" + nodeInfo.getNodeId()))
                .setHeader("User-Agent", nodeInfo.getNodeId())
                .build();
        return httpClient.executeAsync(request, new DiscoveryResponseHandler<Void>("Unannouncement"));
    }
View Full Code Here

    public <T> ListenableFuture<Void> post(EventGenerator<T> eventGenerator)
    {
        checkNotNull(eventGenerator, "eventGenerator is null");
        String token = traceTokenManager.getCurrentRequestToken();

        Request request = preparePost()
                .setUri(URI.create("v2/event"))
                .setHeader("User-Agent", nodeInfo.getNodeId())
                .setHeader("Content-Type", MEDIA_TYPE_JSON.toString())
                .setBodyGenerator(new JsonEntityWriter<>(eventWriter, eventGenerator, token))
                .build();
View Full Code Here

    @Test(expectedExceptions = {SSLHandshakeException.class, EOFException.class})
    public void testCertHostnameMismatch()
            throws Exception
    {
        URI uri = new URI("https", null, "127.0.0.1", baseURI.getPort(), "/", null, null);
        Request request = prepareGet()
                .setUri(uri)
                .build();

        executeRequest(request, new ResponseToStringHandler());
    }
View Full Code Here

TOP

Related Classes of com.proofpoint.http.client.Request

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.