Package org.apache.commons.httpclient.protocol

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


        super(arg0);
    }

    public void testProtocol() {
       
        Protocol p1 = new Protocol("test", new DefaultProtocolSocketFactory(), 123);
        Protocol p2 = new Protocol("test", new DefaultProtocolSocketFactory(), 123);
       
        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));
    }
View Full Code Here


  private static void registerFactory(
    SimpleSSLProtocolSocketFactory factory,
    int port) {
      Protocol.registerProtocol(
        "https",
        new Protocol(
          "https",
          (ProtocolSocketFactory)factory, port));
  }
View Full Code Here

        // 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

        this.httpclient.getHostConfiguration().setProxy(
                this.proxy.getLocalAddress(),
                this.proxy.getLocalPort());

        SimpleSocketFactory serversocketfactory = null;
        Protocol testhttp = null;
        if (this.usessl) {
            serversocketfactory = new SimpleSSLSocketFactory();
            testhttp = new Protocol("https",
                    (ProtocolSocketFactory)new SimpleSSLTestProtocolSocketFactory(), 443);
        } else {
            serversocketfactory = new SimplePlainSocketFactory();
            testhttp = Protocol.getProtocol("http");
        }
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

            synchronized (this) {
                if (protocol == null) {
                    ProtocolSocketFactory sf = new CommonsHttpSSLSocketFactory(
                                    endpoint.getSsl(),
                                    endpoint.getKeystoreManager());
                    protocol = new Protocol("https", sf, 443);
                }
            }
            HttpHost httphost = new HttpHost(uri.getHost(), uri.getPort(), protocol);
            host = new HostConfiguration();
            host.setHost(httphost);
View Full Code Here

        // we must set the host to a secure destination or the CONNECT method
        // will not be used
        client.getHostConfiguration().setHost(
            "notARealHost",
            1234,
            new Protocol(
                "https",
                (ProtocolSocketFactory)new FakeSecureProtocolSocketFactory(),
                443)
        );
       
View Full Code Here

   * Configures the HTTP client
   */
  private void configureClient() {

    // Set up an HTTPS socket factory that accepts self-signed certs.
    Protocol https = new Protocol("https",
        new DummySSLProtocolSocketFactory(), 443);
    Protocol.registerProtocol("https", https);

    HttpConnectionManagerParams params = connectionManager.getParams();
    params.setConnectionTimeout(timeout);
View Full Code Here

        super(arg0);
    }

    public void testProtocol() {
       
        Protocol p1 = new Protocol("test", new DefaultProtocolSocketFactory(), 123);
        Protocol p2 = new Protocol("test", new DefaultProtocolSocketFactory(), 123);
       
        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));
    }
View Full Code Here

        super(arg0);
    }

    public void testProtocol() {
       
        Protocol p1 = new Protocol("test", new DefaultProtocolSocketFactory(), 123);
        Protocol p2 = new Protocol("test", new DefaultProtocolSocketFactory(), 123);
       
        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));
    }
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.