org.hackystat.telemetry.service.server
Class ServerProperties

java.lang.Object
  extended by org.hackystat.telemetry.service.server.ServerProperties

public class ServerProperties
extends java.lang.Object

Provides access to the values stored in the telemetry.properties file, and provides default values if the file is not found.

Author:
Philip Johnson

Field Summary
static java.lang.String CACHE_CAPACITY
          The in-memory capacity of each DPDClient cache.
static java.lang.String CACHE_ENABLED
          Indicates whether DPDClient caching is enabled.
static java.lang.String CACHE_MAX_LIFE
          The maxLife in days for each instance in each DPDClient cache.
static java.lang.String CONTEXT_ROOT_KEY
          The dailyprojectdata context root.
static java.lang.String DAILYPROJECTDATA_FULLHOST_KEY
          The DPD host.
static java.lang.String DEF_DIR_KEY
          The definitions directory key.
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 PREFETCH_DIR_KEY
          The prefetch directory key.
static java.lang.String SENSORBASE_FULLHOST_KEY
          The sensorbase host.
static java.lang.String TEST_DAILYPROJECTDATA_FULLHOST_KEY
          The test dpd host key.
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_HOST_KEY
          The test sensorbase host 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 in days as a double If the property has an illegal value, then return the default.
 java.lang.String getFullHost()
          Returns the fully qualified host name, such as "http://localhost:9878/telemetry/".
 boolean isCacheEnabled()
          Returns true if 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 host.

See Also:
Constant Field Values

DAILYPROJECTDATA_FULLHOST_KEY

public static final java.lang.String DAILYPROJECTDATA_FULLHOST_KEY
The DPD host.

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

DEF_DIR_KEY

public static final java.lang.String DEF_DIR_KEY
The definitions directory key.

See Also:
Constant Field Values

PREFETCH_DIR_KEY

public static final java.lang.String PREFETCH_DIR_KEY
The prefetch directory 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_HOST_KEY

public static final java.lang.String TEST_SENSORBASE_HOST_KEY
The test sensorbase host key.

See Also:
Constant Field Values

TEST_DAILYPROJECTDATA_FULLHOST_KEY

public static final java.lang.String TEST_DAILYPROJECTDATA_FULLHOST_KEY
The test dpd host key.

See Also:
Constant Field Values

CACHE_ENABLED

public static final java.lang.String CACHE_ENABLED
Indicates whether DPDClient 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 DPDClient cache.

See Also:
Constant Field Values

CACHE_CAPACITY

public static final java.lang.String CACHE_CAPACITY
The in-memory capacity of each DPDClient cache.

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".


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:9878/telemetry/".

Returns:
The fully qualified host name.

isCacheEnabled

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

Returns:
True if caching enabled.

getCacheMaxLife

public double getCacheMaxLife()
Returns the caching max life in days 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.