Package org.forgerock.audit.handlers.jms
Class JmsAuditEventHandler
java.lang.Object
org.forgerock.audit.events.handlers.AuditEventHandlerBase
org.forgerock.audit.handlers.jms.JmsAuditEventHandler
- All Implemented Interfaces:
AuditEventHandler
Publishes Audit events on a JMS Topic.
-
Field Summary
Fields inherited from class org.forgerock.audit.events.handlers.AuditEventHandlerBase
eventTopicsMetaData
-
Constructor Summary
ConstructorsConstructorDescriptionJmsAuditEventHandler
(JmsContextManager jmsContextManager, JmsAuditEventHandlerConfiguration configuration, EventTopicsMetaData eventTopicsMetaData) Creates a new AuditEventHandler instance that publishes JMS messages on a JMS Topic for each Audit event. -
Method Summary
Modifier and TypeMethodDescriptionorg.forgerock.util.promise.Promise<ResourceResponse,
ResourceException> publishEvent
(org.forgerock.services.context.Context context, String auditTopic, org.forgerock.json.JsonValue auditEvent) Converts the audit event into a JMS TextMessage and then publishes the message on the configured jmsTopic.org.forgerock.util.promise.Promise<QueryResponse,
ResourceException> queryEvents
(org.forgerock.services.context.Context context, String topic, QueryRequest queryRequest, QueryResourceHandler queryResourceHandler) Returns NotSupportedException as query is not implemented for JMS.org.forgerock.util.promise.Promise<ResourceResponse,
ResourceException> Returns NotSupportedException as read is not implemented for JMS.void
shutdown()
Closes the JMS connection.void
startup()
Creates the JMS Topic and ConnectionFactory from the context configuration settings and opens the JMS connection.Methods inherited from class org.forgerock.audit.events.handlers.AuditEventHandlerBase
getHandledTopics, getName, handleAction, isEnabled
-
Constructor Details
-
JmsAuditEventHandler
@Inject public JmsAuditEventHandler(JmsContextManager jmsContextManager, JmsAuditEventHandlerConfiguration configuration, EventTopicsMetaData eventTopicsMetaData) throws ResourceException Creates a new AuditEventHandler instance that publishes JMS messages on a JMS Topic for each Audit event.- Parameters:
jmsContextManager
- optional injectedJmsContextManager
.configuration
- Configuration parameters that can be adjusted by system administrators.eventTopicsMetaData
- Meta-data for all audit event topics.- Throws:
ResourceException
- If JMS connections cannot be established.
-
-
Method Details
-
startup
Creates the JMS Topic and ConnectionFactory from the context configuration settings and opens the JMS connection.- Throws:
ResourceException
-
shutdown
Closes the JMS connection.- Throws:
ResourceException
-
publishEvent
public org.forgerock.util.promise.Promise<ResourceResponse,ResourceException> publishEvent(org.forgerock.services.context.Context context, String auditTopic, org.forgerock.json.JsonValue auditEvent) Converts the audit event into a JMS TextMessage and then publishes the message on the configured jmsTopic.- Parameters:
context
- The context chain that initiated the event.auditTopic
- The Audit Topic for which the auditEvent was created for. (Not to be confused with a JMS Topic)auditEvent
- The event to convert to a JMS TextMessage and publish on the JMS Topic.- Returns:
- a promise with either a response or an exception
-
queryEvents
public org.forgerock.util.promise.Promise<QueryResponse,ResourceException> queryEvents(org.forgerock.services.context.Context context, String topic, QueryRequest queryRequest, QueryResourceHandler queryResourceHandler) Returns NotSupportedException as query is not implemented for JMS.
- Returns:
- NotSupportedException as query is not implemented for JMS.
-
readEvent
public org.forgerock.util.promise.Promise<ResourceResponse,ResourceException> readEvent(org.forgerock.services.context.Context context, String topic, String resourceId) Returns NotSupportedException as read is not implemented for JMS.
- Returns:
- NotSupportedException as read is not implemented for JMS.
-