Definition at line 50 of file FODBCollectionFile.java.
Public Member Functions | |
boolean | isSynchronized () |
FODBCypher | getCollectionCypher () throws FODBException |
return the collection cypher if any, null otherwise. | |
boolean | isCompressed () |
if isCompressed return true, all stored data object are zipped. | |
void | setCollectionCypher (FODBCypher cypher) throws FODBException |
Init collection encryption with the specified cypher. | |
synchronized long | addIndex (long indexPos) throws IOException, ClassNotFoundException |
Add an index to the indexs table. | |
Object | readNode (long pos) throws IOException, ClassNotFoundException |
Read Object at pos. | |
long | writeNode (Object obj) throws IOException, ClassNotFoundException |
Write an object. | |
void | rewriteNode (Object obj, long pos) throws IOException, ClassNotFoundException |
Rewrite an object The object has to be the same size it used to be. | |
Object | readObject (long pos) throws IOException, ClassNotFoundException |
Read Object at pos. | |
long | writeObject (Object obj) throws IOException, ClassNotFoundException |
Write an object. | |
void | rewriteObjectt (Object obj, long pos) throws IOException, ClassNotFoundException |
Rewrite an object The object has to be the same size it used to be. | |
void | deleteObject (long pos) throws IOException, ClassNotFoundException |
Delete an Object. | |
void | writeHeader () throws IOException, ClassNotFoundException |
Write the header at the beginning of the collection file. | |
void | rewriteHeader () throws IOException, ClassNotFoundException |
FODBCollectionFileHeader | readHeader () throws IOException, ClassNotFoundException |
Read the header which is situated at the beginning of the collection file and return it. | |
Class | getObjectType () |
FODBIndexHeader[] | getIndexsHeaders () throws IOException, ClassNotFoundException |
Read the indexs table. | |
FODBCollectionDescriptor | getDescriptor () |
String | toString () |
Used for debugging. | |
Static Public Member Functions | |
static FODBCollectionFile | createCollection (String filePath, FODBCollectionDescriptor descriptor, FastObjectDB db) throws IOException, ClassNotFoundException |
The function that is called to create a new Collection file. | |
static FODBCollectionFile | openCollection (String filePath, String colname, FastObjectDB db) throws IOException, ClassNotFoundException |
The function that is called to open an existing Collection file. |
FODBCypher org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.getCollectionCypher | ( | ) | throws FODBException |
return the collection cypher if any, null otherwise.
Definition at line 125 of file FODBCollectionFile.java.
Referenced by org.openmobileis.database.fastobjectdb.db.FODBCollection.getCollectionCypher().
boolean org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.isCompressed | ( | ) |
if isCompressed return true, all stored data object are zipped.
The compressed behaviour is defined by the FODBCollection descriptor. To gzip collection allow to gain around 25% of the collection file length but increase the synhro file size for complete synchro.
gzip |
Definition at line 136 of file FODBCollectionFile.java.
References org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFileHeader.getDescriptor(), and org.openmobileis.database.fastobjectdb.FODBCollectionDescriptor.isCompressed().
void org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.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. |
Definition at line 147 of file FODBCollectionFile.java.
References org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.close(), org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.open(), and org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.rewriteHeader().
Referenced by org.openmobileis.database.fastobjectdb.db.FODBCollection.setCollectionCypher().
static FODBCollectionFile org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.createCollection | ( | String | filePath, | |
FODBCollectionDescriptor | descriptor, | |||
FastObjectDB | db | |||
) | throws IOException, ClassNotFoundException [static] |
The function that is called to create a new Collection file.
It just calls the constructor with the argument ACTION_CREATE.
filePath | - same as constructor | |
objType | - same as constructor |
FODBDataFileException |
Definition at line 171 of file FODBCollectionFile.java.
static FODBCollectionFile org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.openCollection | ( | String | filePath, | |
String | colname, | |||
FastObjectDB | db | |||
) | throws IOException, ClassNotFoundException [static] |
The function that is called to open an existing Collection file.
It just calls the constructor with the argument ACTION_OPEN.
filePath | - same as constructor |
FODBDataFileException |
Definition at line 182 of file FODBCollectionFile.java.
synchronized long org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.addIndex | ( | long | indexPos | ) | throws IOException, ClassNotFoundException |
Add an index to the indexs table.
indexPos | - position of the new index in the file. |
FODBDataFileException |
Definition at line 197 of file FODBCollectionFile.java.
References org.openmobileis.database.fastobjectdb.db.index.FODBIndexTable.add().
Referenced by org.openmobileis.database.fastobjectdb.db.store.FODBCollectionIndexFile.addIndexPointerToTable().
Object org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.readNode | ( | long | pos | ) | throws IOException, ClassNotFoundException |
Read Object at pos.
pos | - position of the object to read. |
FODBDataFileException |
Definition at line 232 of file FODBCollectionFile.java.
References org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.readObject(), and org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.seek().
Referenced by org.openmobileis.database.fastobjectdb.db.FODBCollection.getNodeAtPos(), org.openmobileis.database.fastobjectdb.db.store.FODBCollectionIndexFile.readLongPtr(), and org.openmobileis.database.fastobjectdb.db.store.FODBCollectionIndexFile.readNode().
long org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.writeNode | ( | Object | obj | ) | throws IOException, ClassNotFoundException |
Write an object.
obj | - object to wright. |
FODBDataFileException |
Definition at line 244 of file FODBCollectionFile.java.
References org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.writeObject().
Referenced by org.openmobileis.database.fastobjectdb.db.store.FODBCollectionIndexFile.writeHeader(), org.openmobileis.database.fastobjectdb.db.store.FODBCollectionIndexFile.writeLongPtr(), and org.openmobileis.database.fastobjectdb.db.store.FODBCollectionIndexFile.writeNode().
void org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.rewriteNode | ( | Object | obj, | |
long | pos | |||
) | throws IOException, ClassNotFoundException |
Rewrite an object The object has to be the same size it used to be.
The function doesn't check this. It is the role of the developper.
obj | - object to write | |
pos | - position in the collection file. |
FODBDataFileException |
Definition at line 257 of file FODBCollectionFile.java.
References org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.rewriteObject(), and org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.seek().
Referenced by org.openmobileis.database.fastobjectdb.db.store.FODBCollectionIndexFile.rewriteHeader(), org.openmobileis.database.fastobjectdb.db.store.FODBCollectionIndexFile.rewriteLongPtr(), org.openmobileis.database.fastobjectdb.db.store.FODBCollectionIndexFile.rewriteNode(), and org.openmobileis.database.fastobjectdb.db.store.FODBCollectionIndexFile.writeNode().
Object org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.readObject | ( | long | pos | ) | throws IOException, ClassNotFoundException |
Read Object at pos.
pos | - position of the object to read. |
FODBDataFileException |
Definition at line 269 of file FODBCollectionFile.java.
References org.openmobileis.database.fastobjectdb.db.crypto.FODBCypher.decryptObject(), org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFileHeader.getDescriptor(), org.openmobileis.database.fastobjectdb.FODBCollectionDescriptor.isCompressed(), org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.readObject(), and org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.seek().
Referenced by org.openmobileis.database.fastobjectdb.db.FODBCollection.getElementAtPos().
long org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.writeObject | ( | Object | obj | ) | throws IOException, ClassNotFoundException |
Write an object.
obj | - object to wright. |
FODBDataFileException |
Definition at line 303 of file FODBCollectionFile.java.
References org.openmobileis.database.fastobjectdb.db.crypto.FODBCypher.encryptObject(), org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFileHeader.getDescriptor(), org.openmobileis.database.fastobjectdb.FODBCollectionDescriptor.isCompressed(), and org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.writeObject().
Referenced by org.openmobileis.database.fastobjectdb.db.FODBCollection.addElement().
void org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.rewriteObjectt | ( | Object | obj, | |
long | pos | |||
) | throws IOException, ClassNotFoundException |
Rewrite an object The object has to be the same size it used to be.
The function doesn't check this. It is the role of the developper.
obj | - object to write | |
pos | - position in the collection file. |
FODBDataFileException |
Definition at line 345 of file FODBCollectionFile.java.
References org.openmobileis.database.fastobjectdb.db.crypto.FODBCypher.encryptObject(), org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.rewriteObject(), and org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.seek().
void org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.deleteObject | ( | long | pos | ) | throws IOException, ClassNotFoundException |
Delete an Object.
pos | - position of the object to delete. |
FODBDataFileException |
Definition at line 366 of file FODBCollectionFile.java.
References org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.delete(), and org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.seek().
Referenced by org.openmobileis.database.fastobjectdb.db.store.FODBCollectionIndexFile.deleteLongPtr(), org.openmobileis.database.fastobjectdb.db.store.FODBCollectionIndexFile.deleteNode(), and org.openmobileis.database.fastobjectdb.db.FODBCollection.deleteObjectWithId().
void org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.writeHeader | ( | ) | throws IOException, ClassNotFoundException |
Write the header at the beginning of the collection file.
FODBDataFileException |
Definition at line 376 of file FODBCollectionFile.java.
References org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.rewind(), and org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.writeObject().
FODBCollectionFileHeader org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.readHeader | ( | ) | throws IOException, ClassNotFoundException |
Read the header which is situated at the beginning of the collection file and return it.
FODBDataFileException |
Definition at line 393 of file FODBCollectionFile.java.
References org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.readObject(), and org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.rewind().
FODBIndexHeader [] org.openmobileis.database.fastobjectdb.db.store.FODBCollectionFile.getIndexsHeaders | ( | ) | throws IOException, ClassNotFoundException |
Read the indexs table.
Then get all indexs header, and return them as a table.
FODBDataFileException |
Definition at line 420 of file FODBCollectionFile.java.
References org.openmobileis.database.fastobjectdb.db.index.FODBIndexTable.getPosByPlace(), org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.readObject(), org.openmobileis.database.fastobjectdb.db.store.FODBObjectDatabaseFile.seek(), and org.openmobileis.database.fastobjectdb.db.index.FODBIndexTable.size().