E - public class StateRepositorySnapshotProvider<E> extends java.lang.Object implements SnapshotProvider
StateRepository to generate the snapshot messages
for a given entity-id.
Using an EntityToMessageListTransformer, the entities stored in the StateRepository can be
transformed into a sequence of messages. This is especially required, if the representation of the
entity does not match the payload of the snapshot messages.
| Constructor and Description |
|---|
StateRepositorySnapshotProvider(java.lang.String channelName,
StateRepository<E> stateRepository) |
StateRepositorySnapshotProvider(java.lang.String channelName,
StateRepository<E> stateRepository,
EntityToMessageListTransformer<E> entityToMessagesTransformer) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
channelName()
The name of the subscribable messaging channel.
|
java.util.stream.Stream<? extends Message<?>> |
snapshot(java.lang.String entityId)
Returns a stream containing all Messages required to get
the most current snapshot for the entity that is identified
by the given entityId
|
public StateRepositorySnapshotProvider(java.lang.String channelName,
StateRepository<E> stateRepository)
public StateRepositorySnapshotProvider(java.lang.String channelName,
StateRepository<E> stateRepository,
EntityToMessageListTransformer<E> entityToMessagesTransformer)
public java.lang.String channelName()
SnapshotProviderchannelName in interface SnapshotProviderpublic java.util.stream.Stream<? extends Message<?>> snapshot(java.lang.String entityId)
SnapshotProvidersnapshot in interface SnapshotProviderentityId - the identifier used to select a single entity.