Package fr.dyade.aaa.common
Class Configuration
- java.lang.Object
-
- fr.dyade.aaa.common.Configuration
-
public class Configuration extends Object
This class holds a static list of properties accessible from anywhere. It is used to avoid multiplying system-wide properties. Note that in the case of a server, the properties from the configuration file are reinjected into this object.
-
-
Field Summary
Fields Modifier and Type Field Description private static Propertiesproperties
-
Constructor Summary
Constructors Constructor Description Configuration()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleangetBoolean(String key)Determines the boolean value of the property with the specified name.static IntegergetInteger(String key)Determines the integer value of the property with the specified name.static IntegergetInteger(String key, int value)Determines the integer value of the property with the specified name.static LonggetLong(String key)Determines the integer value of the property with the specified name.static LonggetLong(String key, long value)Determines the long value of the property with the specified name.static PropertiesgetProperties()Returns a Properties object initialized with defaults specified from AgentServer configuration file and System properties.static StringgetProperty(String key)Searches for the property with the specified key in the property list.static StringgetProperty(String key, String value)Searches for the property with the specified key in the property list.static voidputProperty(String name, String value)Adds a new property to the configuration.
-
-
-
Field Detail
-
properties
private static Properties properties
-
-
Method Detail
-
getProperties
public static Properties getProperties()
Returns a Properties object initialized with defaults specified from AgentServer configuration file and System properties.- Returns:
- a Properties object initialized with specified defaults.
-
getProperty
public static String getProperty(String key)
Searches for the property with the specified key in the property list.- Parameters:
key- the hashtable key.- Returns:
- the value with the specified key value.
-
getProperty
public static String getProperty(String key, String value)
Searches for the property with the specified key in the property list.- Parameters:
key- the hashtable key.value- a default value.- Returns:
- the value with the specified key value.
-
getInteger
public static Integer getInteger(String key)
Determines the integer value of the property with the specified name.- Parameters:
key- property name.- Returns:
- the Integer value of the property.
-
getInteger
public static Integer getInteger(String key, int value)
Determines the integer value of the property with the specified name.- Parameters:
key- property name.value- a default value.- Returns:
- the Integer value of the property.
-
getLong
public static Long getLong(String key)
Determines the integer value of the property with the specified name.- Parameters:
key- property name.- Returns:
- the Integer value of the property.
-
getLong
public static Long getLong(String key, long value)
Determines the long value of the property with the specified name.- Parameters:
key- property name.value- a default value.- Returns:
- the Integer value of the property.
-
getBoolean
public static boolean getBoolean(String key)
Determines the boolean value of the property with the specified name. The returned value is true if the property is defined and is equal, ignoring case, to the string "true".Otherwise, a false value is returned.- Parameters:
key- property name.- Returns:
- the boolean value of the property.
-
-