Package org.forgerock.openam.audit
Class AuditEventPublisherImpl
- java.lang.Object
-
- org.forgerock.openam.audit.AuditEventPublisherImpl
-
- All Implemented Interfaces:
AuditEventPublisher
@Singleton public class AuditEventPublisherImpl extends Object implements AuditEventPublisher
Responsible for publishing locally created audit events to the AuditService.- Since:
- 13.0.0
-
-
Constructor Summary
Constructors Constructor Description AuditEventPublisherImpl(AuditServiceProvider auditServiceProvider)Constructs a newAuditEventPublisher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisAuditing(String realm, String topic, AuditConstants.EventName eventName)Determines if the audit service is auditing the specified topic in the specified realm.voidtryPublish(String topic, org.forgerock.audit.events.AuditEvent auditEvent)Tries to publish the provided AuditEvent to the specified topic of the AuditService.
-
-
-
Constructor Detail
-
AuditEventPublisherImpl
@Inject public AuditEventPublisherImpl(AuditServiceProvider auditServiceProvider)
Constructs a newAuditEventPublisher.- Parameters:
auditServiceProvider- AAuditServiceProviderinstance.
-
-
Method Detail
-
tryPublish
public void tryPublish(String topic, org.forgerock.audit.events.AuditEvent auditEvent)
Description copied from interface:AuditEventPublisherTries to publish the provided AuditEvent to the specified topic of the AuditService. If an error occurs that prevents the AuditEvent from being published, then details regarding the error are recorded in the debug logs. However, only details relating to the error are logged; the debug logs are not treated as the fallback destination for audit information.- Specified by:
tryPublishin interfaceAuditEventPublisher- Parameters:
topic- Coarse-grained categorization of the AuditEvent's type.auditEvent- The AuditEvent to publish.
-
isAuditing
public boolean isAuditing(String realm, String topic, AuditConstants.EventName eventName)
Description copied from interface:AuditEventPublisherDetermines if the audit service is auditing the specified topic in the specified realm. If the realm is eithernullor empty, the check will be done against the default audit service. Note that We deliberately do not provide a convenience method with no realm to force implementers to consider providing the realm. We must publish per realm wherever applicable.- Specified by:
isAuditingin interfaceAuditEventPublisher- Parameters:
realm- The realm in which the audit event occurred, or null if realm is not applicable.topic- The auditing topic.eventName- The event name, may be null if not known.- Returns:
trueif the topic should be audited.
-
-