Class ResultCollector

java.lang.Object
org.projectnessie.events.service.ResultCollector
All Implemented Interfaces:
Consumer<org.projectnessie.versioned.Result>

public class ResultCollector extends Object implements Consumer<org.projectnessie.versioned.Result>
A collector for Results produced by the version store.

Instances of this class are meant to be injected into version stores to collect results.

The main reason why this functionality is not part of the EventService is that EventService is meant to be a singleton, while ResultCollector is meant to be instantiated per request, in order to capture the user principal that initiated the request, and the target repository id.

  • Field Details

  • Constructor Details

  • Method Details

    • accept

      public void accept(org.projectnessie.versioned.Result result)
      Called when a result is produced by the version store.
      Specified by:
      accept in interface Consumer<org.projectnessie.versioned.Result>
    • shouldProcess

      protected boolean shouldProcess(org.projectnessie.versioned.Result result)
      Returns true if the given Result should be processed.

      This acts as an early filter to remove results that are not relevant to any of the subscribers.

    • forwardToEventService

      protected void forwardToEventService(VersionStoreEvent event)
      Forwards the received VersionStoreEvent to the destination for delivery to subscribers.