org.openbandy.io.storage
Class Storage

java.lang.Object
  extended by org.openbandy.io.storage.Storage
Direct Known Subclasses:
DatabaseStorage, RmsStorage

public abstract class Storage
extends java.lang.Object

TODO describe purpose and usage

(c) Copyright Philipp Bolliger 2008, ALL RIGHTS RESERVED.

Version:
0.1
Author:
Philipp Bolliger (philipp@bolliger.name)

Constructor Summary
Storage()
           
 
Method Summary
 void closeAllConnections()
           
 boolean delete(Serializable serializable)
          Deletes the serializable and all the objects it references.
abstract  boolean deleteShallow(Serializable serializable)
          Deletes the serializable object, but not the reference objects.
abstract  int existsInStorage(Serializable serializable)
          Return 0 if databaseSerializable does not already exist in database.
abstract  boolean isEmpty()
          Returns true if no object is contained within the storage.
 boolean removeConnection(StorageConnection connection)
          Returns true if the connection was removed
abstract  void reset()
          Reset the storage with all it's meta structures and caches.
 int size()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Storage

public Storage()
Method Detail

existsInStorage

public abstract int existsInStorage(Serializable serializable)
Return 0 if databaseSerializable does not already exist in database. If databaseSerializable exist, this method returns the id according to databaseSerializable.getIdName().

Parameters:
serializable -
Returns:

deleteShallow

public abstract boolean deleteShallow(Serializable serializable)
Deletes the serializable object, but not the reference objects.

Parameters:
serializable -
Returns:
true if deletion was successful

delete

public boolean delete(Serializable serializable)
Deletes the serializable and all the objects it references.

Parameters:
serializable -
Returns:
true if deletion was successful

size

public int size()

removeConnection

public boolean removeConnection(StorageConnection connection)
Returns true if the connection was removed

Parameters:
connection -
Returns:

closeAllConnections

public void closeAllConnections()

reset

public abstract void reset()
Reset the storage with all it's meta structures and caches. Use carefully!


isEmpty

public abstract boolean isEmpty()
Returns true if no object is contained within the storage.