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