Package com.streambase.liveview.client
Class TupleUpdatedEvent
- java.lang.Object
-
- java.util.EventObject
-
- com.streambase.liveview.client.AbstractQueryEvent
-
- com.streambase.liveview.client.AbstractTupleEvent
-
- com.streambase.liveview.client.TupleUpdatedEvent
-
- All Implemented Interfaces:
Serializable
public final class TupleUpdatedEvent extends AbstractTupleEvent
The event dispatched when an existing Tuple is updated. The methodgetOld()will return null unless the event was propagated from aLiveResult. TheLiveResultwill propagate the old tuple since it maintains a local copy of all tuples in the query result.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.streambase.liveview.client.AbstractTupleEvent
keyData, tuple
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description TupleUpdatedEvent(Object source, Long oldKey, Tuple oldTuple, Tuple newTuple, Tuple keyData, List<Schema.Field> changedFields, List<TupleFieldComparator> fieldComparators)TupleUpdatedEvent(Object source, Long key, Tuple oldTuple, Tuple newTuple, List<Schema.Field> changedFields)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispatch(QueryListener listener)Dispatches this event to the listenerList<Schema.Field>getChangedFields()Retrieve a list of the fields that changed in this updateTuplegetOld()Retrieve the old version of the tuple.booleanhasOld()See if the old tuple was included in this event-
Methods inherited from class com.streambase.liveview.client.AbstractTupleEvent
getKey, getKeyValue, getTuple
-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Constructor Detail
-
TupleUpdatedEvent
public TupleUpdatedEvent(Object source, Long key, Tuple oldTuple, Tuple newTuple, List<Schema.Field> changedFields)
Deprecated.- Parameters:
source- the source of the eventkey- the unique key of the tupleoldTuple- the old tuple (may be null)newTuple- the updated tuplechangedFields- the list of changed fields
-
TupleUpdatedEvent
public TupleUpdatedEvent(Object source, Long oldKey, Tuple oldTuple, Tuple newTuple, Tuple keyData, List<Schema.Field> changedFields, List<TupleFieldComparator> fieldComparators)
- Parameters:
source- the source of the eventoldKey- the unique key of the tupleoldTuple- the old tuple (may be null)newTuple- the updated tuplekeyData- The data for the full key. May be null only if oldKey is not 0.changedFields- the list of changed fieldsfieldComparators- The pre-built set of comparators for comparing complex keys. May be null only if oldKey is not 0.
-
-
Method Detail
-
getOld
public Tuple getOld()
Retrieve the old version of the tuple. This will return null in all cases unless it is being propagated from aLiveResult- 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:
dispatchin classAbstractQueryEvent- Parameters:
listener- the query listener
-
-