- java.lang.Object
-
- org.hsqldb.server.HsqlSocketFactory
-
- org.hsqldb.server.HsqlSocketFactorySecure
-
- All Implemented Interfaces:
java.util.EventListener
,javax.net.ssl.HandshakeCompletedListener
public final class HsqlSocketFactorySecure extends HsqlSocketFactory implements javax.net.ssl.HandshakeCompletedListener
The default secure socket factory implementation.- Since:
- 1.7.2
- Author:
- Campbell Burnet (campbell-burnet@users dot sourceforge.net), Blaine Simpson (blaine dot simpson at admc dot com)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configureSocket(java.net.Socket socket)
java.net.ServerSocket
createServerSocket(int port)
Creates a secure server socket bound to the specified port.java.net.ServerSocket
createServerSocket(int port, java.lang.String address)
Creates a secure server socket bound to the specified port.java.net.Socket
createSocket(java.lang.String host, int port)
Creates a secure Socket and connects it to the specified remote host at the specified remote port.java.net.Socket
createSocket(java.net.Socket socket, java.lang.String host, int port)
if socket argument is not null, creates a secure Socket as a wrapper for the normal, non-SSL socket.void
handshakeCompleted(javax.net.ssl.HandshakeCompletedEvent evt)
boolean
isSecure()
Retrieves whether this factory produces secure sockets.-
Methods inherited from class org.hsqldb.server.HsqlSocketFactory
getInstance
-
-
-
-
Method Detail
-
configureSocket
public void configureSocket(java.net.Socket socket)
- Overrides:
configureSocket
in classHsqlSocketFactory
-
createServerSocket
public java.net.ServerSocket createServerSocket(int port) throws java.lang.Exception
Creates a secure server socket bound to the specified port. The socket is configured with the socket options given to this factory.- Overrides:
createServerSocket
in classHsqlSocketFactory
- Parameters:
port
- the port to which to bind the secure ServerSocket- Returns:
- the secure ServerSocket
- Throws:
java.lang.Exception
- if a network or security provider error occurs
-
createServerSocket
public java.net.ServerSocket createServerSocket(int port, java.lang.String address) throws java.lang.Exception
Creates a secure server socket bound to the specified port. The socket is configured with the socket options given to this factory.- Overrides:
createServerSocket
in classHsqlSocketFactory
- Parameters:
port
- the port to which to bind the secure ServerSocketaddress
- String- Returns:
- the secure ServerSocket
- Throws:
java.lang.Exception
- if a network or security provider error occurs
-
createSocket
public java.net.Socket createSocket(java.net.Socket socket, java.lang.String host, int port) throws java.lang.Exception
if socket argument is not null, creates a secure Socket as a wrapper for the normal, non-SSL socket. If the socket is null, create a new secure socket. The secure socket is configured using the socket options established for this factory.- Overrides:
createSocket
in classHsqlSocketFactory
- Parameters:
socket
- the existing sockethost
- the server hostport
- the server port- Returns:
- the socket
- Throws:
java.lang.Exception
- if a network or security provider error occurs
-
createSocket
public java.net.Socket createSocket(java.lang.String host, int port) throws java.lang.Exception
Creates a secure Socket and connects it to the specified remote host at the specified remote port. This socket is configured using the socket options established for this factory.- Overrides:
createSocket
in classHsqlSocketFactory
- Parameters:
host
- the server hostport
- the server port- Returns:
- the socket
- Throws:
java.lang.Exception
- if a network or security provider error occurs
-
isSecure
public boolean isSecure()
Retrieves whether this factory produces secure sockets.- Overrides:
isSecure
in classHsqlSocketFactory
- Returns:
- true iff this factory creates secure sockets
-
handshakeCompleted
public void handshakeCompleted(javax.net.ssl.HandshakeCompletedEvent evt)
- Specified by:
handshakeCompleted
in interfacejavax.net.ssl.HandshakeCompletedListener
-
-