org.hackystat.sensorbase.server
Class ServerProperties

java.lang.Object
  extended by org.hackystat.sensorbase.server.ServerProperties

public class ServerProperties
extends java.lang.Object

Provides access to the values stored in the sensorbase.properties file.

Author:
Philip Johnson

Field Summary
static java.lang.String ADMIN_EMAIL_KEY
          The admin email key.
static java.lang.String ADMIN_PASSWORD_KEY
          The admin password.
static java.lang.String COMPRESS_ON_STARTUP_KEY
          Whether to compress on startup.
static java.lang.String CONTEXT_ROOT_KEY
          The context root key.
static java.lang.String DB_DIR_KEY
          The database directory key.
static java.lang.String DB_IMPL_KEY
          The database implementation class.
static java.lang.String HOSTNAME_KEY
          The hostname key.
static java.lang.String LOGGING_LEVEL_KEY
          The logging level key.
static java.lang.String PORT_KEY
          The sensorbase port key.
static java.lang.String REINDEX_ON_STARTUP_KEY
          Whether to re-index on startup.
static java.lang.String RESTLET_LOGGING_KEY
          The Restlet Logging key.
static java.lang.String SMTP_HOST_KEY
          The SMTP host key.
static java.lang.String SMTP_SERVER_PASS
          The admin email key.
static java.lang.String SMTP_SERVER_USER
          SMTP Server User name.
static java.lang.String TEST_ADMIN_EMAIL_KEY
          The test admin email key.
static java.lang.String TEST_ADMIN_PASSWORD_KEY
          The test admin password.
static java.lang.String TEST_DB_DIR_KEY
          The sensorbase db dir during testing.
static java.lang.String TEST_DOMAIN_KEY
          The test domain key.
static java.lang.String TEST_HOSTNAME_KEY
          The test hostname.
static java.lang.String TEST_INSTALL_KEY
          The test installation key.
static java.lang.String TEST_PORT_KEY
          The sensorbase port key during testing.
static java.lang.String XML_DIR_KEY
          The XML directory key.
 
Constructor Summary
ServerProperties()
          Creates a new ServerProperties instance.
 
Method Summary
 boolean compressOnStartup()
          True if the sensorbase.properties file indicates that the user wishes to compress the db on startup.
 java.lang.String echoProperties()
          Returns a string containing all current properties in alphabetical order.
 java.lang.String get(java.lang.String key)
          Returns the value of the Server Property specified by the key.
 java.lang.String getFullHost()
          Returns the fully qualified host name, such as "http://localhost:9876/sensorbase/".
 boolean reindexOnStartup()
          True if the sensorbase.properties file indicates the user wants to reindex on startup.
 void setTestProperties()
          Sets the following properties to their "test" equivalents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADMIN_EMAIL_KEY

public static final java.lang.String ADMIN_EMAIL_KEY
The admin email key.

See Also:
Constant Field Values

ADMIN_PASSWORD_KEY

public static final java.lang.String ADMIN_PASSWORD_KEY
The admin password.

See Also:
Constant Field Values

CONTEXT_ROOT_KEY

public static final java.lang.String CONTEXT_ROOT_KEY
The context root key.

See Also:
Constant Field Values

DB_DIR_KEY

public static final java.lang.String DB_DIR_KEY
The database directory key.

See Also:
Constant Field Values

DB_IMPL_KEY

public static final java.lang.String DB_IMPL_KEY
The database implementation class.

See Also:
Constant Field Values

HOSTNAME_KEY

public static final java.lang.String HOSTNAME_KEY
The hostname key.

See Also:
Constant Field Values

LOGGING_LEVEL_KEY

public static final java.lang.String LOGGING_LEVEL_KEY
The logging level key.

See Also:
Constant Field Values

RESTLET_LOGGING_KEY

public static final java.lang.String RESTLET_LOGGING_KEY
The Restlet Logging key.

See Also:
Constant Field Values

SMTP_HOST_KEY

public static final java.lang.String SMTP_HOST_KEY
The SMTP host key.

See Also:
Constant Field Values

PORT_KEY

public static final java.lang.String PORT_KEY
The sensorbase port key.

See Also:
Constant Field Values

XML_DIR_KEY

public static final java.lang.String XML_DIR_KEY
The XML directory key.

See Also:
Constant Field Values

TEST_INSTALL_KEY

public static final java.lang.String TEST_INSTALL_KEY
The test installation key.

See Also:
Constant Field Values

TEST_DOMAIN_KEY

public static final java.lang.String TEST_DOMAIN_KEY
The test domain key.

See Also:
Constant Field Values

TEST_PORT_KEY

public static final java.lang.String TEST_PORT_KEY
The sensorbase port key during testing.

See Also:
Constant Field Values

TEST_DB_DIR_KEY

public static final java.lang.String TEST_DB_DIR_KEY
The sensorbase db dir during testing.

See Also:
Constant Field Values

TEST_ADMIN_EMAIL_KEY

public static final java.lang.String TEST_ADMIN_EMAIL_KEY
The test admin email key.

See Also:
Constant Field Values

TEST_ADMIN_PASSWORD_KEY

public static final java.lang.String TEST_ADMIN_PASSWORD_KEY
The test admin password.

See Also:
Constant Field Values

TEST_HOSTNAME_KEY

public static final java.lang.String TEST_HOSTNAME_KEY
The test hostname.

See Also:
Constant Field Values

COMPRESS_ON_STARTUP_KEY

public static final java.lang.String COMPRESS_ON_STARTUP_KEY
Whether to compress on startup.

See Also:
Constant Field Values

REINDEX_ON_STARTUP_KEY

public static final java.lang.String REINDEX_ON_STARTUP_KEY
Whether to re-index on startup.

See Also:
Constant Field Values

SMTP_SERVER_USER

public static final java.lang.String SMTP_SERVER_USER
SMTP Server User name.

See Also:
Constant Field Values

SMTP_SERVER_PASS

public static final java.lang.String SMTP_SERVER_PASS
The admin email key.

See Also:
Constant Field Values
Constructor Detail

ServerProperties

public ServerProperties()
Creates a new ServerProperties instance. Prints an error to the console if problems occur on loading.

Method Detail

setTestProperties

public void setTestProperties()
Sets the following properties to their "test" equivalents. Also sets TEST_INSTALL_KEY to true.


echoProperties

public java.lang.String echoProperties()
Returns a string containing all current properties in alphabetical order.

Returns:
A string with the properties.

get

public java.lang.String get(java.lang.String key)
Returns the value of the Server Property specified by the key.

Parameters:
key - Should be one of the public static final strings in this class.
Returns:
The value of the key, or null if not found.

getFullHost

public java.lang.String getFullHost()
Returns the fully qualified host name, such as "http://localhost:9876/sensorbase/".

Returns:
The fully qualified host name.

compressOnStartup

public boolean compressOnStartup()
True if the sensorbase.properties file indicates that the user wishes to compress the db on startup.

Returns:
True if compress on startup.

reindexOnStartup

public boolean reindexOnStartup()
True if the sensorbase.properties file indicates the user wants to reindex on startup.

Returns:
True if reindex on startup.