interface EventLogIterator
EventLogIterator
provides an abstraction for accessing
the events
stored on behalf of a particular registration. The methods closely
resemble the java.util.iterator interface with the
exception of the throws
clauses and the additional
destroy and add methods.
The semantics for this iterator are the same as java.util.Iterator
in that next and remove are intended to be called
in pairs.Modifier and Type | Method and Description |
---|---|
void |
add(RemoteEvent re)
Store the given RemoteEvent event.
|
void |
destroy()
Destroy the collection of stored events.
|
boolean |
hasNext()
Return true if there are any events in the collection and
false otherwise.
|
void |
moveAhead(Object cookie)
Effectively removes the last set of read events from the log.
|
RemoteEvent |
next()
Return the next event in the collection.
|
RemoteEventData[] |
readAhead(int maxEvents)
Return an array of RemoteEventData with a limit of
maxEvents elements.
|
void |
remove()
Remove the event at the iterator's current cursor position.
|
void add(RemoteEvent re) throws IOException
IOException
- if an I/O errors occursboolean hasNext() throws IOException
IOException
- if an I/O errors occursRemoteEvent next() throws IOException, NoSuchElementException, ClassNotFoundException
IOException
- if an I/O errors occursNoSuchElementException
- if there are no available
RemoteEvent
sClassNotFoundException
- if there was a problem deserializing
the stored RemoteEvent
void remove() throws IOException
IOException
- if an I/O errors occursRemoteEventData[] readAhead(int maxEvents) throws IOException, ClassNotFoundException
maxEvents
- maximum number of events/elements to returnIOException
- if an I/O error occursClassNotFoundException
- if a class for the serialized
object could not be foundNoSuchElementException
- if no event is availablevoid moveAhead(Object cookie) throws IOException
cookie
- object associated with event to read past. This object
should have been obtained from a previous call to readAhead
on this event log.IOException
- if there was a problem advancing the read pointer.void destroy() throws IOException
IOException
- if an I/O errors occursCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.