org.qi4j.library.eventsourcing.application.source
Interface ApplicationEventSource


public interface ApplicationEventSource

An ApplicationEventSource is a source of application events that can be pulled in chunks. Events are grouped in the transactions in which they were created.


Method Summary
 Input<TransactionApplicationEvents,IOException> transactionsAfter(long afterTimestamp, long maxTransactions)
          Get list of event transactions after the given timestamp.
 Input<TransactionApplicationEvents,IOException> transactionsBefore(long beforeTimestamp, long maxTransactions)
          Get list of event transactions before the given timestamp.
 

Method Detail

transactionsAfter

Input<TransactionApplicationEvents,IOException> transactionsAfter(long afterTimestamp,
                                                                  long maxTransactions)
Get list of event transactions after the given timestamp. If they are on the exact same timestamp, they will not be included.

The method uses the visitor pattern, so a visitor is sent in which is given each transaction, one at a time.

Parameters:
afterTimestamp - timestamp of transactions

transactionsBefore

Input<TransactionApplicationEvents,IOException> transactionsBefore(long beforeTimestamp,
                                                                   long maxTransactions)
Get list of event transactions before the given timestamp. If they are on the exact same timestamp, they will not be included.

The method uses the visitor pattern, so a visitor is sent in which is given each transaction, one at a time.

The transactions are sent to the visitor with the latest transaction first, i.e. walking backwards in the stream.

Parameters:
beforeTimestamp - timestamp of transactions