Class TupleUpdatedEvent

All Implemented Interfaces:
Serializable

public final class TupleUpdatedEvent extends AbstractTupleEvent
The event dispatched when an existing Tuple is updated. The method getOld() will return null unless the event was propagated from a LiveResult. The LiveResult will propagate the old tuple since it maintains a local copy of all tuples in the query result.
See Also:
  • Constructor Details

    • TupleUpdatedEvent

      public TupleUpdatedEvent(Object source, Long key, Tuple oldTuple, Tuple newTuple, List<Schema.Field> changedFields)
      Deprecated.
      Parameters:
      source - the source of the event
      key - the unique key of the tuple
      oldTuple - the old tuple (may be null)
      newTuple - the updated tuple
      changedFields - the list of changed fields
    • TupleUpdatedEvent

      public TupleUpdatedEvent(Object source, Long oldKey, Tuple oldTuple, Tuple newTuple, Tuple keyData, List<Schema.Field> changedFields, List<com.streambase.liveview.client.internal.TupleFieldComparator> fieldComparators)
      Parameters:
      source - the source of the event
      oldKey - the unique key of the tuple
      oldTuple - the old tuple (may be null)
      newTuple - the updated tuple
      keyData - The data for the full key. May be null only if oldKey is not 0.
      changedFields - the list of changed fields
      fieldComparators - The pre-built set of comparators for comparing complex keys. May be null only if oldKey is not 0.
  • Method Details

    • getOld

      public Tuple getOld()
      Retrieve the old version of the tuple. This will return null in all cases unless it is being propagated from a LiveResult
      Returns:
      The old tuple
    • hasOld

      public boolean hasOld()
      See if the old tuple was included in this event
      Returns:
      true if old tuple is not null
    • getChangedFields

      public List<Schema.Field> getChangedFields()
      Retrieve a list of the fields that changed in this update
      Returns:
      field list of changed fields
    • dispatch

      public void dispatch(QueryListener listener)
      Dispatches this event to the listener
      Specified by:
      dispatch in class AbstractQueryEvent
      Parameters:
      listener - the query listener