Class SystemPropertiesManager
- java.lang.Object
-
- com.sun.identity.shared.configuration.SystemPropertiesManager
-
public final class SystemPropertiesManager extends Object
This manages the system configuration class. The order for locating the implementation class for ISystemProperties is- Instantiate the class that is defined in System parameter,
com.sun.identity.systemconfiguratione.g.java -D"com.sun.identity.systemconfiguration=mypkg.myconfig" - Instantiate
com.sun.identity.common.SystemConfigurationUtil - Instantiate
com.sun.identity.configuration.SystemProperties
- Instantiate the class that is defined in System parameter,
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringget(String key)Returns property string.static Stringget(String key, String defaultValue)Returns property string.static booleangetAsBoolean(String key)Returns the property value as a booleanstatic booleangetAsBoolean(String key, boolean defaultValue)Returns the property value as a boolean.static intgetAsInt(String key, int defaultValue)Returns property as an integer, returning the default if the property is not set or cannot be parsed as an integer.static ISystemPropertiesgetSystemProperties()Returns system properties implementation class.static voidinitializeProperties(String propertyName, String propertyValue)Initializes the properties map.static voidinitializeProperties(Properties properties)Initializes the properties to be used by Open Federation Library.
-
-
-
Method Detail
-
getSystemProperties
public static ISystemProperties getSystemProperties()
Returns system properties implementation class.- Returns:
- system properties implementation class.
-
get
public static String get(String key)
Returns property string.- Parameters:
key- Key of the property.- Returns:
- property string.
-
get
public static String get(String key, String defaultValue)
Returns property string.- Parameters:
key- Key of the property.defaultValue- Default value if the property is not found.- Returns:
- property string.
-
getAsBoolean
public static boolean getAsBoolean(String key)
Returns the property value as a boolean- Parameters:
key- the key whose value one is looking for.- Returns:
- the boolean value if the key exists; otherwise returns false
- Since:
- 13.0.0
-
getAsBoolean
public static boolean getAsBoolean(String key, boolean defaultValue)
Returns the property value as a boolean.- Parameters:
key- The key whose value one is looking for.defaultValue- The default value to return when the setting is not defined.- Returns:
- The boolean value if the key exists; otherwise the default value is returned.
- Since:
- 13.0.0
-
getAsInt
public static int getAsInt(String key, int defaultValue)
Returns property as an integer, returning the default if the property is not set or cannot be parsed as an integer.- Parameters:
key- the system property name.defaultValue- the default value to use if the property is not present or not an integer.- Returns:
- the property value if present and a valid integer, otherwise the default value.
- Since:
- 12.0.0
-
initializeProperties
public static void initializeProperties(Properties properties)
Initializes the properties to be used by Open Federation Library. Ideally this must be called first before any other method is called within Open Federation Library. This method provides a programmatic way to set the properties, and will override similar properties if loaded for a properties file.- Parameters:
properties- properties for Open Federation Library
-
-