SchemePortResolver for default port
resolution and Registry for socket factory lookups.@Contract(threading=IMMUTABLE)
@Deprecated
public final class Scheme
extends java.lang.Object
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);
| Modifier and Type | Field and Description |
|---|---|
private int |
defaultPort
Deprecated.
The default port for this scheme
|
private boolean |
layered
Deprecated.
Indicates whether this scheme allows for layered connections
|
private java.lang.String |
name
Deprecated.
The name of this scheme, in lowercase.
|
private SchemeSocketFactory |
socketFactory
Deprecated.
The socket factory for this scheme
|
private java.lang.String |
stringRep
Deprecated.
A string representation, for
toString. |
| Constructor and 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) Use
Scheme(String, int, SchemeSocketFactory) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Deprecated.
|
int |
getDefaultPort()
Deprecated.
Obtains the default port.
|
java.lang.String |
getName()
Deprecated.
Obtains the scheme name.
|
SchemeSocketFactory |
getSchemeSocketFactory()
Deprecated.
Obtains the socket factory.
|
SocketFactory |
getSocketFactory()
Deprecated.
(4.1) Use
getSchemeSocketFactory() |
int |
hashCode()
Deprecated.
|
boolean |
isLayered()
Deprecated.
Indicates whether this scheme allows for layered connections.
|
int |
resolvePort(int port)
Deprecated.
Resolves the correct port for this scheme.
|
java.lang.String |
toString()
Deprecated.
Return a string representation of this object.
|
private final java.lang.String name
private final SchemeSocketFactory socketFactory
private final int defaultPort
private final boolean layered
private java.lang.String stringRep
toString.public Scheme(java.lang.String name,
int port,
SchemeSocketFactory factory)
factory.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@Deprecated
public Scheme(java.lang.String name,
SocketFactory factory,
int port)
Scheme(String, int, SchemeSocketFactory)factory.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 schemepublic final int getDefaultPort()
@Deprecated public final SocketFactory getSocketFactory()
getSchemeSocketFactory()layered, the factory implements
LayeredSocketFactory.public final SchemeSocketFactory getSchemeSocketFactory()
layered, the factory implements
LayeredSchemeSocketFactory.public final java.lang.String getName()
public final boolean isLayered()
true if layered connections are possible,
false otherwisepublic final int resolvePort(int port)
port - the port to be resolved,
a negative number to obtain the default portpublic final java.lang.String toString()
toString in class java.lang.Objectpublic final boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object