Interface StagingResourceEventStore


  • public interface StagingResourceEventStore
    A store for resource events that need to be committed before adding them to the store.
    Since:
    3.11.0
    • 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 the commit() 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, a Consumer to get notified of events. Implementation is advised to use a BufferedConsumer for optimal performance.

        Parameters:
        eventsProvider - a function that provides access to change events to become part of the trs:ChangeLog.
        Throws:
        TrsStoreException - if events cannot be stored.
        See Also:
        BufferedConsumer