Methods Summary |
---|
public void | auditModuleCreated(com.sun.enterprise.admin.event.AuditModuleEvent event)New audit module created.
It is called whenever a AuditModuleEvent with action of
AuditModuleEvent.ACTION_CREATE is received.
try {
String moduleName = event.getModuleName();
AuditModule am = getAuditModule(moduleName,
event.getConfigContext());
String classname = am.getClassname();
Properties props = getAuditModuleProperties(am);
AuditManager manager =
AuditManagerFactory.getInstance().getAuditManagerInstance();
manager.addAuditModule(moduleName, classname, props);
} catch(Exception ex) {
throw new AdminEventListenerException(ex);
}
|
public void | auditModuleDeleted(com.sun.enterprise.admin.event.AuditModuleEvent event)Audit module deleted.
It is called whenever a AuditModuleEvent with action of
AuditModuleEvent.ACTION_DELETE is received.
try {
String moduleName = event.getModuleName();
AuditManager manager =
AuditManagerFactory.getInstance().getAuditManagerInstance();
manager.removeAuditModule(moduleName);
} catch(Exception ex) {
throw new AdminEventListenerException(ex);
}
|
public void | auditModuleUpdated(com.sun.enterprise.admin.event.AuditModuleEvent event)Audit module updated (attributes change).
It is called whenever a AuditModuleEvent with action of
AuditModuleEvent.ACTION_UPDATE is received.
try {
String moduleName = event.getModuleName();
AuditModule am = getAuditModule(moduleName,
event.getConfigContext());
String classname = am.getClassname();
Properties props = getAuditModuleProperties(am);
AuditModule oldAm = getAuditModule(moduleName,
event.getOldConfigContext());
String oldClassname = oldAm.getClassname();
Properties oldProps = getAuditModuleProperties(oldAm);
AuditManager manager =
AuditManagerFactory.getInstance().getAuditManagerInstance();
if (!classname.equals(oldClassname)) {
manager.addAuditModule(moduleName, classname, props);
} else if (!props.equals(oldProps)) {
com.sun.appserv.security.AuditModule auditModule =
manager.getAuditModule(moduleName);
auditModule.init(props);
}
} catch(Exception ex) {
throw new AdminEventListenerException(ex);
}
|
private com.sun.enterprise.config.serverbeans.AuditModule | getAuditModule(java.lang.String moduleName, com.sun.enterprise.config.ConfigContext configContext)
SecurityService security =
ServerBeansFactory.getSecurityServiceBean(configContext);
return security.getAuditModuleByName(moduleName);
|
private java.util.Properties | getAuditModuleProperties(com.sun.enterprise.config.serverbeans.AuditModule am)
ElementProperty[] elementProps = am.getElementProperty();
int size = (elementProps != null) ? elementProps.length : 0;
Properties props = new Properties();
//XXX should we set this?
props.setProperty(AuditManager.NAME, am.getName());
props.setProperty(AuditManager.CLASSNAME, am.getClassname());
for (int i = 0; i < size; i++) {
props.setProperty(elementProps[i].getName(),
elementProps[i].getValue());
}
return props;
|