@Service @Singleton public class BaseAuditManager<T extends BaseAuditModule> extends Object implements AuditManager
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.)
Modifier and Type | Field and Description |
---|---|
protected boolean |
auditOn |
protected List<T> |
typedModules |
Constructor and Description |
---|
BaseAuditManager() |
Modifier and Type | Method and 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 flag
|
protected 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) |
protected List<T extends BaseAuditModule> typedModules
protected boolean auditOn
public void loadAuditModules()
loadAuditModules
in interface AuditManager
public BaseAuditModule addAuditModule(String name, String classname, Properties props) throws Exception
name
- of auditModuleam
- an instance of a class extending BaseAuditModule that has been
successfully loaded into the system.Exception
public BaseAuditModule removeAuditModule(String name)
name
- of auditModulepublic LocalStringManagerImpl getLocalStrings()
public Logger getLogger()
public void authentication(String user, String realm, boolean success)
authentication
in interface AuditManager
com.sun.appserv.security.BaseAuditModule.authentication
public void serverStarted()
AuditManager
serverStarted
in interface AuditManager
public void serverShutdown()
AuditManager
serverShutdown
in interface AuditManager
public void setAuditOn(boolean auditOn)
public boolean isAuditOn()
AuditManager
isAuditOn
in interface AuditManager
protected String moduleName(BaseAuditModule am)
Copyright © 2018. All rights reserved.