io.fluxcapacitor.javaclient.eventsourcing.EventStore Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-client Show documentation
Show all versions of java-client Show documentation
Default Java client library for interfacing with Flux Capacitor.
package io.fluxcapacitor.javaclient.eventsourcing;
import io.fluxcapacitor.javaclient.common.Message;
import io.fluxcapacitor.javaclient.common.serialization.DeserializingMessage;
import java.util.List;
import java.util.stream.Stream;
import static java.util.Arrays.asList;
public interface EventStore {
default void storeDomainEvents(String aggregateId, String domain, long lastSequenceNumber, Message... events) {
storeDomainEvents(aggregateId, domain, lastSequenceNumber, asList(events));
}
void storeDomainEvents(String aggregateId, String domain, long lastSequenceNumber, List events);
default Stream getDomainEvents(String aggregateId) {
return getDomainEvents(aggregateId, -1L);
}
Stream getDomainEvents(String aggregateId, long lastSequenceNumber);
}