| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private String | |
| private boolean | |
| private boolean | |
| private String | |
| private String | |
| private Thread | |
| private static final String | MANAGEMENT_DB_PREFIX
The name of the in-memory management database used by the TCP server to keep the active sessions. |
| private JdbcConnection | |
| private PreparedStatement | |
| private PreparedStatement | |
| private String | |
| private int | |
| private int | |
| private boolean | |
| private final Set | |
| private static final ConcurrentHashMap | |
| private ServerSocket | |
| private static final int | |
| private static final int | |
| private ShutdownHandler | |
| private boolean | |
| private boolean | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv synchronized void | addConnection(int
the connection id id, String the database URL url, String the user name user)Add a connection to the management database. |
| pack-priv boolean | |
| pack-priv void | cancelStatement(String
the session id sessionId, int the statement id statementId)Cancel a running statement. |
| public String | Returns: the database namethe key to test (or database name if no key is used) db)If no key is set, return the original database name. |
| public boolean | getAllowOthers()
Implements org. Check if remote connections are allowed. |
| pack-priv String | |
| pack-priv boolean | |
| public static String | Returns: the database name (usually starting with mem:)the TCP server port port)Get the database name of the management database. |
| public String | |
| public int | |
| public boolean | Returns: true if SSL socket is used, false if plain socket
is usedReturns whether a secure protocol is used. |
| public String | getType()
Implements org. Get the human readable short name of the service. |
| public String | getURL()
Implements org. Get the URL of this service in a human readable form |
| public void | init(String...
the command line options args)Implements org. Initialize the service from command line options. |
| private void | |
| public boolean | |
| public synchronized boolean | isRunning(boolean
if errors should be written traceError)Implements org. Check if the service is running. |
| public void | |
| pack-priv void | |
| pack-priv synchronized void | |
| public void | |
| pack-priv void | |
| public static synchronized void | |
| public synchronized void | |
| public void | |
| private synchronized void | |
| public static void | stopServer(int
the port where the server runs, or 0 for all running servers port, String the password (or null) password, int the shutdown mode, SHUTDOWN_NORMAL or SHUTDOWN_FORCE. shutdownMode)Stop a running server. |
| pack-priv void | |
| pack-priv void |
| allowOthers | back to summary |
|---|---|
| private boolean allowOthers | |
| baseDir | back to summary |
|---|---|
| private String baseDir | |
| ifExists | back to summary |
|---|---|
| private boolean ifExists | |
| isDaemon | back to summary |
|---|---|
| private boolean isDaemon | |
| key | back to summary |
|---|---|
| private String key | |
| keyDatabase | back to summary |
|---|---|
| private String keyDatabase | |
| listenerThread | back to summary |
|---|---|
| private Thread listenerThread | |
| MANAGEMENT_DB_PREFIX | back to summary |
|---|---|
| private static final String MANAGEMENT_DB_PREFIX The name of the in-memory management database used by the TCP server to keep the active sessions. | |
| managementDb | back to summary |
|---|---|
| private JdbcConnection managementDb | |
| managementDbAdd | back to summary |
|---|---|
| private PreparedStatement managementDbAdd | |
| managementDbRemove | back to summary |
|---|---|
| private PreparedStatement managementDbRemove | |
| managementPassword | back to summary |
|---|---|
| private String managementPassword | |
| nextThreadId | back to summary |
|---|---|
| private int nextThreadId | |
| port | back to summary |
|---|---|
| private int port | |
| portIsSet | back to summary |
|---|---|
| private boolean portIsSet | |
| running | back to summary |
|---|---|
| private final Set<TcpServerThread> running | |
| SERVERS | back to summary |
|---|---|
| private static final ConcurrentHashMap<Integer, TcpServer> SERVERS | |
| serverSocket | back to summary |
|---|---|
| private ServerSocket serverSocket | |
| SHUTDOWN_FORCE | back to summary |
|---|---|
| private static final int SHUTDOWN_FORCE | |
| SHUTDOWN_NORMAL | back to summary |
|---|---|
| private static final int SHUTDOWN_NORMAL | |
| shutdownHandler | back to summary |
|---|---|
| private ShutdownHandler shutdownHandler | |
| ssl | back to summary |
|---|---|
| private boolean ssl | |
| stop | back to summary |
|---|---|
| private boolean stop | |
| trace | back to summary |
|---|---|
| private boolean trace | |
| virtualThreads | back to summary |
|---|---|
| private boolean virtualThreads | |
| TcpServer | back to summary |
|---|---|
| public TcpServer() | |
| addConnection | back to summary |
|---|---|
| pack-priv synchronized void addConnection(int id, String url, String user) Add a connection to the management database. | |
| allow | back to summary |
|---|---|
| pack-priv boolean allow(Socket socket) Check if this socket may connect to this server. Remote connections are not allowed if the flag allowOthers is set.
| |
| cancelStatement | back to summary |
|---|---|
| pack-priv void cancelStatement(String sessionId, int statementId) Cancel a running statement.
| |
| checkKeyAndGetDatabaseName | back to summary |
|---|---|
| public String checkKeyAndGetDatabaseName(String db) If no key is set, return the original database name. If a key is set, check if the key matches. If yes, return the correct database name. If not, throw an exception.
| |
| getAllowOthers | back to summary |
|---|---|
| public boolean getAllowOthers() Implements org. Doc from org. Check if remote connections are allowed.
| |
| getBaseDir | back to summary |
|---|---|
| pack-priv String getBaseDir() Get the configured base directory.
| |
| getIfExists | back to summary |
|---|---|
| pack-priv boolean getIfExists() | |
| getManagementDbName | back to summary |
|---|---|
| public static String getManagementDbName(int port) Get the database name of the management database. The management database contains a table with active sessions (SESSIONS).
| |
| getName | back to summary |
|---|---|
| public String getName() Implements org. Doc from org. Get the human readable name of the service. | |
| getPort | back to summary |
|---|---|
| public int getPort() Implements org. Doc from org. Gets the port this service is listening on.
| |
| getSSL | back to summary |
|---|---|
| public boolean getSSL() Returns whether a secure protocol is used.
| |
| getType | back to summary |
|---|---|
| public String getType() Implements org. Doc from org. Get the human readable short name of the service. | |
| getURL | back to summary |
|---|---|
| public String getURL() Implements org. Doc from org. Get the URL of this service in a human readable form | |
| init | back to summary |
|---|---|
| public void init(String... args) Implements org. Doc from org. Initialize the service from command line options. | |
| initManagementDb | back to summary |
|---|---|
| private void initManagementDb() throws SQLException | |
| isDaemon | back to summary |
|---|---|
| public boolean isDaemon() Implements org. Doc from org. Check if a daemon thread should be used.
| |
| isRunning | back to summary |
|---|---|
| public synchronized boolean isRunning(boolean traceError) Implements org. Doc from org. Check if the service is running.
| |
| listen | back to summary |
|---|---|
| public void listen() Implements org. Doc from org. Listen for incoming connections. This method blocks.
| |
| remove | back to summary |
|---|---|
| pack-priv void remove(TcpServerThread t) Remove a thread from the list.
| |
| removeConnection | back to summary |
|---|---|
| pack-priv synchronized void removeConnection(int id) Remove a connection from the management database.
| |
| setShutdownHandler | back to summary |
|---|---|
| public void setShutdownHandler(ShutdownHandler shutdownHandler) | |
| shutdown | back to summary |
|---|---|
| pack-priv void shutdown() Shut down this server. | |
| shutdown | back to summary |
|---|---|
| public static synchronized void shutdown(String url, String password, boolean force, boolean all) throws SQLException Stop the TCP server with the given URL.
| |
| start | back to summary |
|---|---|
| public synchronized void start() throws SQLException Implements org. Doc from org. Start the service. This usually means create the server socket. This method must not block.
| |
| stop | back to summary |
|---|---|
| public void stop() Implements org. Doc from org. Stop the service.
| |
| stopManagementDb | back to summary |
|---|---|
| private synchronized void stopManagementDb() | |
| stopServer | back to summary |
|---|---|
| public static void stopServer(int port, String password, int shutdownMode) Stop a running server. This method is called via reflection from the STOP_SERVER function.
| |
| trace | back to summary |
|---|---|
| pack-priv void trace(String s) Print a message if the trace flag is enabled.
| |
| traceError | back to summary |
|---|---|
| pack-priv void traceError(Throwable e) Print a stack trace if the trace flag is enabled.
| |