Package org.apache.commons.httpclient.protocol

Examples of org.apache.commons.httpclient.protocol.Protocol


        // Append method name
        buf.append(name);
        buf.append(" ");
        // Absolute or relative URL?
        if (!connection.isTransparent()) {
            Protocol protocol = connection.getProtocol();
            buf.append(protocol.getScheme().toLowerCase());
            buf.append("://");
            buf.append(connection.getHost());
            if ((connection.getPort() != -1)
                && (connection.getPort() != protocol.getDefaultPort())
            ) {
                buf.append(":");
                buf.append(connection.getPort());
            }
        }
View Full Code Here


                usingSecureSocket = isSecure() && !isProxied();
                // use the protocol's socket factory unless this is a secure
                // proxied connection
                ProtocolSocketFactory socketFactory = null;
                if (isSecure() && isProxied()) {
                    Protocol defaultprotocol = Protocol.getProtocol("http");
                    socketFactory = defaultprotocol.getSocketFactory();
                } else {
                    socketFactory = this.protocolInUse.getSocketFactory();
                }
                this.socket = socketFactory.createSocket(
                            host, port,
View Full Code Here

     * Set the given host. Uses the default protocol("http") and its port.
     *
     * @param host The host(IP or DNS name).
     */
    public synchronized void setHost(final String host) {
        Protocol defaultProtocol = Protocol.getProtocol("http");
        setHost(host, defaultProtocol.getDefaultPort(), defaultProtocol);
    }
View Full Code Here

        if (PROTOCOL_HTTPS.equalsIgnoreCase(schema)){
            SSLManager.getInstance(); // ensure the manager is initialised
            // we don't currently need to do anything further, as this sets the default https protocol
        }

        Protocol protocol = Protocol.getProtocol(schema);

        String host = uri.getHost();
        int port = uri.getPort();

        /*
 
View Full Code Here

        this.hostConfiguration = hostConfiguration ;
       
        scheme = null ;
        if (hostConfiguration != null)
        {
            final Protocol protocol = hostConfiguration.getProtocol() ;
            if (protocol != null)
            {
                scheme = protocol.getScheme() ;
            }
        }
    }
View Full Code Here

        }
        assertPropertySetAndNotBlank(factory, "protocol-socket-factory");
        socketFactory = createFactoryClass(factory, keyMaterial, properties);

        // And finally... configure the host with the protocol....
        protocol = new Protocol(scheme, socketFactory, defaultPort);
        // these lines have to happen after registerProtocol, otherwise they pick up the wrong static value
        if (secure) {
          setHttpsProxyHost(httpClient, properties);
        } else {
          setHttpProxyHost(httpClient, properties);
View Full Code Here

               
                options.setUserName(rmd.getMsgContext().getOptions().getUserName());
                options.setPassword(rmd.getMsgContext().getOptions().getPassword());
               
                if (msgContext.getProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER) != null) {
                    Protocol protocolHandler =
                        (Protocol)msgContext.getProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER);;
                    options.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER, protocolHandler);                
                }
               
                if (msgContext.getParameter(WSHandlerConstants.PW_CALLBACK_REF) != null ) {
View Full Code Here

    protected void initializeProtocol(int port) {
        ProtocolSocketFactory factory;
      if((getAcceptSelfSignedCertificates().booleanValue())) {
        factory = new  EasySSLProtocolSocketFactory();
        Protocol easyhttps = new Protocol("https", factory, port);
        Protocol.registerProtocol("https", easyhttps);
      } else {
        factory = new  SSLProtocolSocketFactory();
        Protocol stricthttps = new Protocol("https", factory, port);
        Protocol.registerProtocol("https", stricthttps);
      }
    }
View Full Code Here

        if (isHTTPS){
            SSLManager.getInstance(); // ensure the manager is initialised
            // we don't currently need to do anything further, as this sets the default https protocol
        }

        Protocol protocol = Protocol.getProtocol(schema);

        String host = uri.getHost();
        int port = uri.getPort();

        /*
 
View Full Code Here

            });

            /*
             * Also set up HttpClient defaults
             */
            Protocol protocol = new Protocol(
                    JsseSSLManager.HTTPS,
                    (ProtocolSocketFactory) new HttpSSLProtocolSocketFactory(this, CPS),
                    443);
            Protocol.registerProtocol(JsseSSLManager.HTTPS, protocol);
            log.debug("SSL stuff all set");
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.protocol.Protocol

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.