public interface QueryListener extends EventListener
AbstractQueryListener
.
All tuple events between 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
after the QueryListener.snapshotEnd(EndSnapshotEvent)
can receive any number of 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. For example, if the query was made through a
LiveViewMultiConnection
, and the server that was servicing the query has
gone down, and a new server has since picked the connection back up, the QueryListener.snapshotBegin(BeginSnapshotEvent)
will signal the beginning of a new result set coming from the new server.
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 the result snapshot.
|
void |
snapshotEnd(EndSnapshotEvent event)
Event to indicate the query snapshot is complete.
|
void |
tupleAdded(TupleAddedEvent event)
Event when a new tuple is added to the result.
|
void |
tupleRemoved(TupleRemovedEvent event)
Event when an existing tuple is removed from the 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