Package org.apache.commons.httpclient.protocol

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


        super.setHost(host, getPort(), getProtocol());
    }

    private Protocol cloneProtocolKeepingSocketFactory(Protocol protocol)
    {
        Protocol original = getProtocol();
        if (protocol.getScheme().equals(original.getScheme()))
        {
            // the protocol is the same, create a copy of it but keep the original socket factory
            return new Protocol(protocol.getScheme(), original.getSocketFactory(),
                protocol.getDefaultPort());
        }
        return protocol;
    }
View Full Code Here


                && !BooleanUtils.toBoolean(disableCheck);
    }

    protected HostConfiguration getHostConfig(URI uri) throws Exception
    {
        Protocol protocol = Protocol.getProtocol(uri.getScheme().toLowerCase());

        String host = uri.getHost();
        int port = uri.getPort();
        HostConfiguration config = new HostConfiguration();
        config.setHost(host, port, protocol);
View Full Code Here

        HostConfiguration hostConfig = new MuleHostConfiguration(super.getHostConfig(uri));

        HttpsConnector httpsConnector = (HttpsConnector) connector;
        SSLSocketFactory factory = httpsConnector.getSslSocketFactory();
        ProtocolSocketFactory protocolSocketFactory = new MuleSecureProtocolSocketFactory(factory);
        Protocol protocol = new Protocol(uri.getScheme().toLowerCase(), protocolSocketFactory, 443);
       
        String host = uri.getHost();
        int port = uri.getPort();
        hostConfig.setHost(host, port, protocol);           
       
View Full Code Here

    @SuppressWarnings("deprecation")
    public void testSetHostViaHostAndVirtualHostAndPortAndProtocol()
    {
        HostConfiguration hostConfig = createHostConfiguration();

        Protocol protocol = Protocol.getProtocol("http");
        hostConfig.setHost("www.mulesoft.org", "www.mulesoft.com", 8080, protocol);
       
        assertMockSocketFactory(hostConfig);
        assertEquals("www.mulesoft.org", hostConfig.getHost());
        assertEquals(8080, hostConfig.getPort());
View Full Code Here

        {
            protected void doTest() throws Exception
            {
                HostConfiguration hostConfig = createHostConfiguration();

                Protocol protocol = Protocol.getProtocol("httpx");
                hostConfig.setHost("www.mulesoft.org", "www.mulesoft.com", 8080, protocol);
               
                assertDefaultSocketFactory(hostConfig);
                assertEquals("www.mulesoft.org", hostConfig.getHost());
                assertEquals(8080, hostConfig.getPort());
View Full Code Here

   
    private MuleHostConfiguration createHostConfiguration()
    {
        MuleHostConfiguration hostConfig = new MuleHostConfiguration();
        ProtocolSocketFactory socketFactory = new MockSecureProtocolFactory();
        Protocol protocol = new Protocol("http", socketFactory, 80);
        hostConfig.setHost("localhost", 80, protocol);
       
        // since we're using a setHost variant here, too let's assert that it actually worked
        assertMockSocketFactory(hostConfig);
       
View Full Code Here

       
        public void test() throws Exception
        {
            try
            {
                Protocol httpxProtocol = new Protocol(HTTPX, new DefaultProtocolSocketFactory(), 81);
                Protocol.registerProtocol(HTTPX, httpxProtocol);
               
                doTest();
            }
            finally
View Full Code Here

        instance = this;
    }

    private void init() {
        // Register the trust manager to use when using HTTPS
        Protocol easyhttps = new Protocol("https", (ProtocolSocketFactory) new SSLProtocolSocketFactory(this), 443);
        Protocol.registerProtocol("https", easyhttps);

        // Convert XML based provider setup to Database based
        JiveGlobals.migrateProperty("clearspace.uri");
        JiveGlobals.migrateProperty("clearspace.sharedSecret");
View Full Code Here

      try
      {
        easySSL = new SoapUIEasySSLProtocolSocketFactory();
        initSSL( easySSL );

        Protocol easyhttps = new Protocol( "https", ( ProtocolSocketFactory )easySSL, 443 );
        Protocol.registerProtocol( "https", easyhttps );
      }
      catch( Throwable e )
      {
        SoapUI.log( e );
View Full Code Here

    // get a client isntance -- we just need one.

    client = new HttpClient(connectionManager);

    // Set up an HTTPS socket factory that accepts self-signed certs.
    Protocol dummyhttps = new Protocol("https", new DummySSLProtocolSocketFactory(), 443);
    Protocol.registerProtocol("https", dummyhttps);
   
    HttpConnectionManagerParams params = connectionManager.getParams();
    params.setConnectionTimeout(TIMEOUT);
    params.setSoTimeout(TIMEOUT);
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.