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 booleanauditOnprotected List<T>typedModules
-
Constructor Summary
Constructors Constructor Description BaseAuditManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BaseAuditModuleaddAuditModule(String name, String classname, Properties props)Add the given audit module to the list of loaded audit module.voidauthentication(String user, String realm, boolean success)logs the authentication call for all the loaded modules.LocalStringManagerImplgetLocalStrings()LoggergetLogger()protected List<T>instances(Class<T> c)booleanisAuditOn()Returns whether auditing is turned on.voidloadAuditModules()This method initializes BaseAuditManager which load audit modules and audit enabled flagprotected StringmoduleName(BaseAuditModule am)BaseAuditModuleremoveAuditModule(String name)Remove the audit module of given name from the loaded list.voidserverShutdown()Reports server shutdown event to registered audit modules.voidserverStarted()Reports server start-up event to registered audit modules.voidsetAuditOn(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:
loadAuditModulesin 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:
authenticationin interfaceAuditManager- See Also:
com.sun.appserv.security.BaseAuditModule.authentication
-
serverStarted
public void serverStarted()
Description copied from interface:AuditManagerReports server start-up event to registered audit modules.- Specified by:
serverStartedin interfaceAuditManager
-
serverShutdown
public void serverShutdown()
Description copied from interface:AuditManagerReports server shutdown event to registered audit modules.- Specified by:
serverShutdownin interfaceAuditManager
-
setAuditOn
public void setAuditOn(boolean auditOn)
-
isAuditOn
public boolean isAuditOn()
Description copied from interface:AuditManagerReturns whether auditing is turned on.- Specified by:
isAuditOnin interfaceAuditManager- Returns:
-
moduleName
protected String moduleName(BaseAuditModule am)
-
-