|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecthelma.objectmodel.dom.XmlDatabase
public final class XmlDatabase
A simple XML-database
| Field Summary | |
|---|---|
protected Application |
app
|
protected java.io.File |
dbHomeDir
|
protected java.lang.String |
encoding
|
protected XmlIDGenerator |
idgen
|
protected NodeManager |
nmgr
|
| Constructor Summary | |
|---|---|
XmlDatabase()
|
|
| Method Summary | |
|---|---|
void |
abortTransaction(ITransaction txn)
Abort the given transaction |
ITransaction |
beginTransaction()
Start a new transaction. |
void |
commitTransaction(ITransaction txn)
committ the given transaction, makint its changes persistent |
void |
deleteNode(ITransaction txn,
java.lang.String kstr)
Marks an element from the database as deleted |
java.lang.String |
getEncoding()
get the file encoding used by this database |
XmlIDGenerator |
getIDGenerator(ITransaction txn)
Get the id-generator for this database. |
INode |
getNode(ITransaction txn,
java.lang.String kstr)
Retrieves a Node from the database. |
void |
init(java.io.File dbHome,
Application app)
Initializes the database from an application. |
void |
insertNode(ITransaction txn,
java.lang.String kstr,
INode node)
Save a node with the given key. |
java.lang.String |
nextID()
Get the id for the next new object to be stored. |
void |
saveIDGenerator(ITransaction txn)
Write the id-generator to file. |
void |
setEncoding(java.lang.String encoding)
set the file encoding to use |
void |
shutdown()
Shut down the database |
void |
updateNode(ITransaction txn,
java.lang.String kstr,
INode node)
Update a node with the given key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.io.File dbHomeDir
protected Application app
protected NodeManager nmgr
protected XmlIDGenerator idgen
protected java.lang.String encoding
| Constructor Detail |
|---|
public XmlDatabase()
| Method Detail |
|---|
public void init(java.io.File dbHome,
Application app)
throws DatabaseException
init in interface IDatabaseapp -
DatabaseExceptionpublic void shutdown()
shutdown in interface IDatabase
public ITransaction beginTransaction()
throws DatabaseException
beginTransaction in interface IDatabaseDatabaseException
public void commitTransaction(ITransaction txn)
throws DatabaseException
commitTransaction in interface IDatabasetxn -
DatabaseException
public void abortTransaction(ITransaction txn)
throws DatabaseException
abortTransaction in interface IDatabasetxn -
DatabaseException
public java.lang.String nextID()
throws ObjectNotFoundException
nextID in interface IDatabaseObjectNotFoundException
public XmlIDGenerator getIDGenerator(ITransaction txn)
throws ObjectNotFoundException
txn -
ObjectNotFoundException
public void saveIDGenerator(ITransaction txn)
throws java.io.IOException
txn -
java.io.IOException
public INode getNode(ITransaction txn,
java.lang.String kstr)
throws java.io.IOException,
ObjectNotFoundException
getNode in interface IDatabasetxn - the current transactionkstr - the key
java.io.IOException - if an I/O error occurred loading the object.
ObjectNotFoundException - if no object is stored by this key.
public void insertNode(ITransaction txn,
java.lang.String kstr,
INode node)
throws java.io.IOException
insertNode in interface IDatabasetxn - kstr - node -
java.io.IOException
public void updateNode(ITransaction txn,
java.lang.String kstr,
INode node)
throws java.io.IOException
updateNode in interface IDatabasetxn - kstr - node -
java.io.IOException
public void deleteNode(ITransaction txn,
java.lang.String kstr)
throws java.io.IOException
deleteNode in interface IDatabasetxn - kstr -
java.io.IOExceptionpublic void setEncoding(java.lang.String encoding)
encoding - the database's file encodingpublic java.lang.String getEncoding()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||