public class JSONMapEntityStoreMixin extends Object implements EntityStore, EntityStoreSPI, StateStore, JSONMapEntityStoreActivation
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 and Cache extensions.
MapEntityStore implementations will get their values as JSON.
| Modifier and Type | Class and Description |
|---|---|
static class |
JSONMapEntityStoreMixin.CacheState |
JSONMapEntityStoreActivation.Activator| Constructor and Description |
|---|
JSONMapEntityStoreMixin() |
| Modifier and Type | Method and Description |
|---|---|
StateCommitter |
applyChanges(EntityStoreUnitOfWork uow,
Iterable<EntityState> entityStates) |
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 JSONEntityState |
readEntityState(ModuleDescriptor module,
Reader entityState) |
void |
setUpJSONMapES() |
void |
tearDownJSONMapES() |
String |
versionOf(EntityStoreUnitOfWork uow,
EntityReference reference) |
protected void |
writeEntityState(JSONEntityState state,
Writer writer,
String version,
Instant lastModified) |
protected String uuid
public void setUpJSONMapES()
throws Exception
setUpJSONMapES in interface JSONMapEntityStoreActivationExceptionpublic void tearDownJSONMapES()
throws Exception
tearDownJSONMapES in interface JSONMapEntityStoreActivationExceptionpublic 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> entityStates) throws EntityStoreException
applyChanges in interface EntityStoreSPIEntityStoreExceptionpublic Stream<EntityState> entityStates(ModuleDescriptor module)
EntityStoreentityStates in interface EntityStoremodule - Moduleprotected Identity newUnitOfWorkId()
protected void writeEntityState(JSONEntityState state, Writer writer, String version, Instant lastModified) throws EntityStoreException
EntityStoreExceptionprotected JSONEntityState readEntityState(ModuleDescriptor module, Reader entityState) throws EntityStoreException
EntityStoreExceptionpublic javax.json.JsonObject jsonStateOf(String id)
jsonStateOf in interface StateStore