public class MapEntityStoreMixin extends Object implements EntityStore, EntityStoreSPI, StateStore, MapEntityStoreActivation
Implement MapEntityStore and add as mixin to the service using this mixin.
See MemoryMapEntityStoreMixin for reference.
EntityStores based on this mixin gets support for the Migration extension.
MapEntityStore implementations will get their values as JSON.
MapEntityStoreActivation.Activator| Constructor and Description |
|---|
MapEntityStoreMixin() |
| Modifier and Type | Method and Description |
|---|---|
void |
activateMapEntityStore() |
StateCommitter |
applyChanges(EntityStoreUnitOfWork uow,
Iterable<EntityState> state) |
EntityState |
entityStateOf(EntityStoreUnitOfWork uow,
ModuleDescriptor module,
EntityReference reference) |
Stream<EntityState> |
entityStates(ModuleDescriptor module)
Stream of all entity states, must be closed.
|
javax.json.JsonObject |
jsonStateOf(String id) |
EntityState |
newEntityState(EntityStoreUnitOfWork uow,
EntityReference reference,
EntityDescriptor entityDescriptor) |
EntityStoreUnitOfWork |
newUnitOfWork(ModuleDescriptor module,
Usecase usecase,
Instant currentTime) |
protected Identity |
newUnitOfWorkId() |
protected EntityState |
readEntityState(ModuleDescriptor module,
Reader entityState) |
String |
versionOf(EntityStoreUnitOfWork uow,
EntityReference reference) |
protected void |
writeEntityState(DefaultEntityState state,
Writer writer,
String version,
Instant lastModified) |
public void activateMapEntityStore()
activateMapEntityStore in interface MapEntityStoreActivationpublic EntityStoreUnitOfWork newUnitOfWork(ModuleDescriptor module, Usecase usecase, Instant currentTime)
newUnitOfWork in interface EntityStorepublic EntityState newEntityState(EntityStoreUnitOfWork uow, EntityReference reference, EntityDescriptor entityDescriptor)
newEntityState in interface EntityStoreSPIpublic EntityState entityStateOf(EntityStoreUnitOfWork uow, ModuleDescriptor module, EntityReference reference)
entityStateOf in interface EntityStoreSPIpublic String versionOf(EntityStoreUnitOfWork uow, EntityReference reference)
versionOf in interface EntityStoreSPIpublic StateCommitter applyChanges(EntityStoreUnitOfWork uow, Iterable<EntityState> state) throws EntityStoreException
applyChanges in interface EntityStoreSPIEntityStoreExceptionpublic Stream<EntityState> entityStates(ModuleDescriptor module)
EntityStoreentityStates in interface EntityStoremodule - Moduleprotected Identity newUnitOfWorkId()
protected void writeEntityState(DefaultEntityState state, Writer writer, String version, Instant lastModified) throws EntityStoreException
EntityStoreExceptionprotected EntityState readEntityState(ModuleDescriptor module, Reader entityState) throws EntityStoreException
EntityStoreExceptionpublic javax.json.JsonObject jsonStateOf(String id)
jsonStateOf in interface StateStore