Class TCPServer

java.lang.Object
com.mckoi.database.jdbcserver.TCPServer

public final class TCPServer extends Object
A TCP/IP socket server that opens a single port and allows JDBC clients to connect through the port to talk with the database.
Author:
Tobias Downer
  • Constructor Summary

    Constructors
    Constructor
    Description
    TCPServer(Database database)
    Constructs the TCPServer over the given DatabaseSystem configuration.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkAvailable(InetAddress bind_address, int tcp_port)
    Checks to see if there's already something listening on the jdbc port.
    void
    Closes the JDBC Server.
    Returns a DebugLogger object that we can log debug messages to.
    int
    Returns the port the JDBC server is on.
    void
    start(InetAddress bind_address, int tcp_port, String connection_pool_model)
    Starts the server running.
    Returns human understandable information about the server.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TCPServer

      public TCPServer(Database database)
      Constructs the TCPServer over the given DatabaseSystem configuration.
  • Method Details

    • Debug

      public final DebugLogger Debug()
      Returns a DebugLogger object that we can log debug messages to.
    • getJDBCPort

      public int getJDBCPort()
      Returns the port the JDBC server is on.
    • checkAvailable

      public boolean checkAvailable(InetAddress bind_address, int tcp_port)
      Checks to see if there's already something listening on the jdbc port. Returns true if the jdbc port in the configuration is available, otherwise returns false.
    • start

      public void start(InetAddress bind_address, int tcp_port, String connection_pool_model)
      Starts the server running. This method returns immediately but spawns its own thread.
    • close

      public void close()
      Closes the JDBC Server.
    • toString

      public String toString()
      Returns human understandable information about the server.
      Overrides:
      toString in class Object