Class SystemPropertiesManager


  • public final class SystemPropertiesManager
    extends Object
    This manages the system configuration class. The order for locating the implementation class for ISystemProperties is
    1. Instantiate the class that is defined in System parameter, com.sun.identity.systemconfiguration e.g. java -D"com.sun.identity.systemconfiguration=mypkg.myconfig"
    2. Instantiate com.sun.identity.common.SystemConfigurationUtil
    3. Instantiate com.sun.identity.configuration.SystemProperties
    • 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
      • initializeProperties

        public static void initializeProperties​(String propertyName,
                                                String propertyValue)
        Initializes the properties map.
        Parameters:
        propertyName - Name of properties.
        propertyValue - Value of properties.