Package com.streambase.liveview.client
Class DeleteQueryListener
java.lang.Object
com.streambase.liveview.client.DeleteQueryListener
- All Implemented Interfaces:
QueryListener,SnapshotResult,Closeable,AutoCloseable,EventListener
A Convenience implementation of
QueryListener that provides a pull based iterator pattern for iterating over snapshot queries.
This should be used with snapshot queries only. Snapshots that hit the row limit are ended without any special notification.- Since:
- 1.5.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()closes any resource associated with the snapshot resultvoiddeleteBegin(BeginDeleteEvent event) Event to indicate the start of delete query.voiddeleteEnd(EndDeleteEvent event) Event to indicate the delete query is complete.voidEvent when an exception occurs during the query.Retrieves the fields describing the tuples that will be returned.booleanhasNext()See if there are more tuples to retrieve.next()Retrieves the next tuple in the result.voidqueryClosed(QueryClosedEvent event) Event when a query being listened to is closed.voidsnapshotBegin(BeginSnapshotEvent event) Event to indicate the start of the result snapshot.voidsnapshotEnd(EndSnapshotEvent event) Event to indicate the query snapshot is complete.voidtupleAdded(TupleAddedEvent event) Event when a new tuple is added to the result.voidtupleRemoved(TupleRemovedEvent event) Event when an existing tuple is removed from the result.voidtupleUpdated(TupleUpdatedEvent event) Event when an existing tuple in the result is updated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.streambase.liveview.client.QueryListener
aggMarkBegin, aggMarkEnd
-
Constructor Details
-
DeleteQueryListener
public DeleteQueryListener()
-
-
Method Details
-
getFields
Retrieves the fields describing the tuples that will be returned.- Specified by:
getFieldsin interfaceSnapshotResult- Returns:
- the fields describing the tuples
- Throws:
LiveViewException- if exception occurs on the Query
-
hasNext
See if there are more tuples to retrieve. If there are not currently any Tuples waiting to be read, this will block until either the next Tuple or the Snapshot end arrives.- Specified by:
hasNextin interfaceSnapshotResult- Returns:
- true if more tuples exist in result
- Throws:
LiveViewException
-
next
Retrieves the next tuple in the result. If there are not currently any Tuples waiting to be read, this will block until either the next Tuple or the Snapshot end arrives.- Specified by:
nextin interfaceSnapshotResult- Returns:
- the next tuple
- Throws:
LiveViewException- if exception occurs on the Query
-
tupleAdded
Event when a new tuple is added to the result.- Specified by:
tupleAddedin interfaceQueryListener- Parameters:
event- add event
-
tupleUpdated
Event when an existing tuple in the result is updated.- Specified by:
tupleUpdatedin interfaceQueryListener- Parameters:
event- update event
-
tupleRemoved
Event when an existing tuple is removed from the result.- Specified by:
tupleRemovedin interfaceQueryListener- Parameters:
event- remove event
-
deleteBegin
Event to indicate the start of delete query.- Specified by:
deleteBeginin interfaceQueryListener- Parameters:
event- delete begin
-
deleteEnd
Event to indicate the delete query is complete.- Specified by:
deleteEndin interfaceQueryListener- Parameters:
event- delete end
-
exceptionRaised
Event when an exception occurs during the query. Since 1.3, reaching the row limit is considered an exception.- Specified by:
exceptionRaisedin interfaceQueryListener- Parameters:
event- exception event
-
queryClosed
Event when a query being listened to is closed.- Specified by:
queryClosedin interfaceQueryListener- Parameters:
event- query closed event
-
close
public void close()Description copied from interface:SnapshotResultcloses any resource associated with the snapshot result- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSnapshotResult
-
snapshotBegin
Description copied from interface:QueryListenerEvent to indicate the start of the result snapshot. This is the first method called when a query starts returning results, but this method is also called to indicate a reset (a complete restart of the query.)- Specified by:
snapshotBeginin interfaceQueryListener- Parameters:
event- snapshot begin
-
snapshotEnd
Description copied from interface:QueryListenerEvent to indicate the query snapshot is complete.- Specified by:
snapshotEndin interfaceQueryListener- Parameters:
event- snapshot end
-