@Test public void readEventsWithSnapshot() { List<Event> events = new ArrayList<>(); testSubject.readEvents("55", true, 0, event -> { events.add(event.asEvent()); }); Assert.assertEquals(25, events.size()); Assert.assertEquals("Snapshot", events.get(0).getAggregateType()); }
public void readEvents(String aggregateId, boolean useSnapshots, long minSequenceNumber, Consumer<SerializedEvent> eventConsumer) { readEvents(aggregateId, useSnapshots, minSequenceNumber, Long.MAX_VALUE, 0, eventConsumer); }
AggregateReader { public void readEvents(String aggregateId, boolean useSnapshots, long minSequenceNumber, Consumer<SerializedEvent> eventConsumer) { readEvents(aggregateId, useSnapshots, minSequenceNumber, Long.MAX_VALUE, 0, eventConsumer); } }
AggregateReader { public void readEvents(String aggregateId, boolean useSnapshots, long minSequenceNumber, Consumer<SerializedEvent> eventConsumer) { readEvents(aggregateId, useSnapshots, minSequenceNumber, Long.MAX_VALUE, 0, eventConsumer); } AggregateReader(EventStorageEngine eventStorageEngine, SnapshotReader snapshotReader); }
AggregateReader { public void readEvents(String aggregateId, boolean useSnapshots, long minSequenceNumber, Consumer<SerializedEvent> eventConsumer) { readEvents(aggregateId, useSnapshots, minSequenceNumber, Long.MAX_VALUE, 0, eventConsumer); } AggregateReader(EventStorageEngine eventStorageEngine, SnapshotReader snapshotReader); void readEvents(String aggregateId, boolean useSnapshots, long minSequenceNumber,
                           Consumer<SerializedEvent> eventConsumer); void readEvents(String aggregateId, boolean useSnapshots, long minSequenceNumber, long maxSequenceNumber,
                           long minToken,
                           Consumer<SerializedEvent> eventConsumer); void readSnapshots(String aggregateId, long minSequenceNumber, long maxSequenceNumber, int maxResults,
                              Consumer<SerializedEvent> eventConsumer); long readHighestSequenceNr(String aggregateId); long readHighestSequenceNr(String aggregateId, int maxSegmentsHint, long maxTokenHint); }
AggregateReader { public void readEvents(String aggregateId, boolean useSnapshots, long minSequenceNumber, Consumer<SerializedEvent> eventConsumer) { readEvents(aggregateId, useSnapshots, minSequenceNumber, Long.MAX_VALUE, 0, eventConsumer); } AggregateReader(EventStorageEngine eventStorageEngine, SnapshotReader snapshotReader); void readEvents(String aggregateId, boolean useSnapshots, long minSequenceNumber,
                           Consumer<SerializedEvent> eventConsumer); void readEvents(String aggregateId, boolean useSnapshots, long minSequenceNumber, long maxSequenceNumber,
                           long minToken,
                           Consumer<SerializedEvent> eventConsumer); void readSnapshots(String aggregateId, long minSequenceNumber, long maxSequenceNumber, int maxResults,
                              Consumer<SerializedEvent> eventConsumer); long readHighestSequenceNr(String aggregateId); long readHighestSequenceNr(String aggregateId, int maxSegmentsHint, long maxTokenHint);  }