com.sun.mfwk.config
Class MfConfig

java.lang.Object
  extended bycom.sun.mfwk.config.MfConfig

public class MfConfig
extends java.lang.Object

This class implements the MfConfig object which exposes configuration data of the agent. The data is read from a configuration file. By default the config file is /etc/opt/SUNWmfwk/config/agent.properties

The actual properties are:

mfwk.jobtool.dir (default: /opt/SUNWmfwk/jobtool)
mfwk.log.dir (default: /var/opt/SUNWmfwk/logs)
mfwk.log.file (default: agent.log)
mfwk.jobtool.dir (default: /opt/SUNWmfwk/jobtool)
mfwk.log.level (default: SEVERE)
mfwk.log.maxsize (default: 100000)
mfwk.log.nbfiles (default: 3)
mfwk.log.format (default: SIMPLE)
mfwk.multicast.group (default: 225.225.225.1)
mfwk.multicast.port (default: 12345)
mfwk.multicast.disableloopback (default: false)
mfwk.agent.cms.measurement.data_path (default: /var/opt/SUNWmfwk/reports/measurement)
mfwk.agent.cms.measurement.report_lifetime (default: 24)
mfwk.agent.cms.measurement.ftp_url (default: ftp://user:passwd@host/)
mfwk.agent.cms.measurement.perf_dtd_fileurl (default: file:///opt/SUNWmfwk/dtd/perf.dtd)
mfwk.agent.cms.opstatus.data_path (default: /var/opt/SUNWmfwk/reports/opstatus)
mfwk.agent.cms.opstatus.report_lifetime (default: 24)
mfwk.agent.cms.opstatus.ftp_url (default: ftp://user:passwd@host/)
mfwk.agent.cms.opstatus.opstatus_dtd_fileurl (default: file:///opt/SUNWmfwk/dtd/opstatus.dtd)
mfwk.agent.cms.common_dtd_fileurl (default: file://opt/SUNWmfwk/dtd/common.dtd)
mfwk.agent.cms.file_dtd_fileurl (default: file://opt/SUNWmfwk/dtd/file.dtd)
mfwk.agent.security.disckeyfile (default: /etc/opt/SUNWmfwk/security/disc.key)
mfwk.agent.security.password_file (default: /etc/opt/SUNWmfwk/security/passwd)
mfwk.agent.security.keystore (default: /etc/opt/SUNWmfwk/security/keystore)
mfwk.agent.security.truststore (default: /etc/opt/SUNWmfwk/security/truststore/)
mfwk.agent.security.trustpass (default: "mfwktrust")
In addtion, the MfKeystorePassword field is a placeholder for the password of the agent's keystore.
2 methods allow to get and set the keystore password: getKeystorePassword() and setKeyStorePassword().


Method Summary
static MfConfig getConfig()
          Static method to get a reference on the MfConfig object.
 char[] getKeystorePassword()
          Use this method to retrieve the Mfwk Agent Keystore password.
 java.util.Properties getProperties()
          Use this method to get the whole set of properties.
 java.lang.String getProperty(java.lang.String key)
          Use this method to get a single property
 boolean isPublic(java.lang.String propertyName)
          Use this method to know if a property is public or not.
 void setKeystorePassword(char[] password)
          Use this method to set the Mfwk Agent Keystore password.
 void setProperty(java.lang.String key, java.lang.String value)
          Use this method to set a property
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConfig

public static MfConfig getConfig()
Static method to get a reference on the MfConfig object. The MfConfig object is created the first time this method is called.

Returns:
the MfConfig object

getProperties

public java.util.Properties getProperties()
Use this method to get the whole set of properties.

Returns:
the Properties object containing the Java ES-MF properties

getProperty

public java.lang.String getProperty(java.lang.String key)
Use this method to get a single property

Parameters:
key - the string containing the name of the property.
Ex. "mfwk.log.dir"
Returns:
return the property value as a String.

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Use this method to set a property

Parameters:
key - new key to add.
value - value associated with the new key

getKeystorePassword

public char[] getKeystorePassword()
Use this method to retrieve the Mfwk Agent Keystore password.

Returns:
the password as a char array

setKeystorePassword

public void setKeystorePassword(char[] password)
Use this method to set the Mfwk Agent Keystore password.

Parameters:
password - the passwors as a char array.

isPublic

public boolean isPublic(java.lang.String propertyName)
Use this method to know if a property is public or not.

Parameters:
propertyName - the property name to check
Returns:
true if the property is public, false otherwise