Class BaseAuditManager<T extends BaseAuditModule>
java.lang.Object
com.sun.enterprise.security.audit.BaseAuditManager<T>
- 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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAuditModule
(String name, String classname, Properties props) Add the given audit module to the list of loaded audit module.void
authentication
(String user, String realm, boolean success) logs the authentication call for all the loaded modules.com.sun.enterprise.util.LocalStringManagerImpl
boolean
Returns whether auditing is turned on.void
This method initializes BaseAuditManager which load audit modules and audit enabled flagprotected String
removeAuditModule
(String name) Remove the audit module of given name from the loaded list.void
Reports server shutdown event to registered audit modules.void
Reports server start-up event to registered audit modules.void
setAuditOn
(boolean auditOn)
-
Field Details
-
typedModules
-
auditOn
protected boolean auditOn
-
-
Constructor Details
-
BaseAuditManager
public BaseAuditManager()
-
-
Method Details
-
loadAuditModules
public void loadAuditModules()This method initializes BaseAuditManager which load audit modules and audit enabled flag- Specified by:
loadAuditModules
in interfaceAuditManager
-
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 auditModuleam
- an instance of a class extending BaseAuditModule that has been successfully loaded into the system.- Throws:
Exception
-
removeAuditModule
Remove the audit module of given name from the loaded list.- Parameters:
name
- of auditModule
-
getLocalStrings
public com.sun.enterprise.util.LocalStringManagerImpl getLocalStrings() -
getLogger
-
authentication
logs the authentication call for all the loaded modules.- Specified by:
authentication
in interfaceAuditManager
- Parameters:
user
-realm
-success
-- See Also:
-
serverStarted
public void serverStarted()Description copied from interface:AuditManager
Reports server start-up event to registered audit modules.- Specified by:
serverStarted
in interfaceAuditManager
-
serverShutdown
public void serverShutdown()Description copied from interface:AuditManager
Reports server shutdown event to registered audit modules.- Specified by:
serverShutdown
in interfaceAuditManager
-
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 interfaceAuditManager
- Returns:
-
moduleName
-
instances
-