SchemePortResolver
for default port
resolution and Registry
for socket factory lookups.@Contract(threading=IMMUTABLE) @Deprecated public final class Scheme extends 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);
Constructor and Description |
---|
Scheme(String name,
int port,
SchemeSocketFactory factory)
Deprecated.
Creates a new scheme.
|
Scheme(String name,
SocketFactory factory,
int port)
Deprecated.
(4.1) Use
Scheme(String, int, SchemeSocketFactory) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Deprecated.
|
int |
getDefaultPort()
Deprecated.
Obtains the default port.
|
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.
|
String |
toString()
Deprecated.
Return a string representation of this object.
|
public Scheme(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(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 int getDefaultPort()
@Deprecated public SocketFactory getSocketFactory()
getSchemeSocketFactory()
layered
, the factory implements
LayeredSocketFactory
.public SchemeSocketFactory getSchemeSocketFactory()
layered
, the factory implements
LayeredSchemeSocketFactory
.public String getName()
public boolean isLayered()
true
if layered connections are possible,
false
otherwisepublic int resolvePort(int port)
port
- the port to be resolved,
a negative number to obtain the default portpublic String toString()
Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.