public abstract class AbstractSecureSocketHandler extends Object implements SocketHandler
| Modifier and Type | Field and Description |
|---|---|
protected NodeAuthModuleContext |
CONTEXT
Module context to use
|
| Constructor and Description |
|---|
AbstractSecureSocketHandler(NodeAuthModuleContext context) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Socket |
createSecureSocket(String host,
int port,
SecurityDomain securityDomain,
Socket socketWrapper)
Creates a TLS-enabled secure socket for a given URI and SecurityDomain configuration
|
protected Socket |
createSocket(String host,
int port)
Create non-secure socket for a given URI.
|
protected Socket |
createSocketFromFactory(SocketFactory factory,
String host,
int port)
Creates a new connected socket to a given host and port from a provided Socket Factory.
|
Socket |
getSocket(String host,
int port,
boolean useSecureSocket)
Negotiates and creates a socket for a given hostname and port If requested, the socket is
secured using the implementation's security mechanisms and the default
SecurityDomain for this host and port
|
Socket |
getSocket(String host,
int port,
boolean useSecureSocket,
SecurityDomain securityDomain)
Negotiates and creates a socket for a given hostname and port.
|
Socket |
getSocket(String host,
int port,
boolean useSecureSocket,
SecurityDomain securityDomain,
Socket socketWrapper)
Negotiates and creates a socket for a given hostname and port.
|
Socket |
getSocket(URI uri,
boolean wantTLS)
Negotiates and creates a socket for a given URI.
|
Socket |
getSocket(URI uri,
boolean wantTLS,
SecurityDomain securityDomain)
Negotiates and creates a socket for a given URI.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInputStream, getInputStreamprotected final NodeAuthModuleContext CONTEXT
public AbstractSecureSocketHandler(NodeAuthModuleContext context)
protected abstract Socket createSecureSocket(String host, int port, SecurityDomain securityDomain, Socket socketWrapper) throws Exception
host - Host to connect toport - Port to connect tosecurityDomain - Configuration options to use when securing the socketExceptionpublic Socket getSocket(URI uri, boolean wantTLS) throws Exception
SocketHandlergetSocket in interface SocketHandleruri - The URI for which to open the socketwantTLS - If the socket should be securedExceptionpublic Socket getSocket(URI uri, boolean wantTLS, SecurityDomain securityDomain) throws Exception
SocketHandlergetSocket in interface SocketHandleruri - The URI for which to open the socketwantTLS - If the socket should be securedsecurityDomain - Security Domain config to use in securing the socketExceptionpublic Socket getSocket(String host, int port, boolean useSecureSocket) throws Exception
SocketHandlergetSocket in interface SocketHandlerhost - The hostname or IP address to create a socket toport - The port to create a socket touseSecureSocket - If the socket should be securedExceptionpublic Socket getSocket(String host, int port, boolean useSecureSocket, SecurityDomain securityDomain) throws Exception
SocketHandlergetSocket in interface SocketHandlerhost - The hostname or IP address to create a socket toport - The port to create a socket touseSecureSocket - If the socket should be securedsecurityDomain - Security Domain config to use in securing the socketExceptionpublic Socket getSocket(String host, int port, boolean useSecureSocket, SecurityDomain securityDomain, Socket socketWrapper) throws Exception
SocketHandlergetSocket in interface SocketHandlerhost - The hostname or IP address to create a socket toport - The port to create a socket touseSecureSocket - If the socket should be securedsecurityDomain - Security Domain config to use in securing the socketsocketWrapper - Socket to wrap connection in, generally for HTTPS tunnelsExceptionprotected Socket createSocket(String host, int port) throws SocketException, UnknownHostException
URI - uri to connect toSocketExceptionUnknownHostExceptionExceptionprotected Socket createSocketFromFactory(SocketFactory factory, String host, int port) throws IOException
factory - Java Socket Factory to use in the connectionhost - Hostname to connect toport - Port to connect toIOExceptionCopyright © 2016 Open eHealth Foundation. All rights reserved.