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
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:
-
Field Summary
Fields inherited from class com.streambase.liveview.client.AbstractTupleEvent
keyData, tuple
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionTupleUpdatedEvent
(Object source, Long oldKey, Tuple oldTuple, Tuple newTuple, Tuple keyData, List<Schema.Field> changedFields, List<com.streambase.liveview.client.internal.TupleFieldComparator> fieldComparators) TupleUpdatedEvent
(Object source, Long key, Tuple oldTuple, Tuple newTuple, List<Schema.Field> changedFields) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispatch
(QueryListener listener) Dispatches this event to the listenerRetrieve a list of the fields that changed in this updategetOld()
Retrieve the old version of the tuple.boolean
hasOld()
See if the old tuple was included in this eventMethods inherited from class com.streambase.liveview.client.AbstractTupleEvent
getComparators, getKey, getKeyValue, getTuple, setKey
Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
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<com.streambase.liveview.client.internal.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 Details
-
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
Retrieve a list of the fields that changed in this update- Returns:
- field list of changed fields
-
dispatch
Dispatches this event to the listener- Specified by:
dispatch
in classAbstractQueryEvent
- Parameters:
listener
- the query listener
-