Package com.sodius.oslc.server.trs.store
Interface StagingResourceEventStore
-
public interface StagingResourceEventStoreA store forresource eventsthat need to becommittedbefore adding them to the store.- Since:
- 3.11.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcommit()Includes all the events stored by this instance in the scope of theTrsStore.synchronizeResourceEvents()method.voiddiscard()Removes all the staging events stored by this instance.StringgetId()Gets the id of this staging store.voidstore(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, aConsumerto get notified of events. Implementation is advised to use aBufferedConsumerfor 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 TrsStoreExceptionRemoves all the staging events stored by this instance.- Throws:
TrsStoreException- if events cannot be removed.
-
commit
void commit() throws TrsStoreExceptionIncludes 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.
-
-