AFUNIXSocketFactory.FactoryArg , AFUNIXSocketFactory.SystemProperty , AFUNIXSocketFactory.URIScheme
| Modifier and Type | Class and Description |
|---|---|
| private abstract static class | AFUNIXSocketFactory.
A socket factory that handles a custom hostname ("localhost", by default, and configured by the
system property "org.newsclub.net.unix.socket.hostname"), forwarding all other
requests to the fallback |
| public static class | AFUNIXSocketFactory.
A socket factory that handles a custom hostname ("localhost", by default, and configured by the
system property "org.newsclub.net.unix.socket.hostname"), forwarding all other
requests to the fallback |
| public static class | AFUNIXSocketFactory.
A socket factory that handles a custom hostname ("junixsocket.localhost", by default, and
configured by the system property "org.newsclub.net.unix.socket.hostname"),
forwarding all other requests to the fallback |
| public static class | AFUNIXSocketFactory.
A socket factory that handles special host names formatted as file:// URIs. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected AFUNIXSocket | connectTo(AFUNIXSocketAddress
The address to connect to. addr)Implements abstract org. Creates a new |
| public Socket | createSocket()
Implements abstract org. Creates an unconnected socket. |
| AFUNIXSocketFactory | back to summary |
|---|---|
| protected AFUNIXSocketFactory() Creates a | |
| connectTo | back to summary |
|---|---|
| protected AFUNIXSocket connectTo(AFUNIXSocketAddress addr) throws IOException Implements abstract org. Doc from org. Creates a new
| |
| createSocket | back to summary |
|---|---|
| public Socket createSocket() throws SocketException Implements abstract org. Doc from javax. Creates an unconnected socket. | |
SocketFactory.
| Modifier and Type | Field and Description |
|---|---|
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| public final boolean | isHostnameSupported(String
The host to check. host)Overrides default org. Checks whether the given hostname is supported by this socket factory. |
| PROP_SOCKET_HOSTNAME | back to summary |
|---|---|
| private static final String PROP_SOCKET_HOSTNAME | |
| DefaultSocketHostnameSocketFactory | back to summary |
|---|---|
| public DefaultSocketHostnameSocketFactory() Creates a | |
| getDefaultSocketHostname | back to summary |
|---|---|
| private static String getDefaultSocketHostname() | |
| isHostnameSupported | back to summary |
|---|---|
| public final boolean isHostnameSupported(String host) Overrides default org. Doc from org. Checks whether the given hostname is supported by this socket factory. If not, calls to
createSocket will cause a | |
SocketFactory.
The socket path is configured through an argument passed by to the constructor.
This is particularly useful for JDBC drivers that take a "socketFactory" and a
"socketFactoryArg". The latter will be passed as a constructor argument.
| Modifier and Type | Field and Description |
|---|---|
| private final File |
| Access | Constructor and Description |
|---|---|
| public | FactoryArg(String
The path to the socket. socketPath)Constructs a new |
| public | FactoryArg(File
The path to the socket. file)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public AFUNIXSocketAddress | addressFromHost(String
The hostname host, int The port, or 0. port)Implements org. Translates a "host" string (and port) to an |
| socketFile | back to summary |
|---|---|
| private final File socketFile | |
| FactoryArg | back to summary |
|---|---|
| public FactoryArg(String socketPath) Constructs a new
| |
| FactoryArg | back to summary |
|---|---|
| public FactoryArg(File file) Constructs a new
| |
| addressFromHost | back to summary |
|---|---|
| public AFUNIXSocketAddress addressFromHost(String host, int port) throws SocketException Implements org. Doc from org. Translates a "host" string (and port) to an
| |
SocketFactory.
The socket path is configured through a system property,
"org.newsclub.net.unix.socket.default".
Note
While it is technically possible, it is highly discouraged to programmatically change the value of the property as it can lead to concurrency issues and undefined behavior.
| Modifier and Type | Field and Description |
|---|---|
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public AFUNIXSocketAddress | addressFromHost(String
The hostname host, int The port, or 0. port)Implements org. Translates a "host" string (and port) to an |
| PROP_SOCKET_DEFAULT | back to summary |
|---|---|
| private static final String PROP_SOCKET_DEFAULT | |
| SystemProperty | back to summary |
|---|---|
| public SystemProperty() Creates a | |
| addressFromHost | back to summary |
|---|---|
| public AFUNIXSocketAddress addressFromHost(String host, int port) throws SocketException Implements org. Doc from org. Translates a "host" string (and port) to an
| |
Note
In some circumstances it is recommended to use "[file:%3A%2F%2F(...)", i.e.
encoded and without the closing bracket. Since this is an invalid hostname, it will not trigger
a DNS lookup, but can still be used within a JDBC Connection URL.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public AFUNIXSocketAddress | addressFromHost(String
The hostname host, int The port, or 0. port)Implements org. Translates a "host" string (and port) to an |
| public boolean | isHostnameSupported(String
The host to check. host)Overrides default org. Checks whether the given hostname is supported by this socket factory. |
| private static String |
| FILE_SCHEME_LOCALHOST | back to summary |
|---|---|
| private static final String FILE_SCHEME_LOCALHOST | |
| FILE_SCHEME_PREFIX | back to summary |
|---|---|
| private static final String FILE_SCHEME_PREFIX | |
| FILE_SCHEME_PREFIX_ENCODED | back to summary |
|---|---|
| private static final String FILE_SCHEME_PREFIX_ENCODED | |
| URIScheme | back to summary |
|---|---|
| public URIScheme() Creates a | |
| addressFromHost | back to summary |
|---|---|
| public AFUNIXSocketAddress addressFromHost(String host, int port) throws SocketException Implements org. Doc from org. Translates a "host" string (and port) to an
| |
| isHostnameSupported | back to summary |
|---|---|
| public boolean isHostnameSupported(String host) Overrides default org. Doc from org. Checks whether the given hostname is supported by this socket factory. If not, calls to
createSocket will cause a | |
| stripBrackets | back to summary |
|---|---|
| private static String stripBrackets(String host) | |