Package es.bsc.dataclay.dbhandler
Interface DBHandler
- 
- All Known Implementing Classes:
- SQLHandler,- SQLiteHandler
 
 public interface DBHandlerThis class represents the functions that any handler of the storage of objects must implement.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanclose()Close the databaseintcount()Count number of objects in DBvoiddelete(ObjectID objectID)Deletes and object from the database.booleanexists(ObjectID objectID)Check if object with ID provided exists.byte[]get(ObjectID objectID)Get serialized object identified by ObjectIDbooleanisClosed()Verify if database is closed.voidopen()Open the database.voidstore(ObjectID objectID, byte[] bytes)Store the object.voidupdate(ObjectID objectID, byte[] newbytes)Updates an object identified by the ID provided with the new values provided.voidvacuum()Vacuum database.
 
- 
- 
- 
Method Detail- 
storevoid store(ObjectID objectID, byte[] bytes) Store the object.- Parameters:
- objectID- ID of the object
- bytes- Bytes of the object
 
 - 
getbyte[] get(ObjectID objectID) Get serialized object identified by ObjectID- Parameters:
- objectID- ID of the object
- Returns:
- Bytes of the serialized object with ID provided.
 
 - 
existsboolean exists(ObjectID objectID) Check if object with ID provided exists.- Parameters:
- objectID- ID of the object
- Returns:
- TRUE if object exists.
 
 - 
updatevoid update(ObjectID objectID, byte[] newbytes) Updates an object identified by the ID provided with the new values provided.- Parameters:
- objectID- ID of the object.
- newbytes- New byte values
 
 - 
deletevoid delete(ObjectID objectID) Deletes and object from the database.- Parameters:
- objectID- ID of the object to delete
 
 - 
isClosedboolean isClosed() Verify if database is closed.- Returns:
- TRUE if database is closed. FALSE, otherwise.
 
 - 
closeboolean close() Close the database- Returns:
- TRUE if database was closed successfully. FALSE otherwise.
 
 - 
openvoid open() Open the database.
 - 
countint count() Count number of objects in DB- Returns:
- number of objects in DB
 
 - 
vacuumvoid vacuum() Vacuum database.
 
- 
 
-