public final class SplunkAuditEventHandler extends AuditEventHandlerBase implements BatchConsumer
eventTopicsMetaData
Constructor and Description |
---|
SplunkAuditEventHandler(SplunkAuditEventHandlerConfiguration configuration,
EventTopicsMetaData eventTopicsMetaData,
BatchPublisherFactory publisherFactory,
org.forgerock.http.Client client)
Constructs a new Splunk audit event handler.
|
Modifier and Type | Method and Description |
---|---|
void |
addToBatch(String topic,
JsonValue event,
StringBuilder payload)
Adds an audit event to a batch payload.
|
Promise<Void,BatchException> |
publishBatch(String payload)
Publishes the batch payload.
|
Promise<ResourceResponse,ResourceException> |
publishEvent(org.forgerock.services.context.Context context,
String topic,
JsonValue event)
Publishes an event to the provided topic.
|
Promise<QueryResponse,ResourceException> |
queryEvents(org.forgerock.services.context.Context context,
String topic,
QueryRequest query,
QueryResourceHandler handler)
Query some events from the provided topic.
|
Promise<ResourceResponse,ResourceException> |
readEvent(org.forgerock.services.context.Context context,
String topic,
String resourceId)
Reads an event with the provided resource id from the provided topic.
|
void |
shutdown()
Instruct this object to flush any buffers and close any open file handles or network connections.
|
void |
startup()
Instruct this object that it is safe to initialize file handles and network connections.
|
getHandledTopics, getName, handleAction, isEnabled
public SplunkAuditEventHandler(SplunkAuditEventHandlerConfiguration configuration, EventTopicsMetaData eventTopicsMetaData, BatchPublisherFactory publisherFactory, org.forgerock.http.Client client)
configuration
- the Splunk audit event handler configurationeventTopicsMetaData
- topic meta datapublisherFactory
- the batch publisher factory or null
client
- HTTP client or null
public void startup() throws ResourceException
AuditEventHandler
Reconfiguration of the AuditService
and its handlers is achieved by replacing
rather than modifying the existing objects. Therefore, it's essential that the replacements do not perform
any I/O that would interfere with the operation of the objects they are replacing until the old objects are
shutdown. For example, when shutting down an old instance of a file-based AuditEventHandler, the old instance
may need to flush buffers, apply file rotation or retention policies, or even add line or block signatures
as part of tamper evident logging. Any of these operations could be broken if two handler instances are
operating on the same set of files simultaneously.
startup
in interface AuditEventHandler
ResourceException
- if starting the AuditEventHandler failspublic void shutdown() throws ResourceException
AuditEventHandler
shutdown
in interface AuditEventHandler
ResourceException
- if closing the AuditEventHandler failspublic Promise<ResourceResponse,ResourceException> publishEvent(org.forgerock.services.context.Context context, String topic, JsonValue event)
AuditEventHandler
publishEvent
in interface AuditEventHandler
context
- The context chain that initiated the event.topic
- The topic where to publish the event.event
- The event to publish.public Promise<ResourceResponse,ResourceException> readEvent(org.forgerock.services.context.Context context, String topic, String resourceId)
AuditEventHandler
readEvent
in interface AuditEventHandler
context
- The context chain that initiated the event.topic
- The topic where event is read.resourceId
- The identifier of the event.public Promise<QueryResponse,ResourceException> queryEvents(org.forgerock.services.context.Context context, String topic, QueryRequest query, QueryResourceHandler handler)
AuditEventHandler
queryEvents
in interface AuditEventHandler
context
- The context chain that initiated the event.topic
- The topic on which query is performed.query
- The request with the query.handler
- The handler to process responses for the query.public void addToBatch(String topic, JsonValue event, StringBuilder payload) throws BatchException
BatchConsumer
addToBatch
in interface BatchConsumer
topic
- event topicevent
- event JSON payloadpayload
- batch payloadBatchException
- indicates failure to add-to-batchpublic Promise<Void,BatchException> publishBatch(String payload)
BatchConsumer
publishBatch
in interface BatchConsumer
payload
- batch payloadCopyright 2010-2022 ForgeRock AS.