Package org.fcrepo.kernel.impl.observer
Class EventAccumulatorImpl
- java.lang.Object
-
- org.fcrepo.kernel.impl.observer.EventAccumulatorImpl
-
- All Implemented Interfaces:
EventAccumulator
@Component public class EventAccumulatorImpl extends Object implements EventAccumulator
- Author:
- pwinckles
-
-
Constructor Summary
Constructors Constructor Description EventAccumulatorImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearEvents(Transaction transaction)
Removes all of a transaction's accumulated events without emitting them.void
emitEvents(Transaction transaction, String baseUrl, String userAgent)
Emits all of the events that were accumulated within the transaction.void
recordEventForOperation(Transaction transaction, FedoraId fedoraId, ResourceOperation operation)
Registers a new event to a transaction.
-
-
-
Constructor Detail
-
EventAccumulatorImpl
public EventAccumulatorImpl()
-
-
Method Detail
-
recordEventForOperation
public void recordEventForOperation(Transaction transaction, FedoraId fedoraId, ResourceOperation operation)
Description copied from interface:EventAccumulator
Registers a new event to a transaction.- Specified by:
recordEventForOperation
in interfaceEventAccumulator
- Parameters:
transaction
- the transactionfedoraId
- the id of the affected resourceoperation
- the operation affecting the resource
-
emitEvents
public void emitEvents(Transaction transaction, String baseUrl, String userAgent)
Description copied from interface:EventAccumulator
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.
- Specified by:
emitEvents
in interfaceEventAccumulator
- Parameters:
transaction
- the transactionbaseUrl
- the baseUrl of the requestsuserAgent
- the user-agent of the user making the requests
-
clearEvents
public void clearEvents(Transaction transaction)
Description copied from interface:EventAccumulator
Removes all of a transaction's accumulated events without emitting them. This must be called when a transaction is rolled back.- Specified by:
clearEvents
in interfaceEventAccumulator
- Parameters:
transaction
- the id of the transaction
-
-