All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.fluxcapacitor.javaclient.eventsourcing.EventStore Maven / Gradle / Ivy

There is a newer version: 0.1015.0
Show newest version
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);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy