com.adventnet.afp.log
Class LogWriterProperties

java.lang.Object
  |
  +--com.adventnet.afp.log.LogWriterProperties

public class LogWriterProperties
extends java.lang.Object

This class is a structural representation of a LogWriter. It is used to group the properties of LogWriter, the Loggers in that module and the properties of each Logger. Each LogWriter should have a LogWriterClassName to which they are associated. It can be set using the setClassName(java.lang.String) method. By default, the FileLogWriter class will be used. All other properties are stored as custom properties as they are dependent on the LogWriter used.

See Also:
FileLogWriter

Constructor Summary
LogWriterProperties(java.lang.String logWriterInstanceName)
          Creates a new LogWriterProperties instance with the default LogWriterClassName and the instance name as logWriterInstanceName.
 
Method Summary
 void addCustomProperty(java.lang.String key, java.lang.String value)
          The method addCustomProperty is used to add a property to the LogWriter.Either key or the value should not be null or empty.
 java.lang.String getClassName()
          The getClassName method returns the current LogWriterClassName.
 java.util.Properties getCustomProperties()
          The getCustomProperties method is used to get all the Custom properties of a LogWriter.
 java.lang.String getCustomProperty(java.lang.String key)
          getCustomProperty method is used to retreive a Custom property.
 java.lang.String getInstanceName()
          The getInstanceName method returns the current LogWriterInstanceName.
 void removeCustomProperty(java.lang.String key)
          This method removes the custom property which has the key name same as that of the argument.
 void setClassName(java.lang.String logWriterClassName)
          The setClassName method is used to set the LogWriterClass that has to be used for that module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogWriterProperties

public LogWriterProperties(java.lang.String logWriterInstanceName)
Creates a new LogWriterProperties instance with the default LogWriterClassName and the instance name as logWriterInstanceName.
Parameters:
logWriterInstanceName - a String value denoting the instance name of the LogWriter
Method Detail

setClassName

public void setClassName(java.lang.String logWriterClassName)
The setClassName method is used to set the LogWriterClass that has to be used for that module. The logwriter class name cannot be null or empty. If it is given as null or empty, the class name which is set already is taken into consideration.
Parameters:
logWriterClassName - a String value denoting the LogWriterClass to be used.

getClassName

public java.lang.String getClassName()
The getClassName method returns the current LogWriterClassName.
Returns:
a String value

getInstanceName

public java.lang.String getInstanceName()
The getInstanceName method returns the current LogWriterInstanceName.
Returns:
a String value

addCustomProperty

public void addCustomProperty(java.lang.String key,
                              java.lang.String value)
The method addCustomProperty is used to add a property to the LogWriter.Either key or the value should not be null or empty. If either the Key or value is null or empty, then this property will not be added. All the properties of a LogWriter except LogWriterClassName should be given as a Custom property.
Parameters:
key - a String denoting the key value
value - a String denoting the corresponding value for that key.

removeCustomProperty

public void removeCustomProperty(java.lang.String key)
This method removes the custom property which has the key name same as that of the argument.
Parameters:
key - a String value

getCustomProperty

public java.lang.String getCustomProperty(java.lang.String key)
getCustomProperty method is used to retreive a Custom property. All the properties of a LogWriter except LogWriterClassName can be retrieved by this method.
Parameters:
key - a String value for which the property has to be retreived.
Returns:
a String value

getCustomProperties

public java.util.Properties getCustomProperties()
The getCustomProperties method is used to get all the Custom properties of a LogWriter.
Returns:
a Properties of Custom properties that have been set.


Copyright (c)AdventNet Inc., 1996-2004