net.jinx.db.transaction.hierarchy
Class HierarchySnapshotManager

java.lang.Object
  extended by net.jinx.db.transaction.hierarchy.HierarchySnapshotManager
All Implemented Interfaces:
SnapshotManager

public class HierarchySnapshotManager
extends java.lang.Object
implements SnapshotManager

SnapshotManager wrapper for a Hierarchy.


Constructor Summary
HierarchySnapshotManager()
           
 
Method Summary
 void commit()
          Commits the current changes to the data Object, indicating that the most recent Transaction was successful.
 java.lang.Object getData()
          Provides a Hierarchy to manipulate.
 java.lang.Object getQueryData()
          Provides an ImmutableHierarchy to query.
 void readSnapshot(java.io.InputStream in)
          Reads a snapshot of the data Object from in, replacing the current data Object, or overriding all it's internal data.
 void rollback()
          Indicates that the changes to the data Object since the most recent call to commit() should be discarded.
 void writeSnapshot(java.io.OutputStream out)
          Writes a snapshot of the data Object to out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchySnapshotManager

public HierarchySnapshotManager()
Method Detail

getData

public java.lang.Object getData()
Provides a Hierarchy to manipulate.

Specified by:
getData in interface SnapshotManager
Returns:
a Hierarchy.

getQueryData

public java.lang.Object getQueryData()
Provides an ImmutableHierarchy to query.

Specified by:
getQueryData in interface SnapshotManager
Returns:
an ImmutableHierarchy.

writeSnapshot

public void writeSnapshot(java.io.OutputStream out)
                   throws java.io.IOException
Description copied from interface: SnapshotManager
Writes a snapshot of the data Object to out. This can be in any format desired.

Specified by:
writeSnapshot in interface SnapshotManager
Parameters:
out - the OutputStream to write the snapshot to.
Throws:
java.io.IOException

readSnapshot

public void readSnapshot(java.io.InputStream in)
                  throws java.io.IOException
Description copied from interface: SnapshotManager
Reads a snapshot of the data Object from in, replacing the current data Object, or overriding all it's internal data. This can be in any format desired.

Specified by:
readSnapshot in interface SnapshotManager
Parameters:
in - the InputStream to read the snapshot from.
Throws:
java.io.IOException

commit

public void commit()
Description copied from interface: SnapshotManager
Commits the current changes to the data Object, indicating that the most recent Transaction was successful.

Specified by:
commit in interface SnapshotManager

rollback

public void rollback()
Description copied from interface: SnapshotManager
Indicates that the changes to the data Object since the most recent call to commit() should be discarded.

Specified by:
rollback in interface SnapshotManager