org.axonframework.domain
Interface DomainEventStream

All Known Implementing Classes:
FileSystemBufferedReaderDomainEventStream, SimpleDomainEventStream

public interface DomainEventStream

The DomainEventStream represents a stream of historical domain events. The order of events in this stream must represent the actual chronological order in which the events happened. A DomainEventStream may provide access to all events (from the first to the most recent) or any subset of these.

Since:
0.1
Author:
Allard Buijze

Method Summary
 boolean hasNext()
          Returns true if the stream has more events, meaning that a call to next() will not result in an exception.
 DomainEventMessage next()
          Returns the next events in the stream, if available.
 DomainEventMessage peek()
          Returns the next events in the stream, if available, without moving the pointer forward.
 

Method Detail

hasNext

boolean hasNext()
Returns true if the stream has more events, meaning that a call to next() will not result in an exception. If a call to this method returns false, there is no guarantee about the result of a consecutive call to next()

Returns:
true if the stream contains more events.

next

DomainEventMessage next()
Returns the next events in the stream, if available. Use hasNext() to obtain a guarantee about the availability of any next event. Each call to next() will forward the pointer to the next event in the stream.

If the pointer has reached the end of the stream, the behavior of this method is undefined. It could either return null, or throw an exception, depending on the actual implementation. Use hasNext() to confirm the existence of elements after the current pointer.

Returns:
the next event in the stream.

peek

DomainEventMessage peek()
Returns the next events in the stream, if available, without moving the pointer forward. Hence, a call to next() will return the same event as a call to peek(). Use hasNext() to obtain a guarantee about the availability of any next event.

If the pointer has reached the end of the stream, the behavior of this method is undefined. It could either return null, or throw an exception, depending on the actual implementation. Use hasNext() to confirm the existence of elements after the current pointer.

Returns:
the next event in the stream.


Copyright © 2010-2016. All Rights Reserved.