org.hackystat.dailyprojectdata.server
Class ServerProperties

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

public class ServerProperties
extends java.lang.Object

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

Author:
Philip Johnson

Field Summary
static java.lang.String CACHE_CAPACITY
          The total capacity of each SensorBaseClient cache.
static java.lang.String CACHE_ENABLED
          Indicates whether SensorBaseClient caching is enabled.
static java.lang.String CACHE_MAX_LIFE
          The maxLife in days for each instance in each SensorBaseClient cache.
static java.lang.String CONTEXT_ROOT_KEY
          The dailyprojectdata context root.
static java.lang.String FRONTSIDECACHE_ENABLED
          Whether or not the front side cache is enabled.
static java.lang.String HOSTNAME_KEY
          The dailyprojectdata hostname key.
static java.lang.String LOGGING_LEVEL_KEY
          The logging level key.
static java.lang.String PORT_KEY
          The dailyprojectdata port key.
static java.lang.String RESTLET_LOGGING_KEY
          The Restlet Logging key.
static java.lang.String SENSORBASE_FULLHOST_KEY
          The sensorbase fully qualified host name, such as http://localhost:9876/sensorbase.
static java.lang.String TEST_HOSTNAME_KEY
          The test installation key.
static java.lang.String TEST_INSTALL_KEY
          The test installation key.
static java.lang.String TEST_PORT_KEY
          The dpd port key during testing.
static java.lang.String TEST_SENSORBASE_FULLHOST_KEY
          The test installation key.
static java.lang.String XML_DIR_KEY
          The XML directory key.
 
Constructor Summary
ServerProperties()
          Creates a new ServerProperties instance.
 
Method Summary
 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.
 long getCacheCapacity()
          Returns the in-memory capacity for each cache.
 double getCacheMaxLife()
          Returns the caching max life as a double.
 java.lang.String getFullHost()
          Returns the fully qualified host name, such as "http://localhost:9877/dailyprojectdata/".
 boolean isCacheEnabled()
          Returns true if caching is enabled in this service.
 boolean isFrontSideCacheEnabled()
          Returns true if front side caching is enabled in this service.
 void setTestProperties()
          Sets the following properties' values to their "test" equivalent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SENSORBASE_FULLHOST_KEY

public static final java.lang.String SENSORBASE_FULLHOST_KEY
The sensorbase fully qualified host name, such as http://localhost:9876/sensorbase.

See Also:
Constant Field Values

HOSTNAME_KEY

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

See Also:
Constant Field Values

CONTEXT_ROOT_KEY

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

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

PORT_KEY

public static final java.lang.String PORT_KEY
The dailyprojectdata 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

RESTLET_LOGGING_KEY

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

See Also:
Constant Field Values

TEST_PORT_KEY

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

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_HOSTNAME_KEY

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

See Also:
Constant Field Values

TEST_SENSORBASE_FULLHOST_KEY

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

See Also:
Constant Field Values

CACHE_ENABLED

public static final java.lang.String CACHE_ENABLED
Indicates whether SensorBaseClient caching is enabled.

See Also:
Constant Field Values

CACHE_MAX_LIFE

public static final java.lang.String CACHE_MAX_LIFE
The maxLife in days for each instance in each SensorBaseClient cache.

See Also:
Constant Field Values

CACHE_CAPACITY

public static final java.lang.String CACHE_CAPACITY
The total capacity of each SensorBaseClient cache.

See Also:
Constant Field Values

FRONTSIDECACHE_ENABLED

public static final java.lang.String FRONTSIDECACHE_ENABLED
Whether or not the front side cache is enabled.

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' values to their "test" equivalent. Also sets TEST_INSTALL_KEY's value to "true".


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:9877/dailyprojectdata/".

Returns:
The fully qualified host name.

isCacheEnabled

public boolean isCacheEnabled()
Returns true if caching is enabled in this service.

Returns:
True if caching enabled.

isFrontSideCacheEnabled

public boolean isFrontSideCacheEnabled()
Returns true if front side caching is enabled in this service.

Returns:
True if caching enabled.

getCacheMaxLife

public double getCacheMaxLife()
Returns the caching max life as a double. If the property has an illegal value, then return the default.

Returns:
The max life of each instance in the cache.

getCacheCapacity

public long getCacheCapacity()
Returns the in-memory capacity for each cache. If the property has an illegal value, then return the default.

Returns:
The in-memory capacity.

echoProperties

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

Returns:
A string with the properties.