Save This Page
Home » httpcomponents-client-4.0.1-src » org.apache » http » conn » scheme » [javadoc | source]
org.apache.http.conn.scheme
public final class: Scheme [javadoc | source]
java.lang.Object
   org.apache.http.conn.scheme.Scheme
Encapsulates specifics of a protocol scheme such as "http" or "https". Schemes are identified by lowercase names. Supported schemes are typically collected in a SchemeRegistry .

For example, to configure support for "https://" URLs, you could write code like the following:

Scheme https = new Scheme("https", new MySecureSocketFactory(), 443);
SchemeRegistry.DEFAULT.register(https);
Constructor:
 public Scheme(String name,
    SocketFactory factory,
    int port) 
    Creates a new scheme. Whether the created scheme allows for layered connections depends on the class of factory.
    Parameters:
    name - the scheme name, for example "http". The name will be converted to lowercase.
    factory - the factory for creating sockets for communication with this scheme
    port - the default port for this scheme
Method from org.apache.http.conn.scheme.Scheme Summary:
equals,   getDefaultPort,   getName,   getSocketFactory,   hashCode,   isLayered,   resolvePort,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.http.conn.scheme.Scheme Detail:
 public final boolean equals(Object obj) 
    Compares this scheme to an object.
 public final int getDefaultPort() 
    Obtains the default port.
 public final String getName() 
    Obtains the scheme name.
 public final SocketFactory getSocketFactory() 
 public int hashCode() 
    Obtains a hash code for this scheme.
 public final boolean isLayered() 
    Indicates whether this scheme allows for layered connections.
 public final int resolvePort(int port) 
    Resolves the correct port for this scheme. Returns the given port if it is valid, the default port otherwise.
 public final String toString() 
    Return a string representation of this object.