Class BaseAuditManager<T extends BaseAuditModule>
- java.lang.Object
-
- com.sun.enterprise.security.audit.BaseAuditManager<T>
-
- All Implemented Interfaces:
AuditManager
- Direct Known Subclasses:
AppServerAuditManager
@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.)
- Since:
- July 28, 2003
- Author:
- Harpreet Singh, Shing Wai Chan, tjquinn
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
auditOn
protected List<T>
typedModules
-
Constructor Summary
Constructors Constructor Description BaseAuditManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BaseAuditModule
addAuditModule(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.LocalStringManagerImpl
getLocalStrings()
Logger
getLogger()
protected List<T>
instances(Class<T> c)
boolean
isAuditOn()
Returns whether auditing is turned on.void
loadAuditModules()
This method initializes BaseAuditManager which load audit modules and audit enabled flagprotected String
moduleName(BaseAuditModule am)
BaseAuditModule
removeAuditModule(String name)
Remove the audit module of given name from the loaded list.void
serverShutdown()
Reports server shutdown event to registered audit modules.void
serverStarted()
Reports server start-up event to registered audit modules.void
setAuditOn(boolean auditOn)
-
-
-
Field Detail
-
typedModules
protected List<T extends BaseAuditModule> typedModules
-
auditOn
protected boolean auditOn
-
-
Method Detail
-
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
public BaseAuditModule removeAuditModule(String name)
Remove the audit module of given name from the loaded list.- Parameters:
name
- of auditModule
-
getLocalStrings
public 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 interfaceAuditManager
- 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 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
protected String moduleName(BaseAuditModule am)
-
-