de.jadv.server.manager
Interface DatabaseManager

All Known Implementing Classes:
FileDatabaseManager, HSQLDBDatabaseManager

public interface DatabaseManager

This is the interface for saving/loading objects.

Each server needs exactly one database manager. In the moment, there are two implementations:

1. File based. The FileDatabaseManager implements the storage of objects in simple files.

2. HSQLDB based. This is just a small test thing, that should demonstrate, how a database could be used.

Important:
There is no initialisation of the Database! This must be done in the constructor!

Author:
neitzel

Method Summary
 void deleteObject(java.lang.String id)
          Delete an Object from the Database.
 SavedObject getObject(java.lang.String id)
          Returns the Object, that is stored inside the database or null if there isn't any object available.
 void saveObject(SavedObject obj)
          Save an SavedObject inside the database.
 void shutdown()
          Closes the database
 

Method Detail

deleteObject

public void deleteObject(java.lang.String id)
Delete an Object from the Database.

Parameters:
id - ID of the object, that should be deleted.

getObject

public SavedObject getObject(java.lang.String id)
Returns the Object, that is stored inside the database or null if there isn't any object available.

Parameters:
id - ID of the Objects, that should be returned.
Returns:
SavedObject - The SavedObject, if found or null

saveObject

public void saveObject(SavedObject obj)
Save an SavedObject inside the database.

Parameters:
obj - The object, that should be saved

shutdown

public void shutdown()
Closes the database

Throws:
java.lang.Exception