Interface EventAccumulator


public interface EventAccumulator
Accumulates events for changes made to resources, grouped by transaction. The events are not emitted until after the transaction has been committed. If a transaction is rolled back, clearEvents(org.fcrepo.kernel.api.Transaction) MUST be called to release the stored events.
Author:
pwinckles
  • Method Details

    • recordEventForOperation

      void recordEventForOperation(Transaction transaction, FedoraId fedoraId, ResourceOperation operation)
      Registers a new event to a transaction.
      Parameters:
      transaction - the transaction
      fedoraId - the id of the affected resource
      operation - the operation affecting the resource
    • emitEvents

      void emitEvents(Transaction transaction, String baseUrl, String userAgent)
      Emits all of the events that were accumulated within the transaction. Multiple events affecting the same resource are combined into a single event.

      This method SHOULD NOT throw an exception if an event fails to be emitted. It should always attempt to emit all events accumulated within a transaction.

      Parameters:
      transaction - the transaction
      baseUrl - the baseUrl of the requests
      userAgent - the user-agent of the user making the requests
    • clearEvents

      void clearEvents(Transaction transaction)
      Removes all of a transaction's accumulated events without emitting them. This must be called when a transaction is rolled back.
      Parameters:
      transaction - the id of the transaction