org.qi4j.library.eventsourcing.application.source

## Interface ApplicationEventSource

- All Known Subinterfaces:
    MemoryApplicationEventStoreService
  All Known Implementing Classes:
    MemoryApplicationEventStoreService.MemoryStoreMixin

      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

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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
        `maxTransactions` - maximum transactions
      Returns:
        list of event 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
        `maxTransactions` - maximum transactions
      Returns:
        list of event transactions