|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IBasicPersistence
This interface is a mandatory interface that must be implemented by any persistent adapter. It contains the basic methods required for correct space operation
Method Summary | |
---|---|
void |
closeContext(PersistentContext context)
This method called whenever a context is about to be closed. |
void |
createClassTable(PersistentContext context,
String className,
String[] fieldNames,
String[] fieldTypes,
String uidFieldName,
String uidFieldNameType,
boolean[] indexIndicators,
boolean isFifoSupported)
This method called when the space engine creates new metadata class/table in the persistent storage. |
void |
createIndex(PersistentContext context,
String className,
String fieldType,
int fieldPosition)
This method called when the space engine create index in persistent storage for specified table column/class attribute. |
int |
delete(PersistentContext context,
String className,
Object UID)
This method called when the engine removes an the entry from persistent storage. |
void |
dropClassTable(PersistentContext context,
String className)
This method called when the space engine removes table/metadata class from the persistent storage. |
void |
dropIndex(PersistentContext context,
String className,
String indexName)
This method called when the space engine remove index from persistent storage. |
void |
flush(PersistentContext context)
This method called when the space engine instruct the persistent store to flush its cache into the disk. |
int |
getCount(PersistentContext context,
String className)
This method called when the space engine retrieve class instance count. |
Iterator |
getEntries(PersistentContext context,
String className,
Object[] uids)
This method called when the space engine searches for multiple entries using array of UID's and className in the persistent storage. |
PersistentEntry |
getEntry(PersistentContext context,
String className,
Object uid)
This method called when the space engine search for entry using UID and class name in the persistent storage. |
void |
init(String url,
String user,
String password,
boolean isColdMode,
Properties properties)
This method called when the persistent adapter initializes, information kept per-connection. |
void |
initContext(PersistentContext context)
This method is called whenever a new context is created. |
void |
insert(PersistentContext context,
PersistentEntry entry)
This method called whenever the space engine store an the entry in the persistent storage. |
void |
shutDown()
This method called when the space engine shut down the persistent storage. |
void |
update(PersistentContext context,
PersistentEntry entry)
This method called the the space engine updates the entry in persistent storage. |
Method Detail |
---|
void init(String url, String user, String password, boolean isColdMode, Properties properties) throws SAException
url
- The URL string of the datastore connectionuser
- The datastore user loginpassword
- The datastore user passwordisColdMode
- If true the datastore
should remove all internal tables/classes.properties
- persistent adapter properties as defined in the
<persistent> element in the space configuration
SAException
- in case a persistent adapter error occurredvoid initContext(PersistentContext context) throws SAException
context
- new context
SAException
- in case a persistent adapter error occurredvoid closeContext(PersistentContext context) throws SAException
context
- closed context
SAException
- in case a persistent adapter error occurredvoid insert(PersistentContext context, PersistentEntry entry) throws SAException
context
- Persistent implementation contextentry
- The entry to be stored
SAException
- in case a persistent adapter error occurredint delete(PersistentContext context, String className, Object UID) throws SAException
context
- Persistent implementation contextclassName
- The class name of the entry that is about to be removed from persistent storeUID
- The entry unique id that is about to removed from persistent store
SAException
- in case a persistent adapter error occurredvoid update(PersistentContext context, PersistentEntry entry) throws SAException
context
- Persistent implementation contextentry
- The entry that is about to be updated in persistent store
The PersistentEntry object should include all object values.
SAException
- in case a persistent adapter error occurredvoid createClassTable(PersistentContext context, String className, String[] fieldNames, String[] fieldTypes, String uidFieldName, String uidFieldNameType, boolean[] indexIndicators, boolean isFifoSupported) throws SAException
context
- Persistent implementation contextclassName
- The name of the table/metadata class that should be createdfieldNames
- The names of the tables fields/metadata class attributes
NOTE: the last field is the fields names array is the
unique ID (UID) field of the entry.fieldTypes
- The types of the fields. These are represented using Java types � i.e. "java.lang.Integer , java.lang.String �etc.uidFieldName
- name of the UID (unique id) field. This is relevant for
implementations that supports indexing � in this case the UID should be the primary keyuidFieldNameType
- name of the UID type (unique id) field.indexIndicators
- If indicator element is true the corresponding
field should be indexed (relevant only when the implementation supports indexing)isFifoSupported
- If the IQueryablePersistent interface is implemented,
the table/class should support selectEntries with FIFO parameter=true
SAException
- in case a persistent adapter error occurredvoid dropClassTable(PersistentContext context, String className) throws SAException
context
- Persistent implementation contextclassName
- The name of the table/metadata class that should be dropped
SAException
- in case a persistent adapter error occurredIterator getEntries(PersistentContext context, String className, Object[] uids) throws SAException
context
- Persistent implementation contextclassName
- The entries class name to lookupuids
- The array of entries UID's to lookup ,if this
parameter is null - all entries with this class name will be returned
SAException
- in case a persistent adapter error occurredPersistentEntry getEntry(PersistentContext context, String className, Object uid) throws SAException
context
- Persistent implementation contextclassName
- The class name of the entry that should be selecteduid
- The unique id (UID) of the entry to be selected
null
SAException
- in case a persistent adapter error occurredvoid shutDown() throws SAException
SAException
- in case a persistent adapter error occurredvoid createIndex(PersistentContext context, String className, String fieldType, int fieldPosition) throws SAException
context
- Persistent implementation contextclassName
- The name of the table/metadata class namefieldType
- The name of the index to createfieldPosition
- The field order at the table/metadata class
SAException
- in case a persistent adapter error occurredvoid dropIndex(PersistentContext context, String className, String indexName) throws SAException
context
- Persistent implementation contextclassName
- The name of the table/metadata classindexName
- The name of the index to be dropped
SAException
- in case a persistent adapter error occurredvoid flush(PersistentContext context) throws SAException
context
- Persistent implementation context
SAException
- in case a persistent adapter error occurredint getCount(PersistentContext context, String className) throws SAException
context
- Persistent implementation contextclassName
- The name of the class (and subclasses) for which instance count should be returned
SAException
- in case a persistent adapter error occurred
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |