Package org.apache.http.conn.scheme
Class Scheme
java.lang.Object
org.apache.http.conn.scheme.Scheme
Deprecated.
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", 443, new MySecureSocketFactory());
SchemeRegistry registry = new SchemeRegistry();
registry.register(https);
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intDeprecated.The default port for this schemeprivate final booleanDeprecated.Indicates whether this scheme allows for layered connectionsprivate final StringDeprecated.The name of this scheme, in lowercase.private final SchemeSocketFactoryDeprecated.The socket factory for this schemeprivate StringDeprecated.A string representation, fortoString. -
Constructor Summary
ConstructorsConstructorDescriptionScheme(String name, int port, SchemeSocketFactory factory) Deprecated.Creates a new scheme.Scheme(String name, SocketFactory factory, int port) Deprecated.(4.1) UseScheme(String, int, SchemeSocketFactory) -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.intDeprecated.Obtains the default port.getName()Deprecated.Obtains the scheme name.Deprecated.Obtains the socket factory.Deprecated.(4.1) UsegetSchemeSocketFactory()inthashCode()Deprecated.booleanDeprecated.Indicates whether this scheme allows for layered connections.intresolvePort(int port) Deprecated.Resolves the correct port for this scheme.toString()Deprecated.Return a string representation of this object.
-
Field Details
-
name
Deprecated.The name of this scheme, in lowercase. (e.g. http, https) -
socketFactory
Deprecated.The socket factory for this scheme -
defaultPort
private final int defaultPortDeprecated.The default port for this scheme -
layered
private final boolean layeredDeprecated.Indicates whether this scheme allows for layered connections -
stringRep
Deprecated.A string representation, fortoString.
-
-
Constructor Details
-
Scheme
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.(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 Details
-
getDefaultPort
public int getDefaultPort()Deprecated.Obtains the default port.- Returns:
- the default port for this scheme
-
getSocketFactory
Deprecated.(4.1) UsegetSchemeSocketFactory()Obtains the socket factory. If this scheme islayered, the factory implementsLayeredSocketFactory.- Returns:
- the socket factory for this scheme
-
getSchemeSocketFactory
Deprecated.Obtains the socket factory. If this scheme islayered, the factory implementsLayeredSchemeSocketFactory.- Returns:
- the socket factory for this scheme
- Since:
- 4.1
-
getName
Deprecated.Obtains the scheme name.- Returns:
- the name of this scheme, in lowercase
-
isLayered
public boolean isLayered()Deprecated.Indicates whether this scheme allows for layered connections.- Returns:
trueif layered connections are possible,falseotherwise
-
resolvePort
public 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
Deprecated.Return a string representation of this object. -
equals
Deprecated. -
hashCode
public int hashCode()Deprecated.
-
SchemePortResolverfor default port resolution andRegistryfor socket factory lookups.