public class MemoryPersistenceHandler extends java.lang.Object implements LazyPersistenceHandler
| Modifier and Type | Class and Description |
|---|---|
protected static class |
MemoryPersistenceHandler.Data
Data
|
protected static class |
MemoryPersistenceHandler.TypeData
Resources for a particular type
|
LazyPersistenceHandler.MetadataAndValue<V>| Modifier and Type | Field and Description |
|---|---|
protected ConfigContext |
_context |
protected java.util.Map<java.lang.String,MemoryPersistenceHandler.TypeData> |
_types |
| Constructor and Description |
|---|
MemoryPersistenceHandler(ConfigContext context)
constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete(Ref ref)
Deletes a resource
|
boolean |
exists(Ref ref)
Returns true if the resource exists
|
protected MemoryPersistenceHandler.Data |
fromCanonical(Ref ref, java.lang.Object object)
translates the Data from canonical form
|
protected LazyPersistenceHandler.MetadataAndValue<MemoryPersistenceHandler.Data> |
getData(Ref ref)
returns the Data info for the given ref
|
protected PBE_DecryptionService |
getDecryptionService()
returns the decryption service to use
|
protected PBE_EncryptionService |
getEncryptionService()
returns the encryption service to use
|
Metadata[] |
getMetadata(java.lang.String typeId)
Returns metadata associated with all the resources of the given type
|
protected ResourceTypeDef |
getResourceTypeDef(java.lang.String typeId) |
protected ValueRepresentation |
getValueRepresentation(Ref ref)
returns the value representation to use for this ref
|
void |
initialize(java.lang.String typeId)
initializes the handler for the given type.
|
void |
persist(Metadata md, java.lang.Object canonicalData)
Persists the given metadata and the resource data
|
void |
persist(java.util.Set<Ref> deletes, java.util.Map<Ref,LazyPersistenceHandler.MetadataAndValue> writes)
persists the following changes
|
java.lang.Object |
readData(Ref ref)
reads and returns the canonical data associated with a resource
|
protected java.lang.String |
session()
returns the session for this handler
|
protected java.lang.Object |
toCanonical(Ref ref, MemoryPersistenceHandler.Data data)
translates the Data to canonical form
|
protected ConfigContext _context
protected java.util.Map<java.lang.String,MemoryPersistenceHandler.TypeData> _types
public MemoryPersistenceHandler(ConfigContext context) throws java.lang.Exception
java.lang.Exceptionpublic void initialize(java.lang.String typeId)
initialize in interface PersistenceHandlerpublic Metadata[] getMetadata(java.lang.String typeId) throws java.lang.Exception
getMetadata in interface PersistenceHandlerjava.lang.Exceptionpublic boolean exists(Ref ref)
exists in interface PersistenceHandlerpublic java.lang.Object readData(Ref ref) throws java.lang.Exception
readData in interface PersistenceHandlerjava.lang.Exceptionpublic void persist(Metadata md, java.lang.Object canonicalData) throws java.lang.Exception
persist in interface PersistenceHandlerjava.lang.Exceptionpublic void delete(Ref ref) throws java.lang.Exception
delete in interface PersistenceHandlerjava.lang.Exceptionpublic void persist(java.util.Set<Ref> deletes, java.util.Map<Ref,LazyPersistenceHandler.MetadataAndValue> writes) throws java.lang.Exception
persist in interface LazyPersistenceHandlerjava.lang.Exceptionprotected java.lang.String session()
protected ValueRepresentation getValueRepresentation(Ref ref)
protected ResourceTypeDef getResourceTypeDef(java.lang.String typeId)
protected PBE_EncryptionService getEncryptionService()
protected PBE_DecryptionService getDecryptionService()
protected java.lang.Object toCanonical(Ref ref, MemoryPersistenceHandler.Data data) throws java.lang.Exception
java.lang.Exceptionprotected MemoryPersistenceHandler.Data fromCanonical(Ref ref, java.lang.Object object) throws java.lang.Exception
java.lang.Exceptionprotected LazyPersistenceHandler.MetadataAndValue<MemoryPersistenceHandler.Data> getData(Ref ref)