public interface PersistentEntityRegistry
PersistentEntity
classes must be registered here
with register(java.lang.Class<? extends com.lightbend.lagom.javadsl.persistence.PersistentEntity<C, E, S>>)
.
Later, PersistentEntityRef
can be retrieved with refFor(java.lang.Class<? extends com.lightbend.lagom.javadsl.persistence.PersistentEntity<C, ?, ?>>, java.lang.String)
.
Commands are sent to a PersistentEntity
using a PersistentEntityRef
.
Modifier and Type | Method and Description |
---|---|
<Event extends AggregateEvent<Event>> |
eventStream(AggregateEventTag<Event> aggregateTag,
java.util.Optional<java.util.UUID> fromOffset)
A stream of the persistent events that have the given
aggregateTag , e.g. |
java.util.concurrent.CompletionStage<akka.Done> |
gracefulShutdown(scala.concurrent.duration.FiniteDuration timeout)
Gracefully stop the persistent entities and leave the cluster.
|
<C> PersistentEntityRef<C> |
refFor(Class<? extends PersistentEntity<C,?,?>> entityClass,
String entityId)
Retrieve a
PersistentEntityRef for a given PersistentEntity class
and identifier. |
<C,E,S> void |
register(Class<? extends PersistentEntity<C,E,S>> entityClass)
At system startup all
PersistentEntity classes must be registered
with this method. |
<C,E,S> void register(Class<? extends PersistentEntity<C,E,S>> entityClass)
PersistentEntity
classes must be registered
with this method.<C> PersistentEntityRef<C> refFor(Class<? extends PersistentEntity<C,?,?>> entityClass, String entityId)
PersistentEntityRef
for a given PersistentEntity
class
and identifier. Commands are sent to a PersistentEntity
using a PersistentEntityRef
.<Event extends AggregateEvent<Event>> akka.stream.javadsl.Source<akka.japi.Pair<Event,java.util.UUID>,akka.NotUsed> eventStream(AggregateEventTag<Event> aggregateTag, java.util.Optional<java.util.UUID> fromOffset)
aggregateTag
, e.g.
all persistent events of all Order
entities.java.util.concurrent.CompletionStage<akka.Done> gracefulShutdown(scala.concurrent.duration.FiniteDuration timeout)
CompletionStage
is completed when the node has been
removed from the cluster