@Test public void readAllSnapshots() { List<Long> sequenceNumbers = new ArrayList<>(); testSubject.readSnapshots("55", 0, Long.MAX_VALUE, 0, event -> sequenceNumbers.add(event.getAggregateSequenceNumber())); Assert.assertEquals(4, sequenceNumbers.size()); }
public void readSnapshots(String aggregateId, long minSequenceNumber, long maxSequenceNumber, int maxResults, Consumer<SerializedEvent> eventConsumer) { snapshotReader.streamByAggregateId(aggregateId, minSequenceNumber, maxSequenceNumber, maxResults > 0 ? maxResults : Integer.MAX_VALUE, eventConsumer); }
AggregateReader { public void readSnapshots(String aggregateId, long minSequenceNumber, long maxSequenceNumber, int maxResults, Consumer<SerializedEvent> eventConsumer) { snapshotReader.streamByAggregateId(aggregateId, minSequenceNumber, maxSequenceNumber, maxResults > 0 ? maxResults : Integer.MAX_VALUE, eventConsumer); } }
AggregateReader { public void readSnapshots(String aggregateId, long minSequenceNumber, long maxSequenceNumber, int maxResults, Consumer<SerializedEvent> eventConsumer) { snapshotReader.streamByAggregateId(aggregateId, minSequenceNumber, maxSequenceNumber, maxResults > 0 ? maxResults : Integer.MAX_VALUE, eventConsumer); } AggregateReader(EventStorageEngine eventStorageEngine, SnapshotReader snapshotReader); }
AggregateReader { public void readSnapshots(String aggregateId, long minSequenceNumber, long maxSequenceNumber, int maxResults, Consumer<SerializedEvent> eventConsumer) { snapshotReader.streamByAggregateId(aggregateId, minSequenceNumber, maxSequenceNumber, maxResults > 0 ? maxResults : Integer.MAX_VALUE, 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 readSnapshots(String aggregateId, long minSequenceNumber, long maxSequenceNumber, int maxResults, Consumer<SerializedEvent> eventConsumer) { snapshotReader.streamByAggregateId(aggregateId, minSequenceNumber, maxSequenceNumber, maxResults > 0 ? maxResults : Integer.MAX_VALUE, 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);  }