Package org.apache.http.nio.conn.scheme

Examples of org.apache.http.nio.conn.scheme.Scheme


        SSLContext clientSSLContext = SSLContext.getInstance("TLS");
        clientSSLContext.init(null, tm, null);

        SchemeRegistry schemeRegistry = new SchemeRegistry();
        schemeRegistry.register(new Scheme("http", 80, null));
        schemeRegistry.register(new Scheme("https", 443, new SSLLayeringStrategy(clientSSLContext)));
        return new PoolingClientConnectionManager(ioreactor, schemeRegistry);
    }
View Full Code Here


    }

    protected PoolingClientConnectionManager createConnectionManager(
            final ConnectingIOReactor ioreactor) throws Exception {
        SchemeRegistry schemeRegistry = new SchemeRegistry();
        schemeRegistry.register(new Scheme("http", 80, null));
        return new PoolingClientConnectionManager(ioreactor, schemeRegistry);
    }
View Full Code Here

        // Web proxy servers
        HttpHost target = route.getTargetHost();
        String host = target.getHostName();
        int port = target.getPort();
        if (port < 0) {
            Scheme scheme = this.connmgr.getSchemeRegistry().getScheme(target.getSchemeName());
            port = scheme.getDefaultPort();
        }
        StringBuilder buffer = new StringBuilder(host.length() + 6);
        buffer.append(host);
        buffer.append(':');
        buffer.append(Integer.toString(port));
View Full Code Here

        }

        String hostname = host.getHostName();
        int port = host.getPort();
        if (port < 0) {
            Scheme scheme = this.connmgr.getSchemeRegistry().getScheme(host);
            port = scheme.getDefaultPort();
        }

        AuthScheme authScheme = authState.getAuthScheme();
        AuthScope authScope = new AuthScope(
                hostname,
View Full Code Here

        HttpHost target = route.getTargetHost();
        HttpHost proxy = route.getProxyHost();
        IOSession iosession = this.entry.getIOSession();

        if (proxy == null) {
            Scheme scheme = this.manager.getSchemeRegistry().getScheme(target);
            LayeringStrategy layeringStrategy = scheme.getLayeringStrategy();
            if (layeringStrategy != null) {
                SSLIOSession ssliosession = (SSLIOSession) layeringStrategy.layer(iosession);
                ssliosession.bind(SSLMode.CLIENT, params);
                iosession = ssliosession;
            }
View Full Code Here

        }
        if (tracker.isLayered()) {
            throw new IllegalStateException("Multiple protocol layering not supported");
        }
        HttpHost target = tracker.getTargetHost();
        Scheme scheme = this.manager.getSchemeRegistry().getScheme(target);
        LayeringStrategy layeringStrategy = scheme.getLayeringStrategy();
        if (layeringStrategy == null) {
            throw new IllegalStateException(scheme.getName() +
                    " scheme does not provider support for protocol layering");
        }
        IOSession iosession = this.entry.getIOSession();
        SSLIOSession ssliosession = (SSLIOSession) layeringStrategy.layer(iosession);
        ssliosession.bind(SSLMode.CLIENT, params);
View Full Code Here

        if (target == null) {
            throw new IllegalStateException("Target host may be null");
        }
        InetAddress local = ConnRouteParams.getLocalAddress(request.getParams());
        HttpHost proxy = ConnRouteParams.getDefaultProxy(request.getParams());
        Scheme scheme;
        try {
            scheme = this.schemeRegistry.getScheme(target);
        } catch (IllegalStateException ex) {
            throw new HttpException(ex.getMessage());
        }
        LayeringStrategy layeringStrategy = scheme.getLayeringStrategy();
        boolean secure = layeringStrategy != null && layeringStrategy.isSecure();
        if (proxy == null) {
            route = new HttpRoute(target, local, secure);
        } else {
            route = new HttpRoute(target, local, proxy, secure);
View Full Code Here

        int port = this.localServer.getServiceAddress().getPort();
        this.target = new HttpHost("localhost", port);

        ConnectingIOReactor ioReactor = new DefaultConnectingIOReactor(2, new BasicHttpParams());
        SchemeRegistry schemeRegistry = new SchemeRegistry();
        schemeRegistry.register(new Scheme("http", 80, null));
        this.sessionManager = new PoolingClientConnectionManager(ioReactor, schemeRegistry);
        this.httpclient = new DefaultHttpAsyncClient(ioReactor, this.sessionManager);
    }
View Full Code Here

        int port = this.localServer.getServiceAddress().getPort();
        this.target = new HttpHost("localhost", port, "https");

        ConnectingIOReactor ioReactor = new DefaultConnectingIOReactor(2, new BasicHttpParams());
        SchemeRegistry schemeRegistry = new SchemeRegistry();
        schemeRegistry.register(new Scheme("http", 80, null));
        schemeRegistry.register(new Scheme("https", 443, new SSLLayeringStrategy(this.clientSSLContext)));
        this.sessionManager = new PoolingClientConnectionManager(ioReactor, schemeRegistry);
        this.httpclient = new DefaultHttpAsyncClient(ioReactor, this.sessionManager);
    }
View Full Code Here

        HttpHost target = route.getTargetHost();
        HttpHost proxy = route.getProxyHost();
        IOSession iosession = this.entry.getIOSession();

        if (proxy == null) {
            Scheme scheme = this.manager.getSchemeRegistry().getScheme(target);
            LayeringStrategy layeringStrategy = scheme.getLayeringStrategy();
            if (layeringStrategy != null) {
                SSLIOSession ssliosession = (SSLIOSession) layeringStrategy.layer(iosession);
                ssliosession.bind(SSLMode.CLIENT, params);
                iosession = ssliosession;
            }
View Full Code Here

TOP

Related Classes of org.apache.http.nio.conn.scheme.Scheme

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.