Class BaseAuditManager<T extends BaseAuditModule>

  • All Implemented Interfaces:
    AuditManager

    @Service
    @Singleton
    public class BaseAuditManager<T extends BaseAuditModule>
    extends Object
    implements AuditManager
    Basic implementation of audit manager.

    Projects layered on top of nucleus should extend this class, adding platform-specific methods for auditing platform-specific events. See AppServerAuditManagerImpl for an example. Such implementations should be sure to invoke this class's setTypeClass method. Then this class will keep a list of AuditModules of that specific type in the typedModules field which subclasses can refer to directly.

    (This implementation was largely refactored from the original BaseAuditManager implementation that combined nucleus and app server features.)

    Author:
    Harpreet Singh, Shing Wai Chan, tjquinn
    • Field Detail

      • auditOn

        protected boolean auditOn
    • Constructor Detail

      • BaseAuditManager

        public BaseAuditManager()
    • Method Detail

      • loadAuditModules

        public void loadAuditModules()
        This method initializes BaseAuditManager which load audit modules and audit enabled flag
        Specified by:
        loadAuditModules in interface AuditManager
      • addAuditModule

        public BaseAuditModule addAuditModule​(String name,
                                              String classname,
                                              Properties props)
                                       throws Exception
        Add the given audit module to the list of loaded audit module. Adding the same name twice will override previous one.
        Parameters:
        name - of auditModule
        am - an instance of a class extending BaseAuditModule that has been successfully loaded into the system.
        Throws:
        Exception
      • removeAuditModule

        public BaseAuditModule removeAuditModule​(String name)
        Remove the audit module of given name from the loaded list.
        Parameters:
        name - of auditModule
      • getLocalStrings

        public com.sun.enterprise.util.LocalStringManagerImpl getLocalStrings()
      • getLogger

        public Logger getLogger()
      • authentication

        public void authentication​(String user,
                                   String realm,
                                   boolean success)
        logs the authentication call for all the loaded modules.
        Specified by:
        authentication in interface AuditManager
        See Also:
        com.sun.appserv.security.BaseAuditModule.authentication
      • serverStarted

        public void serverStarted()
        Description copied from interface: AuditManager
        Reports server start-up event to registered audit modules.
        Specified by:
        serverStarted in interface AuditManager
      • serverShutdown

        public void serverShutdown()
        Description copied from interface: AuditManager
        Reports server shutdown event to registered audit modules.
        Specified by:
        serverShutdown in interface AuditManager
      • setAuditOn

        public void setAuditOn​(boolean auditOn)
      • isAuditOn

        public boolean isAuditOn()
        Description copied from interface: AuditManager
        Returns whether auditing is turned on.
        Specified by:
        isAuditOn in interface AuditManager
        Returns:
      • instances

        protected List<T> instances​(Class<T> c)