com.iplanet.am.util
Class SystemProperties

java.lang.Object
  |
  +--com.iplanet.am.util.SystemProperties

public class SystemProperties
extends java.lang.Object

This class provides functionality that allows single-point-of-access to all related system properties.

The system properties can be set in couple of ways: programmatically by calling the initializeProperties method, or can be statically loaded at startup from a file named: AMConfig.[class,properties]. Setting the properties through the API takes precedence and will replace the properties loaded via file. For statically loading the properties via a file, this class tries to first find a class, AMConfig.class, and then a file, AMConfig.properties in the CLASSPATH accessible to this code. The AMConfig.class takes precedence over the flat file AMConfig.properties.

If multiple servers are running, each may have their own configuration file. The naming convention for such scenarios is AMConfig-.


Field Summary
static java.lang.String CONFIG_FILE_NAME
          Default name of the configuration file.
static java.lang.String CONFIG_PATH
          Runtime flag to be set, in order to override the path of the configuration file.
static java.lang.String iasGXId
          Application Server specific deployment configuration
 
Constructor Summary
SystemProperties()
           
 
Method Summary
static java.lang.String get(java.lang.String key)
          This method lets you query for a system property whose value is same as String key.
static java.lang.String get(java.lang.String key, java.lang.String def)
          This method lets you query for a system property whose value is same as String key.
static java.util.Properties getAll()
          This method lets you get all the properties defined and their values.
static java.lang.String getInitializationError()
          Returns error messages during initialization, else null.
static java.util.Properties getPlatform()
          Deprecated. use getAll()
static void initializeProperties(java.util.Properties properties)
          Initializes the properties to be used by Access Manager.
static void initializeProperties(java.lang.String file)
          Initializes properties bundle from the file passed.
static void initializeProperties(java.lang.String propertyName, java.lang.String propertyValue)
          Initializes the property to be used by Access Manager.
static long lastModified()
          Returns a counter for last modification.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iasGXId

public static java.lang.String iasGXId
Application Server specific deployment configuration

CONFIG_PATH

public static final java.lang.String CONFIG_PATH
Runtime flag to be set, in order to override the path of the configuration file.

CONFIG_FILE_NAME

public static final java.lang.String CONFIG_FILE_NAME
Default name of the configuration file.
Constructor Detail

SystemProperties

public SystemProperties()
Method Detail

get

public static java.lang.String get(java.lang.String key)
This method lets you query for a system property whose value is same as String key.
Parameters:
key - type String, the key whose value one is looking for.
Returns:
the value if the key exists; otherwise returns null

get

public static java.lang.String get(java.lang.String key,
                                   java.lang.String def)
This method lets you query for a system property whose value is same as String key.
Parameters:
key - type String , the key whose value one is looking for.
def - type String , the default value the method returns if the key does not exist.
Returns:
the value if the key exists; otherwise returns null

getAll

public static java.util.Properties getAll()
This method lets you get all the properties defined and their values.
Returns:
Properties object with all the key value pairs.

getPlatform

public static java.util.Properties getPlatform()
Deprecated. use getAll()

This method lets you query for all the platform properties defined and their values. Returns a Properties object with all the key value pairs.
Returns:
the platform properties

initializeProperties

public static void initializeProperties(java.lang.String file)
                                 throws java.util.MissingResourceException
Initializes properties bundle from the file passed.
Parameters:
file - type String, file name for the resource bundle
Throws:
java.util.MissingResourceException -  

initializeProperties

public static void initializeProperties(java.util.Properties properties)
Initializes the properties to be used by Access Manager. Ideally this must be called first before any other method is called within Access Manager. 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 access manager

initializeProperties

public static void initializeProperties(java.lang.String propertyName,
                                        java.lang.String propertyValue)
Initializes the property to be used by Access Manager. Ideally this must be called first before any other method is called within Access Manager. This method provides a programmatic way to set a specific property, and will override similar property if loaded for a properties file.
Parameters:
propertyName - property name
propertyValue - property value

lastModified

public static long lastModified()
Returns a counter for last modification. The counter is incremented if the properties are changed by calling the following method initializeProperties. This is a convenience methods for applications to track changes to access manager properties.
Returns:
counter of the last modification

getInitializationError

public static java.lang.String getInitializationError()
Returns error messages during initialization, else null.
Returns:
error messages during initialization