Interface AuditlogEventStore

All Known Implementing Classes:
NoopAuditlogEventStore

public interface AuditlogEventStore
Store that temporarily persist the event stream as automation rules execute.

This can then be used to write the final audit log.

  • Method Details

    • incrementAuditEventsToProcess

      long incrementAuditEventsToProcess(TenantExecution tenantExecution, long increment)
      Stores the number of audit events that need to be processed (persisted).
      Parameters:
      tenantExecution - The rule execution that's running
      increment - Value to increment by
      Returns:
      Updated count of items
    • decrementAuditEventsToProcess

      long decrementAuditEventsToProcess(TenantExecution tenantExecution, long decrement)
      Decrements the number of audit events that are still needing to be persisted.
      Parameters:
      tenantExecution - The rule execution that's running
      decrement - Value to decrement by
      Returns:
      Updated count of items
    • incrementQueuedItems

      long incrementQueuedItems(TenantExecution tenantExecution, long increment)
      Stores the number of items queued for execution for a particular rule execution.
      Parameters:
      tenantExecution - The rule execution that's running
      increment - Value to increment by
      Returns:
      Updated count of items
    • decrementQueuedItems

      long decrementQueuedItems(TenantExecution tenantExecution, long decrement)
      Stores the number of items queued for execution for a particular rule execution.
      Parameters:
      tenantExecution - The rule execution that's running
      decrement - Value to decrement by
      Returns:
      Updated count of items
    • hasRuleExecutionCompleted

      boolean hasRuleExecutionCompleted(TenantExecution tenantExecution)
      Checks the queueditem count and audit log events processed to see if we've reached zero yet and if we've received a RULE_EXECUTION_COMPLETED event
      Parameters:
      tenantExecution - The rule execution that's running
      Returns:
      true if the rule has finished
    • markAsAborted

      boolean markAsAborted(TenantExecution tenantExecution)
      Sets a rule execution as aborted. Returns true if this was the first time we set this execution as aborted.
      Parameters:
      tenantExecution - the rule execution to mark as aborted.
      Returns:
      true if this was the first time we called abort on this execution
    • save

      void save(TenantExecution tenantExecution, AutomationEventBusEvent event)
    • collateAuditlog

      Optional<AuditlogBean> collateAuditlog(TenantExecution execution)