Class JsonAuditEventHandler
java.lang.Object
org.forgerock.audit.events.handlers.AuditEventHandlerBase
org.forgerock.audit.handlers.json.JsonAuditEventHandler
- All Implemented Interfaces:
AuditEventHandler
AuditEventHandler
for persisting raw JSON events to a file.
The file format is a UTF-8 text-file, with one JSON event per line, and each line terminated by a newline character.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Name of action to force flushing of file-buffer, which is not the same as flushing buffered audit events, and is primarily used for testing purposes.static final String
Name of action to force file rotation.Fields inherited from class org.forgerock.audit.events.handlers.AuditEventHandlerBase
eventTopicsMetaData
-
Constructor Summary
ConstructorsConstructorDescriptionJsonAuditEventHandler
(JsonAuditEventHandlerConfiguration configuration, EventTopicsMetaData eventTopicsMetaData) Creates aJsonAuditEventHandler
instances. -
Method Summary
Modifier and TypeMethodDescriptionorg.forgerock.util.promise.Promise<ActionResponse,
ResourceException> handleAction
(org.forgerock.services.context.Context context, String topic, ActionRequest request) org.forgerock.util.promise.Promise<ResourceResponse,
ResourceException> publishEvent
(org.forgerock.services.context.Context context, String topic, org.forgerock.json.JsonValue event) org.forgerock.util.promise.Promise<QueryResponse,
ResourceException> queryEvents
(org.forgerock.services.context.Context context, String topic, QueryRequest query, QueryResourceHandler handler) org.forgerock.util.promise.Promise<ResourceResponse,
ResourceException> void
shutdown()
void
startup()
Methods inherited from class org.forgerock.audit.events.handlers.AuditEventHandlerBase
getHandledTopics, getName, isEnabled
-
Field Details
-
ROTATE_FILE_ACTION_NAME
Name of action to force file rotation.- See Also:
-
FLUSH_FILE_ACTION_NAME
Name of action to force flushing of file-buffer, which is not the same as flushing buffered audit events, and is primarily used for testing purposes.- See Also:
-
-
Constructor Details
-
JsonAuditEventHandler
public JsonAuditEventHandler(JsonAuditEventHandlerConfiguration configuration, EventTopicsMetaData eventTopicsMetaData) Creates aJsonAuditEventHandler
instances.- Parameters:
configuration
- ConfigurationeventTopicsMetaData
- Provides meta-data describing the audit event topics this handler may have to handle.
-
-
Method Details
-
startup
- Throws:
ResourceException
-
shutdown
- Throws:
ResourceException
-
publishEvent
public org.forgerock.util.promise.Promise<ResourceResponse,ResourceException> publishEvent(org.forgerock.services.context.Context context, String topic, org.forgerock.json.JsonValue event) -
readEvent
public org.forgerock.util.promise.Promise<ResourceResponse,ResourceException> readEvent(org.forgerock.services.context.Context context, String topic, String resourceId) -
queryEvents
public org.forgerock.util.promise.Promise<QueryResponse,ResourceException> queryEvents(org.forgerock.services.context.Context context, String topic, QueryRequest query, QueryResourceHandler handler) -
handleAction
public org.forgerock.util.promise.Promise<ActionResponse,ResourceException> handleAction(org.forgerock.services.context.Context context, String topic, ActionRequest request) - Specified by:
handleAction
in interfaceAuditEventHandler
- Overrides:
handleAction
in classAuditEventHandlerBase
-