Package org.copperengine.core.audit
Class BatchingAuditTrail
- java.lang.Object
-
- org.copperengine.core.audit.AbstractAuditTrail
-
- org.copperengine.core.audit.BatchingAuditTrail
-
- All Implemented Interfaces:
AuditTrail
,org.copperengine.management.AuditTrailMXBean
public class BatchingAuditTrail extends AbstractAuditTrail
Fast db based audit trail implementation. It is possible to extend the COPPER audit trail with custom attributes. See JUnitTestBatchingAuditTrailTest.testCustomTable()
for an example.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.copperengine.core.audit.AbstractAuditTrail
AbstractAuditTrail.Property2ColumnMapping
-
-
Field Summary
-
Fields inherited from class org.copperengine.core.audit.AbstractAuditTrail
messagePostProcessor
-
-
Constructor Summary
Constructors Constructor Description BatchingAuditTrail()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
asynchLog(int logLevel, java.util.Date occurrence, java.lang.String conversationId, java.lang.String context, java.lang.String instanceId, java.lang.String correlationId, java.lang.String transactionId, java.lang.String _message, java.lang.String messageType)
returns immediately after queueing the log messagevoid
asynchLog(int logLevel, java.util.Date occurrence, java.lang.String conversationId, java.lang.String context, java.lang.String instanceId, java.lang.String correlationId, java.lang.String transactionId, java.lang.String _message, java.lang.String messageType, AuditTrailCallback cb)
returns immediately after queueing the log messagevoid
asynchLog(AuditTrailEvent e)
returns immediately after queueing the log messagevoid
asynchLog(AuditTrailEvent e, AuditTrailCallback cb)
returns immediately after queueing the log messageprotected boolean
doLog(AuditTrailEvent e, boolean immediate, CommandCallback<BatchInsertIntoAutoTrail.Command> callback)
protected boolean
doLog(AuditTrailEvent e, Acknowledge ack, boolean immediate)
void
setBatcher(Batcher batcher)
void
synchLog(AuditTrailEvent event)
writes an event to the audit trail log and returns after the log message is written to the underlying storage.-
Methods inherited from class org.copperengine.core.audit.AbstractAuditTrail
createBatchCommand, createDefaultMapping, getDataSource, getDbTable, getLevel, getSqlStmt, isEnabled, setAdditionalMapping, setAuditTrailEventClass, setDataSource, setDbTable, setLevel, setMapping, setMessagePostProcessor, startup, synchLog
-
-
-
-
Method Detail
-
asynchLog
public void asynchLog(int logLevel, java.util.Date occurrence, java.lang.String conversationId, java.lang.String context, java.lang.String instanceId, java.lang.String correlationId, java.lang.String transactionId, java.lang.String _message, java.lang.String messageType)
returns immediately after queueing the log message- Parameters:
logLevel
- the level on that the audit trail event is recorded (might be used for filtering)occurrence
- timestamp of the audit trail eventconversationId
- conversation id embraces all audit trail events for one business process (might be the same for a whole business transaction over a range of involved systems)context
- the context of the audit trail event (e.g. a camel route, a workflow task, ...)instanceId
- workflow id for a single workflowcorrelationId
- correlates a request response pair (e.g. workflow calls another workflow, workflow calls a camel route, ...)transactionId
- Same ID vor several conversations, that belongs to the same transaction. Example: ExecuteOrder (conversation 1), ChangeOrder (conversation 2) and CancelOrder (conversation 3) that all belongs to transaction 77. When transaction 77 can be deleted, all conversations for this transaction can be deleted._message
- a message describing the audit trail eventmessageType
- type of the message, e.g. XML, used for message rendering in the COPPER monitor
-
asynchLog
public void asynchLog(int logLevel, java.util.Date occurrence, java.lang.String conversationId, java.lang.String context, java.lang.String instanceId, java.lang.String correlationId, java.lang.String transactionId, java.lang.String _message, java.lang.String messageType, AuditTrailCallback cb)
returns immediately after queueing the log message- Parameters:
logLevel
- the level on that the audit trail event is recorded (might be used for filtering)occurrence
- timestamp of the audit trail eventconversationId
- conversation id embraces all audit trail events for one business process (might be the same for a whole business transaction over a range of involved systems)context
- the context of the audit trail event (e.g. a camel route, a workflow task, ...)instanceId
- workflow id for a single workflowcorrelationId
- correlates a request response pair (e.g. workflow calls another workflow, workflow calls a camel route, ...)transactionId
- Same ID vor several conversations, that belongs to the same transaction. Example: ExecuteOrder (conversation 1), ChangeOrder (conversation 2) and CancelOrder (conversation 3) that all belongs to transaction 77. When transaction 77 can be deleted, all conversations for this transaction can be deleted._message
- a message describing the audit trail eventmessageType
- type of the message, e.g. XML, used for message rendering in the COPPER monitorcb
- callback called when logging succeeded or failed.
-
asynchLog
public void asynchLog(AuditTrailEvent e)
returns immediately after queueing the log message- Parameters:
e
- the AuditTrailEvent to be logged
-
asynchLog
public void asynchLog(AuditTrailEvent e, AuditTrailCallback cb)
returns immediately after queueing the log message- Parameters:
e
- the AuditTrailEvent to be loggedcb
- callback called when logging succeeded or failed.
-
doLog
protected boolean doLog(AuditTrailEvent e, Acknowledge ack, boolean immediate)
-
doLog
protected boolean doLog(AuditTrailEvent e, boolean immediate, CommandCallback<BatchInsertIntoAutoTrail.Command> callback)
-
synchLog
public void synchLog(AuditTrailEvent event)
Description copied from interface:AuditTrail
writes an event to the audit trail log and returns after the log message is written to the underlying storage.- Parameters:
event
- the AuditTrailEvent to be logged
-
setBatcher
public void setBatcher(Batcher batcher)
-
-