use of org.forgerock.audit.AuditServiceBuilder in project OpenAM by OpenRock.
the class AuditServiceProviderImpl method refreshRealmAuditService.
private void refreshRealmAuditService(String realm) {
AMAuditServiceConfiguration configuration = configProvider.getRealmConfiguration(realm);
AuditServiceBuilder builder = AuditServiceBuilder.newAuditService().withEventTopicsMetaData(eventTopicsMetaData).withConfiguration(configuration);
if (configuration.isAuditEnabled()) {
configureEventHandlers(builder, configProvider.getRealmEventHandlerConfigurations(realm));
}
AMAuditService auditService = auditServices.get(realm);
try {
if (auditService == null) {
auditService = new RealmAuditServiceProxy(builder.build(), defaultAuditService, configuration);
auditService.startup();
auditServices.put(realm, auditService);
} else {
auditService.setDelegate(builder.build(), configuration);
}
} catch (ServiceUnavailableException e) {
debug.error("New Audit Service configuration for realm {} failed.", e, realm);
// remove it so that we can fall back to the default service
auditServices.remove(realm);
}
}
use of org.forgerock.audit.AuditServiceBuilder in project OpenAM by OpenRock.
the class AuditServiceProviderImpl method createDefaultAuditService.
private DefaultAuditServiceProxy createDefaultAuditService() {
AMAuditServiceConfiguration configuration = new AMAuditServiceConfiguration(false);
configuration.setAvailableAuditEventHandlers(Collections.<String>emptyList());
AuditServiceBuilder builder = AuditServiceBuilder.newAuditService().withEventTopicsMetaData(eventTopicsMetaData).withConfiguration(configuration);
DefaultAuditServiceProxy auditServiceProxy = new DefaultAuditServiceProxy(builder.build(), configuration);
try {
auditServiceProxy.startup();
} catch (ServiceUnavailableException e) {
debug.error("Default Audit Service configuration failed.", e);
}
return auditServiceProxy;
}
Aggregations