Interface EventApplier

All Known Implementing Classes:
EventAppliers

public interface EventApplier
Applies the state changes for a specific event.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Thrown when no event applier is found for a given intent and record version.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyState(long key, Intent intent, RecordValue recordValue, int recordVersion)
    Apply the state changes of the given event.
    int
    Returns the latest EventApplier version of a given Intent.
  • Method Details

    • getLatestVersion

      int getLatestVersion(Intent intent)
      Returns the latest EventApplier version of a given Intent.
      Parameters:
      intent - the Intent of the EventApplier
      Returns:
      the latest version of the given intent, -1 if no EventApplier is found
    • applyState

      void applyState(long key, Intent intent, RecordValue recordValue, int recordVersion) throws EventApplier.NoSuchEventApplier
      Apply the state changes of the given event. It will use the event applier that matches the specified version.
      Parameters:
      key - the key of the event
      intent - the intent of the event
      recordValue - the value of the event
      recordVersion - the record version of the event
      Throws:
      EventApplier.NoSuchEventApplier - if no event applier is found for the given intent and record version. The event is not applied and it is up to the caller to decide what to do.