public class CsvAuditEventHandler extends AuditEventHandlerBase
Modifier and Type | Class and Description |
---|---|
class |
CsvAuditEventHandler.ParseJsonValue
CellProcessor for parsing JsonValue objects from CSV file.
|
Modifier and Type | Field and Description |
---|---|
static String |
ROTATE_FILE_ACTION_NAME
Name of action to force file rotation.
|
eventTopicsMetaData
Constructor and Description |
---|
CsvAuditEventHandler(CsvAuditEventHandlerConfiguration configuration,
EventTopicsMetaData eventTopicsMetaData,
KeyStoreHandlerProvider keyStoreHandlerProvider)
Create a new CsvAuditEventHandler instance.
|
Modifier and Type | Method and Description |
---|---|
Promise<ActionResponse,ResourceException> |
handleAction(Context context,
String topic,
ActionRequest request)
Performs an action.
|
Promise<ResourceResponse,ResourceException> |
publishEvent(Context context,
String topic,
JsonValue event)
Create a csv audit log entry.
|
Promise<QueryResponse,ResourceException> |
queryEvents(Context context,
String topic,
QueryRequest query,
QueryResourceHandler handler)
Perform a query on the csv audit log.
|
Promise<ResourceResponse,ResourceException> |
readEvent(Context context,
String topic,
String resourceId)
Read from the csv audit log.
|
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, isEnabled
public static final String ROTATE_FILE_ACTION_NAME
@Inject public CsvAuditEventHandler(CsvAuditEventHandlerConfiguration configuration, EventTopicsMetaData eventTopicsMetaData, KeyStoreHandlerProvider keyStoreHandlerProvider)
configuration
- Configuration parameters that can be adjusted by system administrators.eventTopicsMetaData
- Meta-data for all audit event topics.keyStoreHandlerProvider
- The secure storage to use for keys.public void startup() throws ResourceException
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.
ResourceException
- if starting the AuditEventHandler failspublic void shutdown() throws ResourceException
ResourceException
- if closing the AuditEventHandler failspublic Promise<ResourceResponse,ResourceException> publishEvent(Context context, String topic, JsonValue event)
context
- The context chain that initiated the event.topic
- The topic where to publish the event.event
- The event to publish.public Promise<QueryResponse,ResourceException> queryEvents(Context context, String topic, QueryRequest query, QueryResourceHandler handler)
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 Promise<ResourceResponse,ResourceException> readEvent(Context context, String topic, String resourceId)
context
- The context chain that initiated the event.topic
- The topic where event is read.resourceId
- The identifier of the event.public Promise<ActionResponse,ResourceException> handleAction(Context context, String topic, ActionRequest request)
AuditEventHandler
handleAction
in interface AuditEventHandler
handleAction
in class AuditEventHandlerBase
context
- The context chain that initiated the event.topic
- The topic on which action is performed.request
- The request with the action.Copyright 2011-2017 ForgeRock AS.