Package org.apache.http.conn.scheme
Class Scheme
- java.lang.Object
-
- org.apache.http.conn.scheme.Scheme
-
@Contract(threading=IMMUTABLE) @Deprecated public final class Scheme extends java.lang.Object
Deprecated.(4.3) useSchemePortResolverfor default port resolution andRegistryfor socket factory lookups.Encapsulates specifics of a protocol scheme such as "http" or "https". Schemes are identified by lowercase names. Supported schemes are typically collected in aSchemeRegistry.For example, to configure support for "https://" URLs, you could write code like the following:
Scheme https = new Scheme("https", 443, new MySecureSocketFactory()); SchemeRegistry registry = new SchemeRegistry(); registry.register(https);- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description Scheme(java.lang.String name, int port, SchemeSocketFactory factory)Deprecated.Creates a new scheme.Scheme(java.lang.String name, SocketFactory factory, int port)Deprecated.(4.1) UseScheme(String, int, SchemeSocketFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Deprecated.intgetDefaultPort()Deprecated.Obtains the default port.java.lang.StringgetName()Deprecated.Obtains the scheme name.SchemeSocketFactorygetSchemeSocketFactory()Deprecated.Obtains the socket factory.SocketFactorygetSocketFactory()Deprecated.(4.1) UsegetSchemeSocketFactory()inthashCode()Deprecated.booleanisLayered()Deprecated.Indicates whether this scheme allows for layered connections.intresolvePort(int port)Deprecated.Resolves the correct port for this scheme.java.lang.StringtoString()Deprecated.Return a string representation of this object.
-
-
-
Constructor Detail
-
Scheme
public Scheme(java.lang.String name, int port, SchemeSocketFactory factory)Deprecated.Creates a new scheme. Whether the created scheme allows for layered connections depends on the class offactory.- Parameters:
name- the scheme name, for example "http". The name will be converted to lowercase.port- the default port for this schemefactory- the factory for creating sockets for communication with this scheme- Since:
- 4.1
-
Scheme
@Deprecated public Scheme(java.lang.String name, SocketFactory factory, int port)Deprecated.(4.1) UseScheme(String, int, SchemeSocketFactory)Creates a new scheme. Whether the created scheme allows for layered connections depends on the class offactory.- 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 schemeport- the default port for this scheme
-
-
Method Detail
-
getDefaultPort
public final int getDefaultPort()
Deprecated.Obtains the default port.- Returns:
- the default port for this scheme
-
getSocketFactory
@Deprecated public final SocketFactory getSocketFactory()
Deprecated.(4.1) UsegetSchemeSocketFactory()Obtains the socket factory. If this scheme islayered, the factory implementsLayeredSocketFactory.- Returns:
- the socket factory for this scheme
-
getSchemeSocketFactory
public final SchemeSocketFactory getSchemeSocketFactory()
Deprecated.Obtains the socket factory. If this scheme islayered, the factory implementsLayeredSchemeSocketFactory.- Returns:
- the socket factory for this scheme
- Since:
- 4.1
-
getName
public final java.lang.String getName()
Deprecated.Obtains the scheme name.- Returns:
- the name of this scheme, in lowercase
-
isLayered
public final boolean isLayered()
Deprecated.Indicates whether this scheme allows for layered connections.- Returns:
trueif layered connections are possible,falseotherwise
-
resolvePort
public final int resolvePort(int port)
Deprecated.Resolves the correct port for this scheme. Returns the given port if it is valid, the default port otherwise.- Parameters:
port- the port to be resolved, a negative number to obtain the default port- Returns:
- the given port or the defaultPort
-
toString
public final java.lang.String toString()
Deprecated.Return a string representation of this object.- Overrides:
toStringin classjava.lang.Object- Returns:
- a human-readable string description of this scheme
-
equals
public final boolean equals(java.lang.Object obj)
Deprecated.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCodein classjava.lang.Object
-
-