org.openmobileis.database.fastobjectdb.db.FODBCollection Class Reference

List of all members.

Detailed Description

FODBCollection is the class that represents each collection.

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 ()
 
Returns:


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'.


Member Function Documentation

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.

Parameters:
db - FastObjectDB instance that refers to it.
colName - Collection name.
objType - Type of Objects stored in the collection.
Returns:
the object created.
Exceptions:
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.

Parameters:
db - FastObjectDB instance that refers to it.
colName - Collection name.
Returns:
the object created.
Exceptions:
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.

Parameters:
cypher : cypher to be use to encrypt data.
Exceptions:
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.

Returns:
cypher use to encrypt data, 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.

Parameters:
descriptor - index descriptor.
Returns:
true if it succeded, false otherwise.
Exceptions:
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.

Parameters:
obj - object to add.
Returns:
true if it succeded, false otherwise.
Exceptions:
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.

Parameters:
obj - object that will replace an existing one.
Returns:
true if it succeded, false otherwise.
Exceptions:
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.

Parameters:
obj - object to Delete.
Returns:
- true if it succeded, false otherwise.
Exceptions:
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.

Parameters:
id - id of object to Delete.
Returns:
- object position or NODE.NO_NODE if not found.
Exceptions:
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'.

Parameters:
pos - postion of the element to retrieve.
Returns:
- the element retrieved.
Exceptions:
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'.

Parameters:
pos - postion of the element to retrieve.
Returns:
- the element retrieved.
Exceptions:
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().


The documentation for this class was generated from the following file:
Generated on Mon Dec 4 11:03:34 2006 for OpenMobileIS by  doxygen 1.5.1-p1