Examples of DefaultedHttpParams


Examples of org.apache.http.params.DefaultedHttpParams

             new ClientParamsStack(null, child, dummy, null),
             null);
        assertNull("2", ConnRouteParams.getDefaultProxy(hierarchy));

        hierarchy = new ClientParamsStack
            (null, daddy, new DefaultedHttpParams(child, dummy), null);
        assertNull("3", ConnRouteParams.getDefaultProxy(hierarchy));

        hierarchy = new DefaultedHttpParams(child, daddy);
        assertNull("4", ConnRouteParams.getDefaultProxy(hierarchy));

        hierarchy = new DefaultedHttpParams
            (new DefaultedHttpParams(child, dummy), daddy);
        assertNull("5", ConnRouteParams.getDefaultProxy(hierarchy));

        hierarchy = new DefaultedHttpParams
            (child, new DefaultedHttpParams(dummy, daddy));
        assertNull("6", ConnRouteParams.getDefaultProxy(hierarchy));
    }
View Full Code Here

Examples of org.apache.http.params.DefaultedHttpParams

                ExecutionContext.HTTP_TARGET_HOST, target);
        httpContext.setAttribute(
                ExecutionContext.HTTP_REQUEST, request);

        request.setParams(
                new DefaultedHttpParams(request.getParams(), defaultParams));
        httpExecutor.preProcess
            (request, httpProcessor, httpContext);
        HttpResponse response = httpExecutor.execute
            (request, conn, httpContext);
        response.setParams(
                new DefaultedHttpParams(response.getParams(), defaultParams));
        httpExecutor.postProcess
            (response, httpProcessor, httpContext);

        assertEquals("wrong status in response", HttpStatus.SC_OK,
                     response.getStatusLine().getStatusCode());
View Full Code Here

Examples of org.apache.http.params.DefaultedHttpParams

                    ExecutionContext.HTTP_TARGET_HOST, target);
            httpContext.setAttribute(
                    ExecutionContext.HTTP_REQUEST, request);

            request.setParams(
                    new DefaultedHttpParams(request.getParams(), defaultParams));
            httpExecutor.preProcess
                (request, httpProcessor, httpContext);
            HttpResponse response = httpExecutor.execute
                (request, conn, httpContext);
            response.setParams(
                    new DefaultedHttpParams(response.getParams(), defaultParams));
            httpExecutor.postProcess
                (response, httpProcessor, httpContext);

            assertEquals("(" + sizes[i] + ") wrong status in response",
                         HttpStatus.SC_OK,
View Full Code Here

Examples of org.apache.http.params.DefaultedHttpParams

        ctxt.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
        ctxt.setAttribute(ExecutionContext.HTTP_TARGET_HOST, target);
        ctxt.setAttribute(ExecutionContext.HTTP_REQUEST, req);

        req.setParams(new DefaultedHttpParams(req.getParams(), params));
        exec.preProcess(req, proc, ctxt);
        HttpResponse rsp = exec.execute(req, conn, ctxt);
        rsp.setParams(new DefaultedHttpParams(rsp.getParams(), params));
        exec.postProcess(rsp, proc, ctxt);

        return rsp;
    }
View Full Code Here

Examples of org.apache.http.params.DefaultedHttpParams

        HttpContext context = conn.getContext();

        ServerConnState connState = (ServerConnState) context.getAttribute(CONN_STATE);

        HttpRequest request = conn.getHttpRequest();
        request.setParams(new DefaultedHttpParams(request.getParams(), this.params));

        connState.setRequest(request);

        NHttpRequestHandler requestHandler = getRequestHandler(request);
        connState.setRequestHandler(requestHandler);

        ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
        if (!ver.lessEquals(HttpVersion.HTTP_1_1)) {
            // Downgrade protocol version if greater than HTTP/1.1
            ver = HttpVersion.HTTP_1_1;
        }

        HttpResponse response;

        try {

            if (request instanceof HttpEntityEnclosingRequest) {
                HttpEntityEnclosingRequest entityRequest = (HttpEntityEnclosingRequest) request;
                if (entityRequest.expectContinue()) {
                    response = this.responseFactory.newHttpResponse(
                            ver, HttpStatus.SC_CONTINUE, context);
                    response.setParams(
                            new DefaultedHttpParams(response.getParams(), this.params));

                    if (this.expectationVerifier != null) {
                        try {
                            this.expectationVerifier.verify(request, response, context);
                        } catch (HttpException ex) {
                            response = this.responseFactory.newHttpResponse(
                                    HttpVersion.HTTP_1_0,
                                    HttpStatus.SC_INTERNAL_SERVER_ERROR,
                                    context);
                            response.setParams(
                                    new DefaultedHttpParams(response.getParams(), this.params));
                            handleException(ex, response);
                        }
                    }

                    if (response.getStatusLine().getStatusCode() < 200) {
View Full Code Here

Examples of org.apache.http.params.DefaultedHttpParams

        HttpContext context = conn.getContext();
        try {
            HttpResponse response = this.responseFactory.newHttpResponse(
                    HttpVersion.HTTP_1_0, HttpStatus.SC_INTERNAL_SERVER_ERROR, context);
            response.setParams(
                    new DefaultedHttpParams(response.getParams(), this.params));
            handleException(httpex, response);
            response.setEntity(null);
            sendResponse(conn, null, response);

        } catch (IOException ex) {
View Full Code Here

Examples of org.apache.http.params.DefaultedHttpParams

            HttpException httpex = connState.getHttpException();
            if (httpex != null) {
                HttpResponse response = this.responseFactory.newHttpResponse(HttpVersion.HTTP_1_0,
                        HttpStatus.SC_INTERNAL_SERVER_ERROR, context);
                response.setParams(
                        new DefaultedHttpParams(response.getParams(), this.params));
                handleException(httpex, response);
                connState.setResponse(response);
            }

            HttpResponse response = connState.getResponse();
View Full Code Here

Examples of org.apache.http.params.DefaultedHttpParams

            NHttpRequestHandler handler = connState.getRequestHandler();
            if (handler != null) {
                HttpResponse response = this.responseFactory.newHttpResponse(
                        ver, HttpStatus.SC_OK, context);
                response.setParams(
                        new DefaultedHttpParams(response.getParams(), this.params));

                handler.handle(
                        request,
                        response,
                        trigger,
                        context);
            } else {
                HttpResponse response = this.responseFactory.newHttpResponse(ver,
                        HttpStatus.SC_NOT_IMPLEMENTED, context);
                response.setParams(
                        new DefaultedHttpParams(response.getParams(), this.params));
                trigger.submitResponse(response);
            }

        } catch (HttpException ex) {
            trigger.handleException(ex);
View Full Code Here

Examples of org.apache.http.params.DefaultedHttpParams

            if (request == null) {
                return;
            }

            request.setParams(
                    new DefaultedHttpParams(request.getParams(), this.params));

            context.setAttribute(ExecutionContext.HTTP_REQUEST, request);
            this.httpProcessor.process(request, context);

            HttpEntityEnclosingRequest entityReq = null;
View Full Code Here

Examples of org.apache.http.params.DefaultedHttpParams

        HttpContext context = conn.getContext();
        ClientConnState connState = (ClientConnState) context.getAttribute(CONN_STATE);

        HttpResponse response = conn.getHttpResponse();
        response.setParams(
                new DefaultedHttpParams(response.getParams(), this.params));

        HttpRequest request = connState.getRequest();
        try {

            int statusCode = response.getStatusLine().getStatusCode();
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.