Class LogSubsystem

  • All Implemented Interfaces:
    ISubsystem, com.netscape.certsrv.logging.ILogSubsystem

    public class LogSubsystem
    extends java.lang.Object
    implements com.netscape.certsrv.logging.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> auditEvents  
      static java.lang.String ID  
      static org.slf4j.Logger logger  
      java.util.Hashtable<java.lang.String,​com.netscape.certsrv.logging.ILogEventListener> mLogInsts  
      java.util.Hashtable<java.lang.String,​com.netscape.certsrv.logging.LogPlugin> mLogPlugins  
      static java.lang.String PROP_CLASS  
      static java.lang.String PROP_IMPL  
      static java.lang.String PROP_INSTANCE  
      static java.lang.String PROP_LOGGING  
      static java.lang.String PROP_PLUGIN  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Collection<java.lang.String> getAuditEvents()  
      IConfigStore getConfigStore()
      Returns the root configuration storage of this system.
      java.lang.String getId()
      Retrieves the name of this subsystem.
      static LogSubsystem getInstance()
      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.
      com.netscape.certsrv.logging.ILogEventListener getLogInstance​(java.lang.String insName)
      Retrieve log instance by it's name
      java.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,​com.netscape.certsrv.logging.ILogEventListener> getLogInsts()
      get the list of log instances that are available
      java.lang.String getLogPluginName​(com.netscape.certsrv.logging.ILogEventListener log)
      Retrieve plugin name (implementation name) of the log event listener.
      java.util.Hashtable<java.lang.String,​com.netscape.certsrv.logging.LogPlugin> getLogPlugins()
      get the list of log plugins that are available
      void init​(IConfigStore config)
      Initializes the log subsystem.
      void setId​(java.lang.String id)
      Sets specific to this subsystem.
      void shutdown()
      Stops this subsystem.
      void startup()
      Notifies this subsystem if owner is in running mode.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        public static org.slf4j.Logger logger
      • mLogPlugins

        public java.util.Hashtable<java.lang.String,​com.netscape.certsrv.logging.LogPlugin> mLogPlugins
      • mLogInsts

        public java.util.Hashtable<java.lang.String,​com.netscape.certsrv.logging.ILogEventListener> mLogInsts
      • auditEvents

        public java.util.Set<java.lang.String> auditEvents
    • Method Detail

      • getId

        public java.lang.String getId()
        Description copied from interface: ISubsystem
        Retrieves the name of this subsystem.
        Specified by:
        getId in interface ISubsystem
        Returns:
        subsystem identifier
      • setId

        public void setId​(java.lang.String id)
                   throws EBaseException
        Description copied from interface: ISubsystem
        Sets specific to this subsystem.
        Specified by:
        setId in interface ISubsystem
        Parameters:
        id - subsystem identifier
        Throws:
        EBaseException - failed to set id
      • getAuditEvents

        public java.util.Collection<java.lang.String> getAuditEvents()
      • shutdown

        public void shutdown()
        Stops this subsystem.

        Specified by:
        shutdown in interface ISubsystem
      • getConfigStore

        public IConfigStore getConfigStore()
        Returns the root configuration storage of this system.

        Specified by:
        getConfigStore in interface ISubsystem
        Returns:
        configuration store of this subsystem
      • getInstance

        public static LogSubsystem getInstance()
        Retrieves singleton: the LogSubsystem.
      • getLogPluginName

        public java.lang.String getLogPluginName​(com.netscape.certsrv.logging.ILogEventListener log)
        Description copied from interface: com.netscape.certsrv.logging.ILogSubsystem
        Retrieve plugin name (implementation name) of the log event listener. If no plug name found, an empty string is returned
        Specified by:
        getLogPluginName in interface com.netscape.certsrv.logging.ILogSubsystem
        Parameters:
        log - the log event listener
        Returns:
        the log event listener's plugin name
      • getLogInstance

        public com.netscape.certsrv.logging.ILogEventListener getLogInstance​(java.lang.String insName)
        Retrieve log instance by it's name
        Specified by:
        getLogInstance in interface com.netscape.certsrv.logging.ILogSubsystem
        Parameters:
        insName - the log instance name in String
        Returns:
        the log instance in ILogEventListener
      • getLogPlugins

        public java.util.Hashtable<java.lang.String,​com.netscape.certsrv.logging.LogPlugin> getLogPlugins()
        Description copied from interface: com.netscape.certsrv.logging.ILogSubsystem
        get the list of log plugins that are available
        Specified by:
        getLogPlugins in interface com.netscape.certsrv.logging.ILogSubsystem
        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,​com.netscape.certsrv.logging.ILogEventListener> getLogInsts()
        Description copied from interface: com.netscape.certsrv.logging.ILogSubsystem
        get the list of log instances that are available
        Specified by:
        getLogInsts in interface com.netscape.certsrv.logging.ILogSubsystem
        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 com.netscape.certsrv.logging.ELogException
        Description copied from interface: com.netscape.certsrv.logging.ILogSubsystem
        Get 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:
        getLogDefaultParams in interface com.netscape.certsrv.logging.ILogSubsystem
        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:
        com.netscape.certsrv.logging.ELogException - when instantiation of the plugin implementation fails.
      • getLogInstanceParams

        public java.util.Vector<java.lang.String> getLogInstanceParams​(java.lang.String insName)
                                                                throws com.netscape.certsrv.logging.ELogException
        Description copied from interface: com.netscape.certsrv.logging.ILogSubsystem
        Get the default configuration parameter names associated with a log instance. It is used by administration servlet to handle log instance configuration.
        Specified by:
        getLogInstanceParams in interface com.netscape.certsrv.logging.ILogSubsystem
        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:
        com.netscape.certsrv.logging.ELogException