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 unitOfWork,
Iterable<EntityState> state) |
EntityState |
entityStateOf(EntityStoreUnitOfWork unitOfWork,
ModuleSpi module,
EntityReference identity) |
Input<EntityState,EntityStoreException> |
entityStates(ModuleSpi module) |
JSONObject |
jsonStateOf(String id) |
EntityState |
newEntityState(EntityStoreUnitOfWork unitOfWork,
ModuleSpi module,
EntityReference identity,
EntityDescriptor entityDescriptor) |
EntityStoreUnitOfWork |
newUnitOfWork(Usecase usecaseMetaInfo,
ModuleSpi module,
long currentTime) |
protected String |
newUnitOfWorkId() |
protected JSONEntityState |
readEntityState(ModuleSpi module,
Reader entityState) |
void |
setUpJSONMapES() |
void |
tearDownJSONMapES() |
protected void |
writeEntityState(JSONEntityState state,
Writer writer,
String identity,
long lastModified) |
protected String uuid
public void setUpJSONMapES()
throws Exception
setUpJSONMapES in interface JSONMapEntityStoreActivationExceptionpublic void tearDownJSONMapES()
throws Exception
tearDownJSONMapES in interface JSONMapEntityStoreActivationExceptionpublic EntityStoreUnitOfWork newUnitOfWork(Usecase usecaseMetaInfo, ModuleSpi module, long currentTime)
newUnitOfWork in interface EntityStorepublic EntityState newEntityState(EntityStoreUnitOfWork unitOfWork, ModuleSpi module, EntityReference identity, EntityDescriptor entityDescriptor)
newEntityState in interface EntityStoreSPIpublic EntityState entityStateOf(EntityStoreUnitOfWork unitOfWork, ModuleSpi module, EntityReference identity)
entityStateOf in interface EntityStoreSPIpublic StateCommitter applyChanges(EntityStoreUnitOfWork unitOfWork, Iterable<EntityState> state) throws EntityStoreException
applyChanges in interface EntityStoreSPIEntityStoreExceptionpublic Input<EntityState,EntityStoreException> entityStates(ModuleSpi module)
entityStates in interface EntityStoreprotected String newUnitOfWorkId()
protected void writeEntityState(JSONEntityState state, Writer writer, String identity, long lastModified) throws EntityStoreException
EntityStoreExceptionprotected JSONEntityState readEntityState(ModuleSpi module, Reader entityState) throws EntityStoreException
EntityStoreExceptionpublic JSONObject jsonStateOf(String id) throws IOException
jsonStateOf in interface StateStoreIOException