fipaos.skill.db.nodatabase
Class NoDatabase

java.lang.Object
  |
  +--fipaos.skill.db.nodatabase.NoDatabase
All Implemented Interfaces:
Database

public class NoDatabase
extends java.lang.Object
implements Database


Constructor Summary
NoDatabase(java.lang.String db_name, DatabaseProfile profile)
           
 
Method Summary
 void addObject(DatabaseObject obj)
          Method to add the given DatabaseObject to the database, in the given relation.
 void closeDatabase()
          Method to close the database store.
 void createDatabase()
          Method to create the database store.
 void createRelation(java.lang.String relation)
          Creates the given relation within the Database
 void deleteDatabase()
          Method to remove the database store.
 void deleteRelation(java.lang.String relation)
          Deletes the given relation from the Database
 void endTransaction()
          Indicates that a transaction has finished.
 DatabaseObject findObject(java.lang.String unique_id)
          Method to locate the object in the given relation with the given UID
 java.util.Enumeration getIDs()
          Method to return an enumeration of the keys in the database
 void openDatabase()
          Method to re-open the database store.
 void removeObject(DatabaseObject obj)
          Method to remove the given DatabaseObject from the Database
 void removeObject(java.lang.String unique_id)
          Method to remove the DatabaseObject from the Database with the given UID
 void startTransaction(boolean readonly)
          Indicates that a transaction is about to start.
 void updateObject(DatabaseObject obj)
          Method to update the given DatabaseObject in the Database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoDatabase

public NoDatabase(java.lang.String db_name,
                  DatabaseProfile profile)
Method Detail

createDatabase

public void createDatabase()
Method to create the database store. Either this method or openDatabase() should be called before attempting to interact with the Database
Specified by:
createDatabase in interface Database

openDatabase

public void openDatabase()
Method to re-open the database store. Either this method or createDatabase() should be called before attempting to interact with the Database
Specified by:
openDatabase in interface Database

closeDatabase

public void closeDatabase()
Method to close the database store. Should only be called after openDatabase() or createDatabase() have been used and after all necessary transactions have been made. Transactions cannot take place again until the database is re-opened.
Specified by:
closeDatabase in interface Database

deleteDatabase

public void deleteDatabase()
Method to remove the database store. The database will be closed if necessary before the store is removed. The database can only be used again once a new store has been created.
Specified by:
deleteDatabase in interface Database

addObject

public void addObject(DatabaseObject obj)
Method to add the given DatabaseObject to the database, in the given relation.
Specified by:
addObject in interface Database
Parameters:
obj - The DatabaseObject to add

findObject

public DatabaseObject findObject(java.lang.String unique_id)
Method to locate the object in the given relation with the given UID
Specified by:
findObject in interface Database
Parameters:
unique_id - The unique id of the DatabaseObject to find

updateObject

public void updateObject(DatabaseObject obj)
Method to update the given DatabaseObject in the Database
Specified by:
updateObject in interface Database
Parameters:
obj - The DatabaseObject to update

removeObject

public void removeObject(DatabaseObject obj)
Method to remove the given DatabaseObject from the Database
Specified by:
removeObject in interface Database
Parameters:
obj - The DatabaseObject to remove

removeObject

public void removeObject(java.lang.String unique_id)
Method to remove the DatabaseObject from the Database with the given UID
Specified by:
removeObject in interface Database
Parameters:
unique_id - The unique id of the DatabaseObject to remove

createRelation

public void createRelation(java.lang.String relation)
Creates the given relation within the Database
Specified by:
createRelation in interface Database
Parameters:
relation - The name of the relation to create

deleteRelation

public void deleteRelation(java.lang.String relation)
Deletes the given relation from the Database
Specified by:
deleteRelation in interface Database
Parameters:
relation - The name of the relation to delete

startTransaction

public void startTransaction(boolean readonly)
Indicates that a transaction is about to start. THIS MUST BE CALLED BEFORE THE DATABASE IS MANIPULATED.
Specified by:
startTransaction in interface Database
Parameters:
type - If true, the transaction will be read-only

endTransaction

public void endTransaction()
Indicates that a transaction has finished. THIS MUST BE CALLED AFTER THE DATABASE HAS BEEN MANIPULATED IN ORDER TO COMMIT CHANGES.
Specified by:
endTransaction in interface Database

getIDs

public java.util.Enumeration getIDs()
Method to return an enumeration of the keys in the database
Specified by:
getIDs in interface Database
Returns:
An Enumeration of the ID's of the objects in the database