|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.conn.scheme.Scheme
@Immutable public final class 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 Summary | |
---|---|
Scheme(String name,
SocketFactory factory,
int port)
Creates a new scheme. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Compares this scheme to an object. |
int |
getDefaultPort()
Obtains the default port. |
String |
getName()
Obtains the scheme name. |
SocketFactory |
getSocketFactory()
Obtains the socket factory. |
int |
hashCode()
Obtains a hash code for this scheme. |
boolean |
isLayered()
Indicates whether this scheme allows for layered connections. |
int |
resolvePort(int port)
Resolves the correct port for this scheme. |
String |
toString()
Return a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Scheme(String name, SocketFactory factory, int port)
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 schemeMethod Detail |
---|
public final int getDefaultPort()
public final SocketFactory getSocketFactory()
layered
, the factory implements
LayeredSocketFactory
.
public final 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 port
public final String toString()
toString
in class Object
public final boolean equals(Object obj)
equals
in class Object
obj
- the object to compare with
true
iff the argument is equal to this schemepublic int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |