Examples of HTTPClientPolicy


Examples of org.apache.cxf.transports.http.configuration.HTTPClientPolicy

                             + new String(cachedStream.getBytes()));
                }

                HttpURLConnection oldcon = connection;
               
                HTTPClientPolicy policy = getClient();
               
                // Default MaxRetransmits is -1 which means unlimited.
                int maxRetransmits = (policy == null)
                                     ? -1
                                     : policy.getMaxRetransmits();
               
                // MaxRetransmits of zero means zero.
                if (maxRetransmits == 0) {
                    return;
                }
View Full Code Here

Examples of org.apache.cxf.transports.http.configuration.HTTPClientPolicy

        // See if not set by configuration, if there are defaults
        // in order from the Endpoint, Service, or Bus.
       
        if (this.clientSidePolicy == null) {
            clientSidePolicy = endpointInfo.getTraversedExtensor(
                    new HTTPClientPolicy(), HTTPClientPolicy.class);
        }
        if (this.authorizationPolicy == null) {
            authorizationPolicy = endpointInfo.getTraversedExtensor(
                    new AuthorizationPolicy(), AuthorizationPolicy.class);
          
View Full Code Here

Examples of org.apache.cxf.transports.http.configuration.HTTPClientPolicy

     */
    private void setHeadersByClientPolicy(
        Message message,
        Map<String, List<String>> headers
    ) {
        HTTPClientPolicy policy = getClient(message);
        if (policy == null) {
            return;
        }
        if (policy.isSetCacheControl()) {
            headers.put("Cache-Control",
                        createMutableList(policy.getCacheControl().value()));
        }
        if (policy.isSetHost()) {
            headers.put("Host",
                        createMutableList(policy.getHost()));
        }
        if (policy.isSetConnection()) {
            headers.put("Connection",
                        createMutableList(policy.getConnection().value()));
        }
        if (policy.isSetAccept()) {
            headers.put("Accept",
                        createMutableList(policy.getAccept()));
        } else {
            headers.put("Accept", createMutableList("*"));
        }
        if (policy.isSetAcceptEncoding()) {
            headers.put("Accept-Encoding",
                        createMutableList(policy.getAcceptEncoding()));
        }
        if (policy.isSetAcceptLanguage()) {
            headers.put("Accept-Language",
                        createMutableList(policy.getAcceptLanguage()));
        }
        if (policy.isSetContentType()) {
            message.put(Message.CONTENT_TYPE, policy.getContentType());
        }
        if (policy.isSetCookie()) {
            headers.put("Cookie",
                        createMutableList(policy.getCookie()));
        }
        if (policy.isSetBrowserType()) {
            headers.put("BrowserType",
                        createMutableList(policy.getBrowserType()));
        }
        if (policy.isSetReferer()) {
            headers.put("Referer",
                        createMutableList(policy.getReferer()));
        }
    }
View Full Code Here

Examples of org.apache.cxf.transports.http.configuration.HTTPClientPolicy

        decoupledEndpointPort--;
        decoupledEndpoint = "http://localhost:" + decoupledEndpointPort + "/decoupled_endpoint";

        Client c = ClientProxy.getClient(greeter);
        HTTPConduit hc = (HTTPConduit)(c.getConduit());
        HTTPClientPolicy cp = hc.getClient();
        cp.setDecoupledEndpoint(decoupledEndpoint);

        LOG.fine("Using decoupled endpoint: " + cp.getDecoupledEndpoint());
    }
View Full Code Here

Examples of org.apache.cxf.transports.http.configuration.HTTPClientPolicy

    private void verifyBethalClient(Greeter bethal) {
        Client client = ClientProxy.getClient(bethal);
        HTTPConduit http =
            (HTTPConduit) client.getConduit();
       
        HTTPClientPolicy httpClientPolicy = http.getClient();
        assertEquals("the httpClientPolicy's autoRedirect should be true",
                     true, httpClientPolicy.isAutoRedirect());
        TLSClientParameters tlsParaments = http.getTlsClientParameters();
        assertNotNull("the http conduite's tlsParaments should not be null", tlsParaments);
       
       
        // If we set any name, but Edward, Mary, or George,
View Full Code Here

Examples of org.apache.cxf.transports.http.configuration.HTTPClientPolicy

        // This also tests dynamic configuration of the conduit.
        Client client = ClientProxy.getClient(bethal);
        HTTPConduit http =
            (HTTPConduit) client.getConduit();
       
        HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
       
        httpClientPolicy.setAutoRedirect(false);
        // If we set any name, but Edward, Mary, or George,
        // and a password of "password" we will get through
        // Bethal.
        AuthorizationPolicy authPolicy = new AuthorizationPolicy();
        authPolicy.setUserName("Betty");
View Full Code Here

Examples of org.apache.cxf.transports.http.configuration.HTTPClientPolicy

        // This also tests dynamic configuration of the conduit.
        Client client = ClientProxy.getClient(poltim);
        HTTPConduit http =
            (HTTPConduit) client.getConduit();
       
        HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
       
        httpClientPolicy.setAutoRedirect(true);
       
        http.setClient(httpClientPolicy);
        http.setTlsClientParameters(tlsClientParameters);
       
        try {
View Full Code Here

Examples of org.apache.cxf.transports.http.configuration.HTTPClientPolicy

        // This also tests dynamic configuration of the conduit.
        Client client = ClientProxy.getClient(bethal);
        HTTPConduit http =
            (HTTPConduit) client.getConduit();
       
        HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
       
        httpClientPolicy.setAutoRedirect(false);
        // If we set any name, but Edward, Mary, or George,
        // and a password of "password" we will get through
        // Bethal.
        AuthorizationPolicy authPolicy = new AuthorizationPolicy();
        authPolicy.setUserName("Betty");
View Full Code Here

Examples of org.apache.cxf.transports.http.configuration.HTTPClientPolicy

        // This also tests dynamic configuration of the conduit.
        Client client = ClientProxy.getClient(tarpin);
        HTTPConduit http =
            (HTTPConduit) client.getConduit();
       
        HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
       
        httpClientPolicy.setAutoRedirect(true);
        // If we set any name, but Edward, Mary, or George,
        // and a password of "password" we will get through
        // Bethal.
        AuthorizationPolicy authPolicy = new AuthorizationPolicy();
        authPolicy.setUserName("Betty");
View Full Code Here

Examples of org.apache.cxf.transports.http.configuration.HTTPClientPolicy

        // This also tests dynamic configuration of the conduit.
        Client client = ClientProxy.getClient(gordy);
        HTTPConduit http =
            (HTTPConduit) client.getConduit();
       
        HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
       
        httpClientPolicy.setAutoRedirect(true);
        http.setClient(httpClientPolicy);
        http.setTlsClientParameters(tlsClientParameters);
       
        // We get redirected from Gordy, to Bethal.
        http.setTrustDecider(
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.