Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

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 55 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 id) 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'.


Member Function Documentation

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 270 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.addIndex FODBIndexDescriptor  descriptor  )  throws FODBException
 

Add an index.

Parameters:
descriptor - index descriptor.
Returns:
true if it succeded, false otherwise.
Exceptions:
FODBException 

Definition at line 214 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().

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 149 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().

boolean org.openmobileis.database.fastobjectdb.db.FODBCollection.deleteObjectWithId Object  id  )  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 393 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().

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 354 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().

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 202 of file FODBCollection.java.

References org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.getCollectionCypher().

Referenced by org.openmobileis.database.fastobjectdb.synchro.client.SynchroFastObjectDBManager.flushDB(), and org.openmobileis.database.fastobjectdb.synchro.client.OpenMSPFODBSyncListener.getSendCommandMetaData().

FastObjectDB org.openmobileis.database.fastobjectdb.db.FODBCollection.getDatabase  ) 
 

Returns:

Definition at line 533 of file FODBCollection.java.

Referenced by org.openmobileis.database.fastobjectdb.db.BackwardUniqueIndexIterator.BackwardUniqueIndexIterator(), org.openmobileis.database.fastobjectdb.db.ForwardUniqueIndexIterator.initCurrentNode(), org.openmobileis.database.fastobjectdb.db.BackwardUniqueIndexIterator.initCurrentNode(), org.openmobileis.database.fastobjectdb.db.ForwardUniqueIndexIterator.next(), and org.openmobileis.database.fastobjectdb.db.BackwardUniqueIndexIterator.prev().

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 501 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 520 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().

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 170 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().

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 308 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().

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 193 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().


The documentation for this class was generated from the following file:
Generated on Wed Dec 14 21:05:38 2005 for OpenMobileIS by  doxygen 1.4.4