Class AbstractAuditTrail

  • All Implemented Interfaces:
    AuditTrail, org.copperengine.management.AuditTrailMXBean
    Direct Known Subclasses:
    BatchingAuditTrail

    public abstract class AbstractAuditTrail
    extends java.lang.Object
    implements AuditTrail, org.copperengine.management.AuditTrailMXBean
    Fast db based audit trail implementation. It is possible to extend the COPPER audit trail with custom attributes. See JUnitTest BatchingAuditTrailTest.testCustomTable() for an example.
    • Constructor Detail

      • AbstractAuditTrail

        public AbstractAuditTrail()
    • Method Detail

      • setMessagePostProcessor

        public void setMessagePostProcessor​(MessagePostProcessor messagePostProcessor)
      • setDataSource

        public void setDataSource​(javax.sql.DataSource dataSource)
      • setLevel

        public void setLevel​(int level)
        Specified by:
        setLevel in interface AuditTrail
        Specified by:
        setLevel in interface org.copperengine.management.AuditTrailMXBean
      • setAuditTrailEventClass

        public void setAuditTrailEventClass​(java.lang.Class<?> auditTrailEventClass)
      • setDbTable

        public void setDbTable​(java.lang.String dbTable)
      • getDbTable

        public java.lang.String getDbTable()
      • startup

        public void startup()
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getSqlStmt

        public java.lang.String getSqlStmt()
      • getLevel

        public int getLevel()
        Specified by:
        getLevel in interface AuditTrail
        Specified by:
        getLevel in interface org.copperengine.management.AuditTrailMXBean
      • isEnabled

        public boolean isEnabled​(int level)
        Specified by:
        isEnabled in interface AuditTrail
      • synchLog

        public void synchLog​(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)
        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.
        Specified by:
        synchLog in interface AuditTrail
        Parameters:
        logLevel - the level on that the audit trail event is recorded (might be used for filtering)
        occurrence - timestamp of the audit trail event
        conversationId - 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 workflow
        correlationId - 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 event
        messageType - type of the message, e.g. XML, used for message rendering in the COPPER monitor
      • getDataSource

        protected javax.sql.DataSource getDataSource()