Package helma.objectmodel
Interface IDatabase
-
- All Known Implementing Classes:
XmlDatabase
public interface IDatabase
Interface that is implemented by Database wrappers
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
abortTransaction(ITransaction transaction)
Abort a transaction, rolling back all changes.ITransaction
beginTransaction()
Begin a new transaction.void
commitTransaction(ITransaction transaction)
Commit a transaction, making all changes persistentvoid
deleteNode(ITransaction transaction, java.lang.String key)
Delete the node specified by the given key.INode
getNode(ITransaction transaction, java.lang.String key)
Get the node from the database specified by the given key.void
init(java.io.File dbHome, Application app)
Initialize the database with the given db directory and application.void
insertNode(ITransaction transaction, java.lang.String key, INode node)
Insert a node with the given keyjava.lang.String
nextID()
Get the next ID from the db's ID generatorvoid
shutdown()
Let the database know we're shutting down.void
updateNode(ITransaction transaction, java.lang.String key, INode node)
Update a node with the given key
-
-
-
Method Detail
-
init
void init(java.io.File dbHome, Application app)
Initialize the database with the given db directory and application.- Parameters:
dbHome
-app
-
-
shutdown
void shutdown()
Let the database know we're shutting down.
-
nextID
java.lang.String nextID() throws ObjectNotFoundException
Get the next ID from the db's ID generator- Returns:
- a unique id
- Throws:
ObjectNotFoundException
-
getNode
INode getNode(ITransaction transaction, java.lang.String key) throws java.io.IOException, ObjectNotFoundException
Get the node from the database specified by the given key.- Parameters:
transaction
-key
-- Returns:
- Throws:
java.io.IOException
ObjectNotFoundException
- if no object exists for the key.
-
insertNode
void insertNode(ITransaction transaction, java.lang.String key, INode node) throws java.io.IOException
Insert a node with the given key- Parameters:
transaction
-key
-node
-- Throws:
java.io.IOException
-
updateNode
void updateNode(ITransaction transaction, java.lang.String key, INode node) throws java.io.IOException
Update a node with the given key- Parameters:
transaction
-key
-node
-- Throws:
java.io.IOException
-
deleteNode
void deleteNode(ITransaction transaction, java.lang.String key) throws java.io.IOException
Delete the node specified by the given key.- Parameters:
transaction
- ...key
- ...- Throws:
java.io.IOException
- ...
-
beginTransaction
ITransaction beginTransaction()
Begin a new transaction.- Returns:
- the transaction
-
commitTransaction
void commitTransaction(ITransaction transaction) throws DatabaseException
Commit a transaction, making all changes persistent- Parameters:
transaction
-- Throws:
DatabaseException
-
abortTransaction
void abortTransaction(ITransaction transaction) throws DatabaseException
Abort a transaction, rolling back all changes.- Parameters:
transaction
-- Throws:
DatabaseException
-
-