It offers simple functions that are mainly called by FastObjectDB. The unique index that index collection object ids, must be added first.
Definition at line 58 of file FODBCollection.java.
Public Member Functions | |
FODBCollectionDescriptor | getDescriptor () |
Class | getCollectionObjectClass () |
FODBIndex | getIndexByMember (String member) |
boolean | isSynchronized () |
String | getName () |
void | setCollectionCypher (FODBCypher cypher) throws FODBException |
Init collection encryption with the specified cypher. | |
FODBCypher | getCollectionCypher () throws FODBException |
return the collection cypher if any, null otherwise. | |
boolean | addIndex (FODBIndexDescriptor descriptor) throws FODBException |
Add an index. | |
FODBIndex[] | getCollectionIndexList () |
FODBUniqueIndex | getCollectionIdIndex () throws FODBException |
boolean | addElement (Object obj) throws FODBException |
Add an Element to the collection. | |
boolean | replaceElement (Object obj) throws FODBException |
Replace an existing element of the Collection. | |
boolean | deleteSingleElement (Object obj) throws FODBException |
Delete an element of the Collection. | |
boolean | deleteObjectWithId (Object objid) throws FODBException |
Delete an object of the Collection with its ID. | |
ForwardUniqueIndexIterator | getForwardIndexIterator (String memberName) throws FODBException |
BackwardUniqueIndexIterator | getBackwardIndexIterator (String memberName) throws FODBException |
Object | getElementAtPos (long pos) throws FODBException |
Returns the element at position 'pos'. | |
FastObjectDB | getDatabase () |
| |
Static Public Member Functions | |
static FODBCollection | createCollection (FastObjectDB db, FODBCollectionDescriptor descriptor) throws FODBException |
Function that is called to create a new collection. | |
static FODBCollection | openCollection (FastObjectDB db, String colName) throws FODBException |
Function that is called to open an existing collection. | |
Protected Member Functions | |
Object | getNodeAtPos (long pos) throws FODBException |
Returns the node at position 'pos'. |
static FODBCollection org.openmobileis.database.fastobjectdb.db.FODBCollection.createCollection | ( | FastObjectDB | db, | |
FODBCollectionDescriptor | descriptor | |||
) | throws FODBException [static] |
Function that is called to create a new collection.
db | - FastObjectDB instance that refers to it. | |
colName | - Collection name. | |
objType | - Type of Objects stored in the collection. |
FODBException |
Definition at line 152 of file FODBCollection.java.
References org.openmobileis.database.fastobjectdb.FODBCollectionDescriptor.getCollectionName(), org.openmobileis.database.fastobjectdb.FastObjectDB.getName(), and org.openmobileis.database.fastobjectdb.FastObjectDB.getRootDir().
Referenced by org.openmobileis.database.fastobjectdb.FastObjectDB.createCollection().
static FODBCollection org.openmobileis.database.fastobjectdb.db.FODBCollection.openCollection | ( | FastObjectDB | db, | |
String | colName | |||
) | throws FODBException [static] |
Function that is called to open an existing collection.
db | - FastObjectDB instance that refers to it. | |
colName | - Collection name. |
FODBException |
Definition at line 173 of file FODBCollection.java.
References org.openmobileis.database.fastobjectdb.FastObjectDB.getName(), and org.openmobileis.database.fastobjectdb.FastObjectDB.getRootDir().
Referenced by org.openmobileis.database.fastobjectdb.FastObjectDB.openCollection().
void org.openmobileis.database.fastobjectdb.db.FODBCollection.setCollectionCypher | ( | FODBCypher | cypher | ) | throws FODBException |
Init collection encryption with the specified cypher.
Must be call just after collection initialization before storing/reading any data. Same cypher must be provided to read already stored object.
cypher | : cypher to be use to encrypt data. |
FODBException |
Definition at line 196 of file FODBCollection.java.
References org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.setCollectionCypher().
Referenced by org.openmobileis.database.fastobjectdb.synchro.client.SynchroFastObjectDBManager.getCurrentFODB(), and org.openmobileis.database.fastobjectdb.db.test.TestFastObjectDB.openDB().
FODBCypher org.openmobileis.database.fastobjectdb.db.FODBCollection.getCollectionCypher | ( | ) | throws FODBException |
return the collection cypher if any, null otherwise.
Definition at line 205 of file FODBCollection.java.
References org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.getCollectionCypher().
Referenced by org.openmobileis.database.fastobjectdb.synchro.client.OpenMSPFODBSyncListener.getSendCommandMetaData().
boolean org.openmobileis.database.fastobjectdb.db.FODBCollection.addIndex | ( | FODBIndexDescriptor | descriptor | ) | throws FODBException |
Add an index.
descriptor | - index descriptor. |
FODBException |
Definition at line 217 of file FODBCollection.java.
References org.openmobileis.common.util.collection.Array.add(), org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.begin(), org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.commit(), org.openmobileis.common.util.collection.Array.contains(), and org.openmobileis.database.fastobjectdb.FastObjectDB.getTransactionManager().
Referenced by org.openmobileis.database.fastobjectdb.FastObjectDB.addIndex().
boolean org.openmobileis.database.fastobjectdb.db.FODBCollection.addElement | ( | Object | obj | ) | throws FODBException |
Add an Element to the collection.
obj | - object to add. |
FODBException |
Definition at line 273 of file FODBCollection.java.
References org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.begin(), org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.commit(), org.openmobileis.common.util.collection.Array.get(), org.openmobileis.database.fastobjectdb.FastObjectDB.getTransactionManager(), org.openmobileis.common.util.collection.Array.size, and org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.writeObject().
Referenced by org.openmobileis.database.fastobjectdb.FastObjectDB.add().
boolean org.openmobileis.database.fastobjectdb.db.FODBCollection.replaceElement | ( | Object | obj | ) | throws FODBException |
Replace an existing element of the Collection.
obj | - object that will replace an existing one. |
FODBException |
Definition at line 311 of file FODBCollection.java.
References org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.begin(), org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.commit(), org.openmobileis.common.util.collection.Array.get(), org.openmobileis.database.fastobjectdb.db.index.FODBIndex.getKey(), org.openmobileis.database.fastobjectdb.db.index.FODBUniqueIndex.getKeyPosition(), org.openmobileis.database.fastobjectdb.FastObjectDB.getTransactionManager(), org.openmobileis.database.fastobjectdb.db.index.FODBIndex.getType(), and org.openmobileis.common.util.collection.Array.isEmpty().
Referenced by org.openmobileis.database.fastobjectdb.FastObjectDB.replace().
boolean org.openmobileis.database.fastobjectdb.db.FODBCollection.deleteSingleElement | ( | Object | obj | ) | throws FODBException |
Delete an element of the Collection.
obj | - object to Delete. |
FODBException |
Definition at line 357 of file FODBCollection.java.
References org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.begin(), org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.commit(), org.openmobileis.common.util.collection.Array.get(), org.openmobileis.database.fastobjectdb.db.index.FODBIndex.getKey(), org.openmobileis.database.fastobjectdb.FastObjectDB.getTransactionManager(), and org.openmobileis.common.util.collection.Array.isEmpty().
Referenced by org.openmobileis.database.fastobjectdb.synchro.client.SynchroFastObjectDB.add(), org.openmobileis.database.fastobjectdb.FastObjectDB.delete(), and org.openmobileis.database.fastobjectdb.synchro.client.SynchroFastObjectDB.replace().
boolean org.openmobileis.database.fastobjectdb.db.FODBCollection.deleteObjectWithId | ( | Object | objid | ) | throws FODBException |
Delete an object of the Collection with its ID.
The first index in the collection is use as ID unique index.
id | - id of object to Delete. |
FODBException |
Definition at line 396 of file FODBCollection.java.
References org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.begin(), org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.commit(), org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.deleteObject(), org.openmobileis.database.fastobjectdb.db.index.FODBIndex.delObjectWithKey(), org.openmobileis.common.util.collection.Array.get(), org.openmobileis.database.fastobjectdb.db.FODBCollection.getElementAtPos(), org.openmobileis.database.fastobjectdb.db.index.FODBUniqueIndex.getKeyPosition(), org.openmobileis.database.fastobjectdb.FastObjectDB.getTransactionManager(), org.openmobileis.common.util.collection.Array.isEmpty(), and org.openmobileis.common.util.collection.Array.size.
Referenced by org.openmobileis.database.fastobjectdb.FastObjectDB.deleteWithId().
Object org.openmobileis.database.fastobjectdb.db.FODBCollection.getElementAtPos | ( | long | pos | ) | throws FODBException |
Returns the element at position 'pos'.
pos | - postion of the element to retrieve. |
FODBException |
Definition at line 510 of file FODBCollection.java.
References org.openmobileis.database.fastobjectdb.FastObjectDB.getTransactionManager(), org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.readObject(), and org.openmobileis.database.fastobjectdb.db.transaction.TransactionManager.validateThread().
Referenced by org.openmobileis.database.fastobjectdb.db.FODBCollection.deleteObjectWithId(), org.openmobileis.database.fastobjectdb.db.ForwardUniqueIndexIterator.next(), and org.openmobileis.database.fastobjectdb.db.BackwardUniqueIndexIterator.prev().
Object org.openmobileis.database.fastobjectdb.db.FODBCollection.getNodeAtPos | ( | long | pos | ) | throws FODBException [protected] |
Returns the node at position 'pos'.
pos | - postion of the element to retrieve. |
FODBException |
Definition at line 529 of file FODBCollection.java.
References org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.readNode().
Referenced by org.openmobileis.database.fastobjectdb.db.BackwardUniqueIndexIterator.BackwardUniqueIndexIterator(), org.openmobileis.database.fastobjectdb.db.ForwardUniqueIndexIterator.next(), and org.openmobileis.database.fastobjectdb.db.BackwardUniqueIndexIterator.prev().