Top Description Constructors Methods
org.hsqldb.server

public final Class ServerConfiguration

extends Object
implements ServerConstants
Class Inheritance
All Implemented Interfaces
org.hsqldb.server.ServerConstants
Imports
java.net.InetAddress, org.hsqldb.lib.HashSet, .StringUtil, org.hsqldb.persist.HsqlProperties

Assists with Server and WebServer configuration tasks.
Author
Campbell Burnet (campbell-burnet@users dot sourceforge.net)
Since
1.7.2
Version
2.7.4

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

the default port used in the absence of an explicit specification.
getDefaultPort
(int
the protocol specifier code of the Server
protocol
,
boolean
if true, retrieve the default port when using secure sockets, else the default port when using plain sockets
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.

public static ServerProperties

Returns:

a new properties object loaded from the specified file
getPropertiesFromFile
(int
int
protocol
,
String
the file's path, without the .properties extension (which is added automatically)
path
,
String
String
extension
)

Retrieves a new HsqlProperties object, if possible, loaded from the specified file.

public static String[]

Returns:

the distinct, known to be valid local InetAddress names for this machine
listLocalInetAddressNames
()

Retrieves an array of Strings naming the distinct, known to be valid local InetAddress names for this machine.

public static ServerProperties

Returns:

a new default properties object
newDefaultProperties
(int
int
protocol
)

Retrieves a new default properties object for a server of the specified protocol

public static void
translateAddressProperty(HsqlProperties
The properties object upon which to perform the translation
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.

public static void
translateDefaultDatabaseProperty(HsqlProperties
The properties object upon which to perform the translation
p
)

Translates the legacy default database form: database=...

public static void
translateDefaultNoSystemExitProperty(HsqlProperties
The properties object upon which to perform the translation
p
)

Translates unspecified no_system_exit property to false, the default typically required when a Server is started from the command line.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ServerConfigurationback to summary
private ServerConfiguration()

Method Detail

getDefaultPortback to summary
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:int

the protocol specifier code of the Server

isTls:boolean

if true, retrieve the default port when using secure sockets, else the default port when using plain sockets

Returns:int

the default port used in the absence of an explicit specification.

getPropertiesFromFileback to summary
public static ServerProperties getPropertiesFromFile(int protocol, String path, String extension)

Retrieves a new HsqlProperties object, if possible, loaded from the specified file.

Parameters
protocol:int

int

path:String

the file's path, without the .properties extension (which is added automatically)

extension:String

String

Returns:ServerProperties

a new properties object loaded from the specified file

listLocalInetAddressNamesback to summary
public static 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:String[]

the distinct, known to be valid local InetAddress names for this machine

newDefaultPropertiesback to summary
public static ServerProperties newDefaultProperties(int protocol)

Retrieves a new default properties object for a server of the specified protocol

Parameters
protocol:int

int

Returns:ServerProperties

a new default properties object

translateAddressPropertyback to summary
public static void translateAddressProperty(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:HsqlProperties

The properties object upon which to perform the translation

translateDefaultDatabasePropertyback to summary
public static void translateDefaultDatabaseProperty(HsqlProperties p)

Translates the legacy default database form: database=... to the 1.7.2 form: database.0=...

Parameters
p:HsqlProperties

The properties object upon which to perform the translation

translateDefaultNoSystemExitPropertyback to summary
public static void translateDefaultNoSystemExitProperty(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:HsqlProperties

The properties object upon which to perform the translation