public interface QueryListener extends EventListener
QueryListener.snapshotBegin(BeginSnapshotEvent)
and QueryListener.snapshotEnd(EndSnapshotEvent)
are QueryListener.tupleAdded(TupleAddedEvent)
events.
If the LiveViewQueryType
of the query is SNAPSHOT_AND_CONTINUOUS, then the QueryListener
will receive QueryListener.tupleAdded(TupleAddedEvent)
, QueryListener.tupleUpdated(TupleUpdatedEvent)
, and
QueryListener.tupleRemoved(TupleRemovedEvent)
, in any order.
It is also possible that the query results will need to be reset, in which case the QueryListener might receive
a new QueryListener.snapshotBegin(BeginSnapshotEvent)
. This signals that all previous data should be discarded,
and the entire process will start fresh. (This currently only can happen if the query was made through a
LiveViewMultiConnection
, and it happens because the server that was servicing the query has
gone down and a new server has picked it up.)
At any point the QueryListener might receive a QueryListener.exceptionRaised(QueryExceptionEvent)
, if some
unrecoverable failure has happened. In that case, the query will be closed and no more TupleEvents
will happen. If QueryListener.snapshotEnd(EndSnapshotEvent)
has not yet been called, it won't be. The exception
will be the final callback made to the QueryListener.Modifier and Type | Method and Description |
---|---|
void |
deleteBegin(BeginDeleteEvent event)
Event to indicate the start of delete query.
|
void |
deleteEnd(EndDeleteEvent event)
Event to indicate the delete query is complete.
|
void |
exceptionRaised(QueryExceptionEvent event)
Event when an exception occurs during the query.
|
void |
queryClosed(QueryClosedEvent event)
Event when a query being listened to is closed.
|
void |
snapshotBegin(BeginSnapshotEvent event)
Event to indicate the start of snapshot results.
|
void |
snapshotEnd(EndSnapshotEvent event)
Event to indicate the snapshot is complete.
|
void |
tupleAdded(TupleAddedEvent event)
Event when a new tuple is added to the Query result.
|
void |
tupleRemoved(TupleRemovedEvent event)
Event when an existing tuple is removed from a result.
|
void |
tupleUpdated(TupleUpdatedEvent event)
Event when an existing tuple in the result is updated.
|
void tupleAdded(TupleAddedEvent event)
event
- add eventvoid tupleUpdated(TupleUpdatedEvent event)
event
- update eventvoid tupleRemoved(TupleRemovedEvent event)
event
- remove eventvoid snapshotBegin(BeginSnapshotEvent event)
event
- snapshot beginvoid snapshotEnd(EndSnapshotEvent event)
event
- snapshot endvoid deleteBegin(BeginDeleteEvent event)
event
- delete beginvoid deleteEnd(EndDeleteEvent event)
event
- delete endvoid exceptionRaised(QueryExceptionEvent event)
event
- exception eventvoid queryClosed(QueryClosedEvent event)
event
- query closed event