Package org.fcrepo.kernel.api.observer
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(java.lang.String)MUST be called to release the stored events.- Author:
- pwinckles
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearEvents(String transactionId)Removes all of a transaction's accumulated events without emitting them.voidemitEvents(String transactionId, String baseUrl, String userAgent)Emits all of the events that were accumulated within the transaction.voidrecordEventForOperation(String transactionId, FedoraId fedoraId, ResourceOperation operation)Registers a new event to a transaction.
-
-
-
Method Detail
-
recordEventForOperation
void recordEventForOperation(String transactionId, FedoraId fedoraId, ResourceOperation operation)
Registers a new event to a transaction.- Parameters:
transactionId- the id of the transactionfedoraId- the id of the affected resourceoperation- the operation affecting the resource
-
emitEvents
void emitEvents(String transactionId, 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:
transactionId- the id of the transactionbaseUrl- the baseUrl of the requestsuserAgent- the user-agent of the user making the requests
-
clearEvents
void clearEvents(String transactionId)
Removes all of a transaction's accumulated events without emitting them. This must be called when a transaction is rolled back.- Parameters:
transactionId- the id of the transaction
-
-