Package com.sodius.oslc.server.trs.store
Interface StagingResourceEventStore
-
public interface StagingResourceEventStore
A store forresource events
that need to becommitted
before adding them to the store.- Since:
- 3.11.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
commit()
Includes all the events stored by this instance in the scope of theTrsStore.synchronizeResourceEvents()
method.void
discard()
Removes all the staging events stored by this instance.String
getId()
Gets the id of this staging store.void
store(Function<Consumer<ResourceEvent>,?> eventsProvider)
Stores staging events on this store.
-
-
-
Method Detail
-
getId
String getId()
Gets the id of this staging store.- Returns:
- the id of this staging store.
-
store
void store(Function<Consumer<ResourceEvent>,?> eventsProvider) throws TrsStoreException
Stores staging events on this store.Implementations MUST store events without blocking the application, and must keep them hidden from the scope of the
TrsStore.synchronizeResourceEvents()
method up to thecommit()
method is called.The function argument provides access to change events to be added in this store. Implementation must call the
apply()
method of this function and use, as argument, aConsumer
to get notified of events. Implementation is advised to use aBufferedConsumer
for optimal performance.- Parameters:
eventsProvider
- a function that provides access to change events to become part of thetrs:ChangeLog
.- Throws:
TrsStoreException
- if events cannot be stored.- See Also:
BufferedConsumer
-
discard
void discard() throws TrsStoreException
Removes all the staging events stored by this instance.- Throws:
TrsStoreException
- if events cannot be removed.
-
commit
void commit() throws TrsStoreException
Includes all the events stored by this instance in the scope of theTrsStore.synchronizeResourceEvents()
method.- Throws:
TrsStoreException
- if events cannot be moved to included in the scope.
-
-