Package com.netscape.cmscore.logging
Class LogSubsystem
- java.lang.Object
-
- com.netscape.cmscore.logging.LogSubsystem
-
- All Implemented Interfaces:
ISubsystem,ILogSubsystem
public class LogSubsystem extends java.lang.Object implements ILogSubsystem
A class represents a log subsystem.- Version:
- $Revision$, $Date$
- Author:
- thomask, mzhao
-
-
Field Summary
Fields Modifier and Type Field Description java.util.Set<java.lang.String>auditEventsstatic java.lang.StringIDstatic org.slf4j.Loggerloggerjava.util.Hashtable<java.lang.String,ILogEventListener>mLogInstsjava.util.Hashtable<java.lang.String,LogPlugin>mLogPluginsstatic java.lang.StringPROP_CLASSstatic java.lang.StringPROP_IMPLstatic java.lang.StringPROP_INSTANCEstatic java.lang.StringPROP_LOGGINGstatic java.lang.StringPROP_PLUGIN
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<java.lang.String>getAuditEvents()IConfigStoregetConfigStore()Returns the root configuration storage of this system.java.lang.StringgetId()Retrieves the name of this subsystem.static LogSubsystemgetInstance()Retrieves singleton: the LogSubsystem.java.util.Vector<java.lang.String>getLogDefaultParams(java.lang.String implName)Get the default configuration parameter names associated with a plugin.ILogEventListenergetLogInstance(java.lang.String insName)Retrieve log instance by it's namejava.util.Vector<java.lang.String>getLogInstanceParams(java.lang.String insName)Get the default configuration parameter names associated with a log instance.java.util.Hashtable<java.lang.String,ILogEventListener>getLogInsts()get the list of log instances that are availablejava.lang.StringgetLogPluginName(ILogEventListener log)Retrieve plugin name (implementation name) of the log event listener.java.util.Hashtable<java.lang.String,LogPlugin>getLogPlugins()get the list of log plugins that are availablevoidinit(IConfigStore config)Initializes the log subsystem.voidsetId(java.lang.String id)Sets specific to this subsystem.voidshutdown()Stops this subsystem.voidstartup()Notifies this subsystem if owner is in running mode.
-
-
-
Field Detail
-
logger
public static org.slf4j.Logger logger
-
PROP_LOGGING
public static final java.lang.String PROP_LOGGING
- See Also:
- Constant Field Values
-
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
-
PROP_CLASS
public static final java.lang.String PROP_CLASS
- See Also:
- Constant Field Values
-
PROP_IMPL
public static final java.lang.String PROP_IMPL
- See Also:
- Constant Field Values
-
PROP_PLUGIN
public static final java.lang.String PROP_PLUGIN
- See Also:
- Constant Field Values
-
PROP_INSTANCE
public static final java.lang.String PROP_INSTANCE
- See Also:
- Constant Field Values
-
mLogPlugins
public java.util.Hashtable<java.lang.String,LogPlugin> mLogPlugins
-
mLogInsts
public java.util.Hashtable<java.lang.String,ILogEventListener> mLogInsts
-
auditEvents
public java.util.Set<java.lang.String> auditEvents
-
-
Method Detail
-
getId
public java.lang.String getId()
Description copied from interface:ISubsystemRetrieves the name of this subsystem.- Specified by:
getIdin interfaceISubsystem- Returns:
- subsystem identifier
-
setId
public void setId(java.lang.String id) throws EBaseExceptionDescription copied from interface:ISubsystemSets specific to this subsystem.- Specified by:
setIdin interfaceISubsystem- Parameters:
id- subsystem identifier- Throws:
EBaseException- failed to set id
-
init
public void init(IConfigStore config) throws EBaseException
Initializes the log subsystem.- Specified by:
initin interfaceISubsystem- Parameters:
config- configuration store- Throws:
EBaseException- failed to initialize
-
getAuditEvents
public java.util.Collection<java.lang.String> getAuditEvents()
-
startup
public void startup() throws EBaseExceptionDescription copied from interface:ISubsystemNotifies this subsystem if owner is in running mode.- Specified by:
startupin interfaceISubsystem- Throws:
EBaseException- failed to start up
-
shutdown
public void shutdown()
Stops this subsystem.- Specified by:
shutdownin interfaceISubsystem
-
getConfigStore
public IConfigStore getConfigStore()
Returns the root configuration storage of this system.- Specified by:
getConfigStorein interfaceISubsystem- Returns:
- configuration store of this subsystem
-
getInstance
public static LogSubsystem getInstance()
Retrieves singleton: the LogSubsystem.
-
getLogPluginName
public java.lang.String getLogPluginName(ILogEventListener log)
Description copied from interface:ILogSubsystemRetrieve plugin name (implementation name) of the log event listener. If no plug name found, an empty string is returned- Specified by:
getLogPluginNamein interfaceILogSubsystem- Parameters:
log- the log event listener- Returns:
- the log event listener's plugin name
-
getLogInstance
public ILogEventListener getLogInstance(java.lang.String insName)
Retrieve log instance by it's name- Specified by:
getLogInstancein interfaceILogSubsystem- Parameters:
insName- the log instance name in String- Returns:
- the log instance in ILogEventListener
-
getLogPlugins
public java.util.Hashtable<java.lang.String,LogPlugin> getLogPlugins()
Description copied from interface:ILogSubsystemget the list of log plugins that are available- Specified by:
getLogPluginsin interfaceILogSubsystem- Returns:
- log plugins in a Hashtable. Each entry in the Hashtable contains the name/value pair of pluginName/LogPlugin
- See Also:
LogPlugin
-
getLogInsts
public java.util.Hashtable<java.lang.String,ILogEventListener> getLogInsts()
Description copied from interface:ILogSubsystemget the list of log instances that are available- Specified by:
getLogInstsin interfaceILogSubsystem- Returns:
- log instances in a Hashtable. Each entry in the Hashtable contains the name/value pair of instName/ILogEventListener
- See Also:
LogPlugin
-
getLogDefaultParams
public java.util.Vector<java.lang.String> getLogDefaultParams(java.lang.String implName) throws ELogExceptionDescription copied from interface:ILogSubsystemGet the default configuration parameter names associated with a plugin. It is used by administration servlet to handle log configuration when a new log instance is added.- Specified by:
getLogDefaultParamsin interfaceILogSubsystem- Parameters:
implName- The implementation name for which the configuration parameters are to be configured- Returns:
- a Vector of default configuration paramter names associated with this log plugin
- Throws:
ELogException- when instantiation of the plugin implementation fails.
-
getLogInstanceParams
public java.util.Vector<java.lang.String> getLogInstanceParams(java.lang.String insName) throws ELogExceptionDescription copied from interface:ILogSubsystemGet the default configuration parameter names associated with a log instance. It is used by administration servlet to handle log instance configuration.- Specified by:
getLogInstanceParamsin interfaceILogSubsystem- Parameters:
insName- The instance name for which the configuration parameters are to be configured- Returns:
- a Vector of default configuration paramter names associated with this log instance.
- Throws:
ELogException
-
-