ABLE 2.3.0 07/13/2005 14:21:00

com.ibm.able
Class AblePreferences

java.lang.Object
  extended bycom.ibm.able.AblePreferences

public class AblePreferences
extends java.lang.Object

The AblePreferences class contains preferences for the base Able classes. The preferences include:

The actual preferences file that is read and written is located in the directory specified by the "able.prefdir" system property when the Able class is loaded.

An example preferences file is located at in the ABL product directory.


Constructor Summary
AblePreferences()
          Instantiate all preferences from a Properties file read from disk.
 
Method Summary
 java.lang.String getCommPort()
          Returns the current value of the CommPort property.
 long getMessageLogConsoleSeverity()
          Returns the preference for the severity of the message logger's console handler.
 boolean getMessageLogDailyFile()
          Indicates a preference for daily message log files.
 java.lang.String getMessageLogFileName()
          Returns the path and name for the message log file handler.
 long getMessageLogFileSeverity()
          Returns the preference for the severity of the message logger's file handler.
 boolean getSecurity()
          Returns the current value of the Security property.
 java.lang.String getSmtpRelay()
          Returns the current value of the SMTP relay property.
 java.lang.String getSocketFactoryClass()
          Returns the current value of the Socket Factory Class property.
 long getTraceLogConsoleLevel()
          Returns the preference for the level of the trace logger's console handler.
 boolean getTraceLogDailyFile()
          Indicates a preference for daily trace log files.
 long getTraceLogFileLevel()
          Returns the preference for the level of the trace logger's file handler.
 java.lang.String getTraceLogFileName()
          Returns the path and name for the trace log file handler.
 java.lang.String getWorkingDirectory()
          Returns the current value of the working directory property.
 boolean isSecure()
          Returns the current value of the Security property.
 void readPropertiesFile()
          Load up the current set of working preferences from a physical properties file.
 void setCommPort(java.lang.String theValue)
          Sets the current value of the CommPort property.
 void setMessageLogConsoleSeverity(long theValue)
          Sets the preference for the severity of the message logger's console handler.
 void setMessageLogDailyFile(boolean theValue)
          Sets the preference for daily message log files.
 void setMessageLogFileName(java.lang.String fileName)
          Sets the path and name for the message log file handler.
 void setMessageLogFileSeverity(long theValue)
          Sets the preference for the severity of the message logger's file handler.
 void setSmtpRelay(java.lang.String theValue)
          Sets the current value of the SMTP relay property.
 void setSocketFactoryClass(java.lang.String theValue)
          Sets the current value of the Socket Factory Class property.
 void setTraceLogConsoleLevel(long theValue)
          Sets the preference for the level of the trace logger's console handler.
 void setTraceLogDailyFile(boolean theValue)
          Sets the preference for daily trace log files.
 void setTraceLogFileLevel(long theValue)
          Sets the preference for the level of the trace logger's file handler.
 void setTraceLogFileName(java.lang.String fileName)
          Sets the path and name for the trace log file handler.
 void setWorkingDirectory(java.lang.String theValue)
          Sets the current value of the Working Directory property.
 void updatePreferenceVariablesAndWritePropertiesFile(AblePreferences theNewPreferences)
          Change all current working preferences, except Security (which shall not be set programmtically), to the values contained in the specified preferences object.
 void writePropertiesFile()
          Save the current set of working preferences to a physical properties file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AblePreferences

public AblePreferences()
Instantiate all preferences from a Properties file read from disk.

We look for this package's properties file first in the directory as specified by the system property contained in the variable Able.PropertiesFileDirectoryProperty and if the named property isn't set, then in the user's home directory (as contained in the Java system property user.home. If there is no properties file in either location, a default properties file is created.

Method Detail

setWorkingDirectory

public final void setWorkingDirectory(java.lang.String theValue)
Sets the current value of the Working Directory property.

This property specifies which directory ABLE should use for storing its work files.

The default initial value of this property is the value of the user.home system property.

Parameters:
theValue - The fully qualified name of a directory. null is not an acceptable value and will cause errors.
See Also:
getWorkingDirectory()

getWorkingDirectory

public final java.lang.String getWorkingDirectory()
Returns the current value of the working directory property.

Returns:
The current value of the working directory property. The initial value of this property defaults to the system property user.home.
See Also:
setWorkingDirectory(String)

getTraceLogConsoleLevel

public final long getTraceLogConsoleLevel()
Returns the preference for the level of the trace logger's console handler.

Returns:
The current level of the console handler from the AbleTraceLogger.TraceLogLevelValuesVector list.

setTraceLogConsoleLevel

public final void setTraceLogConsoleLevel(long theValue)
Sets the preference for the level of the trace logger's console handler.

Parameters:
theValue - The current level of the console handler, a value from the AbleTraceLogger.TraceLogLevelValuesVector list.

getTraceLogFileLevel

public final long getTraceLogFileLevel()
Returns the preference for the level of the trace logger's file handler.

Returns:
The current level of the file handler from the AbleTraceLogger.TraceLogLevelValuesVector list.

setTraceLogFileLevel

public final void setTraceLogFileLevel(long theValue)
Sets the preference for the level of the trace logger's file handler.

Parameters:
theValue - The current level of the file handler, a value from the AbleTraceLogger.TraceLogLevelValuesVector list.

getTraceLogDailyFile

public boolean getTraceLogDailyFile()
Indicates a preference for daily trace log files. When true a datestamp precedes the extension in the filename, and a new file is created for each day.

Returns:
true if a datestamp is to precede the extension in the filename, and a new file is to be created for each day.

setTraceLogDailyFile

public void setTraceLogDailyFile(boolean theValue)
Sets the preference for daily trace log files.

Parameters:
theValue - true if a datestamp is to precede the extension in the filename, and a new file is to be created for each day.

getTraceLogFileName

public final java.lang.String getTraceLogFileName()
Returns the path and name for the trace log file handler. The default is AbleTrc.log in the user.home directory. If getTraceLogDailyFile() is true, a datestamp will precede the extension.

Returns:
The path and name for the trace log file.

setTraceLogFileName

public final void setTraceLogFileName(java.lang.String fileName)
Sets the path and name for the trace log file handler. If getTraceLogDailyFile() is true, a datestamp will precede the extension.

Parameters:
fileName - The path and name for the trace log file.

getMessageLogConsoleSeverity

public final long getMessageLogConsoleSeverity()
Returns the preference for the severity of the message logger's console handler.

Returns:
The current level of the console handler from the AbleTraceLogger.MessageLogSeverityValuesVector list.

setMessageLogConsoleSeverity

public final void setMessageLogConsoleSeverity(long theValue)
Sets the preference for the severity of the message logger's console handler.

Parameters:
theValue - The current severity of the console handler, a value from the AbleTraceLogger.MessageLogSeverityValuesVector list.

getMessageLogFileSeverity

public final long getMessageLogFileSeverity()
Returns the preference for the severity of the message logger's file handler.

Returns:
The current severity of the file handler from the AbleTraceLogger.MessageLogSeverityValuesVector list.

setMessageLogFileSeverity

public final void setMessageLogFileSeverity(long theValue)
Sets the preference for the severity of the message logger's file handler.

Parameters:
theValue - The current severity of the file handler, a value from the AbleTraceLogger.MessageLogSeverityValuesVector list.

getMessageLogFileName

public final java.lang.String getMessageLogFileName()
Returns the path and name for the message log file handler. The default is AbleMsg.log in the user.home directory. If getMessageLogDailyFile() is true, a datestamp will precede the extension.

Returns:
The path and name for the message log file.

setMessageLogFileName

public final void setMessageLogFileName(java.lang.String fileName)
Sets the path and name for the message log file handler. If getMessageLogDailyFile() is true, a datestamp will precede the extension.

Parameters:
fileName - The path and name for the trace log file.

getMessageLogDailyFile

public boolean getMessageLogDailyFile()
Indicates a preference for daily message log files. When true a datestamp precedes the extension in the filename, and a new file is created for each day.

Returns:
true if a datestamp is to precede the extension in the filename, and a new file is to be created for each day.

setMessageLogDailyFile

public void setMessageLogDailyFile(boolean theValue)
Sets the preference for daily message log files.

Parameters:
theValue - true if a datestamp is to precede the extension in the filename, and a new file is to be created for each day.

setCommPort

public final void setCommPort(java.lang.String theValue)
Sets the current value of the CommPort property.

This property specifies which communications port ABLE code is to use.

The default initial value of this property is the empty string, which means that ABLE uses the default RMI port.

Parameters:
theValue - A port number, preceded by a colon. For example, ":1234". May also be the empty string, as described above, but null is not an acceptable value and will cause errors.
See Also:
getCommPort()

getCommPort

public final java.lang.String getCommPort()
Returns the current value of the CommPort property.

Returns:
The current value of the CommPort property. The initial value of this property defaults to the empty string, which causes ABLE to use the default RMI port.
See Also:
setCommPort(String)

setSocketFactoryClass

public final void setSocketFactoryClass(java.lang.String theValue)
Sets the current value of the Socket Factory Class property.

This property specifies which socket factory ABLE code is to use.

The default initial value of this property is the empty string, which means that ABLE uses the default RMI socket factory.

Parameters:
theValue - The fully qualified class name of a socket factory or the empty string. null is not an acceptable value and will cause errors.
See Also:
getSocketFactoryClass()

getSocketFactoryClass

public final java.lang.String getSocketFactoryClass()
Returns the current value of the Socket Factory Class property.

Returns:
The current value of the Socket Factory Class property. The initial value of this property defaults to the empty string, which causes ABLE to use the default RMI socket factory.
See Also:
setSocketFactoryClass(String)

getSecurity

public final boolean getSecurity()
Returns the current value of the Security property. This property is useful only when running in ABLE's distributed platform environment.

The default initial value of this property is false, which means that ABLE runs without security checking.

When set to true, ABLE uses special methods that require a security key so that the caller's identity can be verified before the operation is carried out.

There is no corresponding setSecurity(boolean) method because this would allow the platform's security setting to be changed by any arbitrary code introduced into the system.

The value of the Security property can be set in only one way: by manually editing the able.preferences file before starting the ABLE platform. Once the platform is started, the security setting cannot be altered.

Returns:
The current value of the Security property.

isSecure

public final boolean isSecure()
Returns the current value of the Security property.

See Also:
getSecurity()

setSmtpRelay

public final void setSmtpRelay(java.lang.String theValue)
Sets the current value of the SMTP relay property.

This property allows ABLE code to send e-mail through the network using the specified relay. It may be used, for example, by a user-written diagnostic agent to send alerts to specific recipients.

The default initial value of this property is the empty string, which prevents ABLE from sending any e-mail.

Parameters:
theValue - The new value of the SMTP relay property, which must be either the fully qualified name of an SMTP relay host on the network or the empty string. The latter prevents ABLE from sending e-mail. null is not an acceptable value and will cause errors.
See Also:
getSmtpRelay()

getSmtpRelay

public final java.lang.String getSmtpRelay()
Returns the current value of the SMTP relay property.

Returns:
The current value of the SMTP relay property. The initial value of this property defaults to the empty string, which prevents ABLE code from sending e-mail.
See Also:
setSmtpRelay(String)

readPropertiesFile

public void readPropertiesFile()
Load up the current set of working preferences from a physical properties file.

See Also:
writePropertiesFile()

writePropertiesFile

public void writePropertiesFile()
Save the current set of working preferences to a physical properties file.

See Also:
readPropertiesFile()

updatePreferenceVariablesAndWritePropertiesFile

public void updatePreferenceVariablesAndWritePropertiesFile(AblePreferences theNewPreferences)
Change all current working preferences, except Security (which shall not be set programmtically), to the values contained in the specified preferences object. Note that a side-effect is that the new preference values are written to disk!

Parameters:
theNewPreferences - A preferences object containing replacement values for the current set of working preferences.


ABLE 2.3.0 07/13/2005 14:21:00

(C) Copyright IBM Corporation 1999, 2005