Module org.hsqldb

Class ServerConfiguration

  • All Implemented Interfaces:
    ServerConstants

    public final class ServerConfiguration
    extends java.lang.Object
    implements ServerConstants
    Assists with Server and WebServer configuration tasks.
    Since:
    1.7.2
    Author:
    Campbell Burnet (campbell-burnet@users dot sourceforge.net)
    • Method Detail

      • getDefaultPort

        public static int getDefaultPort​(int protocol,
                                         boolean isTls)
        Retrieves the default port that a Server will try to use in the absence of an explicitly specified one, given the specified value for whether or not to use secure sockets.
        Parameters:
        protocol - the protocol specifier code of the Server
        isTls - if true, retrieve the default port when using secure sockets, else the default port when using plain sockets
        Returns:
        the default port used in the absence of an explicit specification.
      • getPropertiesFromFile

        public static ServerProperties getPropertiesFromFile​(int protocol,
                                                             java.lang.String path,
                                                             java.lang.String extension)
        Retrieves a new HsqlProperties object, if possible, loaded from the specified file.
        Parameters:
        protocol - int
        path - the file's path, without the .properties extension (which is added automatically)
        extension - String
        Returns:
        a new properties object loaded from the specified file
      • listLocalInetAddressNames

        public static java.lang.String[] listLocalInetAddressNames()
        Retrieves an array of Strings naming the distinct, known to be valid local InetAddress names for this machine. The process is to collect and return the union of the following sets:
        1. InetAddress.getAllByName(InetAddress.getLocalHost().getHostAddress())
        2. InetAddress.getAllByName(InetAddress.getLocalHost().getHostName())
        3. InetAddress.getAllByName(InetAddress.getByName(null).getHostAddress())
        4. InetAddress.getAllByName(InetAddress.getByName(null).getHostName())
        5. InetAddress.getByName("loopback").getHostAddress()
        6. InetAddress.getByName("loopback").getHostname()
        Returns:
        the distinct, known to be valid local InetAddress names for this machine
      • newDefaultProperties

        public static ServerProperties newDefaultProperties​(int protocol)
        Retrieves a new default properties object for a server of the specified protocol
        Parameters:
        protocol - int
        Returns:
        a new default properties object
      • translateAddressProperty

        public static void translateAddressProperty​(org.hsqldb.persist.HsqlProperties p)
        Translates null or zero length value for address key to the special value ServerConstants.SC_DEFAULT_ADDRESS which causes ServerSockets to be constructed without specifying an InetAddress.
        Parameters:
        p - The properties object upon which to perform the translation
      • translateDefaultDatabaseProperty

        public static void translateDefaultDatabaseProperty​(org.hsqldb.persist.HsqlProperties p)
        Translates the legacy default database form: database=... to the 1.7.2 form: database.0=...
        Parameters:
        p - The properties object upon which to perform the translation
      • translateDefaultNoSystemExitProperty

        public static void translateDefaultNoSystemExitProperty​(org.hsqldb.persist.HsqlProperties p)
        Translates unspecified no_system_exit property to false, the default typically required when a Server is started from the command line.
        Parameters:
        p - The properties object upon which to perform the translation