java.lang.Object
org.hsqldb.server.HsqlSocketFactory
- Direct Known Subclasses:
HsqlSocketFactorySecure
Base class for producing the Socket objects used by HSQLDB.
- Since:
- 1.7.2
- Author:
- Blaine Simpson (blaine dot simpson at admc dot com), Campbell Burnet (campbell-burnet@users dot sourceforge.net)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configureSocket
(Socket socket) createServerSocket
(int port) Returns a server socket bound to the specified port.createServerSocket
(int port, String address) Returns a server socket bound to the specified port.createSocket
(String host, int port) Creates a socket and connects it to the specified remote host at the specified remote port.createSocket
(Socket socket, String host, int port) If socket argument is not null, returns it.static HsqlSocketFactory
getInstance
(boolean tls) Retrieves an HsqlSocketFactory whose subclass and attributes are determined by the specified argument, tls.boolean
isSecure()
Retrieves whether this factory produces secure sockets.
-
Method Details
-
getInstance
Retrieves an HsqlSocketFactory whose subclass and attributes are determined by the specified argument, tls.- Parameters:
tls
- whether to retrieve a factory producing SSL sockets- Returns:
- a new factory
- Throws:
Exception
- if the new factory cannot be constructed or is of the wrong type
-
configureSocket
-
createServerSocket
Returns a server socket bound to the specified port. The socket is configured with the socket options given to this factory.- Parameters:
port
- the port to which to bind the ServerSocket- Returns:
- the ServerSocket
- Throws:
Exception
- if a network error occurs
-
createServerSocket
Returns a server socket bound to the specified port. The socket is configured with the socket options given to this factory.- Parameters:
port
- the port to which to bind the ServerSocketaddress
- String- Returns:
- the ServerSocket
- Throws:
Exception
- if a network error occurs
-
createSocket
If socket argument is not null, returns it. If it is null, creates a 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.- Parameters:
socket
- the existing socket, can be nullhost
- the server hostport
- the server port- Returns:
- the socket
- Throws:
Exception
- if a network error occurs
-
createSocket
Creates a 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.- Parameters:
host
- the server hostport
- the server port- Returns:
- the socket
- Throws:
Exception
- if a network error occurs
-
isSecure
public boolean isSecure()Retrieves whether this factory produces secure sockets.- Returns:
- true if this factory produces secure sockets
-