java.lang.Object
javax.net.SocketFactory
org.newsclub.net.unix.AFSocketFactory<AFUNIXSocketAddress>
org.newsclub.net.unix.AFUNIXSocketFactory
org.newsclub.net.unix.AFUNIXSocketFactory.URIScheme
- All Implemented Interfaces:
AFSocketAddressFromHostname<AFUNIXSocketAddress>
- Enclosing class:
AFUNIXSocketFactory
A socket factory that handles special host names formatted as file:// URIs.
The file:// URI may also be specified in URL-encoded format, i.e., file:%3A%2F%2F etc.
You may also surround the URL with square brackets ("[" and "]"), whereas the closing bracket
may be omitted.
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.-
Nested Class Summary
Nested classes/interfaces inherited from class org.newsclub.net.unix.AFUNIXSocketFactory
AFUNIXSocketFactory.FactoryArg, AFUNIXSocketFactory.SystemProperty, AFUNIXSocketFactory.URIScheme
Nested classes/interfaces inherited from class org.newsclub.net.unix.AFSocketFactory
AFSocketFactory.FixedAddressSocketFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddressFromHost
(String host, int port) Translates a "host" string (and port) to anAFSocketAddress
.boolean
isHostnameSupported
(String host) Checks whether the given hostname is supported by this socket factory.Methods inherited from class org.newsclub.net.unix.AFUNIXSocketFactory
connectTo, createSocket
Methods inherited from class org.newsclub.net.unix.AFSocketFactory
createSocket, createSocket, createSocket, createSocket, isInetAddressSupported
Methods inherited from class javax.net.SocketFactory
getDefault
-
Constructor Details
-
URIScheme
public URIScheme()Creates aAFUNIXSocketFactory.URIScheme
socket factory.
-
-
Method Details
-
isHostnameSupported
Description copied from interface:AFSocketAddressFromHostname
Checks whether the given hostname is supported by this socket factory. If not, calls to createSocket will cause aSocketException
.- Parameters:
host
- The host to check.- Returns:
true
if supported.
-
addressFromHost
Description copied from interface:AFSocketAddressFromHostname
Translates a "host" string (and port) to anAFSocketAddress
.- Parameters:
host
- The hostnameport
- The port, or 0.- Returns:
- The
AFSocketAddress
- Throws:
SocketException
- If there was a problem converting the hostname
-