Class LastSourceEventCache

java.lang.Object
com.inductiveautomation.eventstream.gateway.util.LastSourceEventCache

public class LastSourceEventCache extends Object
Retains the last event each Event Stream's Source emitted, so a preview or a LAST_EVENT Source can replay it. Used for testing with last event.
  • Constructor Details

    • LastSourceEventCache

      public LastSourceEventCache()
  • Method Details

    • setLastValue

      public void setLastValue(EventStreamKey key, EventPayload value)
      Set the last value for the given key.
      Parameters:
      key - EventStream key where the value came from.
      value - Value as it'd be emitted by Source.
    • getLastValue

      public @Nullable EventPayload getLastValue(EventStreamKey key)
      Returns the latest value recorded for key, or null if nothing has been recorded for that Event Stream yet.
      Parameters:
      key - the Event Stream to look up.
      Returns:
      the last recorded value, or null if there is none.