Class MockUnclusteredEventStore

  • All Implemented Interfaces:
    EventStoreApi, java.io.Closeable, java.lang.AutoCloseable

    public class MockUnclusteredEventStore
    extends java.lang.Object
    implements EventStoreApi, java.io.Closeable
    • Constructor Detail

      • MockUnclusteredEventStore

        public MockUnclusteredEventStore()
    • Method Detail

      • clear

        public static void clear()
      • getEvents

        public EventQuery getEvents​(EventQuery query)
                             throws AttivioException
        Description copied from interface: EventStoreApi
        Executes the event query. If EventQuery.getMaxFetchSize() is > 0, multiple calls might be needed to get all the events. In that case, getEvents() should be called until EventQuery.isDone() returns true. Note that the last call might return an empty list. An exception is thrown if getEvents() is called after EventQuery.isDone().
         EventQuery eventQuery = new EventQuery();
         eventQuery.setSubsystem(subsystem);
         eventQuery.setStart(start);
         eventQuery.setEnd(end);
         eventQuery.setGetAlreadyAcknowledged(getAcknoledeged);
         eventQuery.setMaxFetchSize(maxFetchSize);
         while (!eventQuery.isDone()) {
           eventQuery = eventStore().getEvents(eventQuery);
           // Do something with eventQuery.getEventList()
         }
         
        Specified by:
        getEvents in interface EventStoreApi
        Parameters:
        query - the caller must pass the EventQuery object returned from the previous call
        Returns:
        the query object to be used in the next getEvents call
        Throws:
        AttivioException
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable