public final class DefaultEventStore extends DefaultRecordBasedRepository<io.spine.core.EventId,io.spine.server.event.store.EEntity,io.spine.core.Event> implements EventStore
EventStore
.Constructor and Description |
---|
DefaultEventStore()
Constructs new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
append(io.spine.core.Event event)
Appends the passed event to the history of events.
|
void |
appendAll(java.lang.Iterable<io.spine.core.Event> events)
Appends the passed events to the history of events.
|
protected boolean |
isTypeSupplier()
Tells if this repository should be registered as a type supplier with a
Stand
of the BoundedContext to which this repository belongs. |
void |
read(io.spine.server.event.EventStreamQuery request,
io.grpc.stub.StreamObserver<io.spine.core.Event> responseObserver)
Creates the stream with events matching the passed query.
|
void |
registerWith(BoundedContext context)
Initializes the instance by registering itself with the passed
BoundedContext . |
entityFactory, storageConverter
applyMigration, applyMigration, create, createStorage, find, find, findActive, findOrCreate, iterator, loadAll, loadAll, recordStorage, store, store, toEntity
checkStorage, close, context, entityClass, entityStateType, eventFilter, hasContext, idClass, index, isOpen, isRegistered, onRegistered, open, storage, storageAssigned
public void registerWith(BoundedContext context)
BoundedContext
.registerWith
in class DefaultRecordBasedRepository<io.spine.core.EventId,io.spine.server.event.store.EEntity,io.spine.core.Event>
context
- the Bounded Context of this repositorysuper.init()
since it assumes that the context
is already assigned.public void append(io.spine.core.Event event)
EventStore
append
in interface EventStore
event
- the record to appendpublic void appendAll(java.lang.Iterable<io.spine.core.Event> events)
EventStore
If the passed Iterable
is empty, no action is performed.
If the passed Events belong to the different
tenants, an IllegalArgumentException
is thrown.
appendAll
in interface EventStore
events
- the events to appendpublic void read(io.spine.server.event.EventStreamQuery request, io.grpc.stub.StreamObserver<io.spine.core.Event> responseObserver)
EventStore
read
in interface EventStore
request
- the query with filtering parameters for the event historyresponseObserver
- observer for the resulting streamprotected boolean isTypeSupplier()
Repository
Stand
of the BoundedContext
to which this repository belongs.
Normally repositories are type suppliers. Some types of internal repositories are
not type suppliers because data of their entities should not be exposed.
Those classes of repositories should overwrite this method returning false
.
isTypeSupplier
in class Repository<io.spine.core.EventId,io.spine.server.event.store.EEntity>