uk.ac.ed.inf.ogsaconfig.garm.persistence
Class XMLPersistenceMechanism

java.lang.Object
  |
  +--uk.ac.ed.inf.ogsaconfig.garm.persistence.XMLPersistenceMechanism
All Implemented Interfaces:
PersistenceMechanism

public class XMLPersistenceMechanism
extends java.lang.Object
implements PersistenceMechanism

XMLPersistenceMechanism is a reference implementation of PersistenceMechanism. It provides all the necessary persistence functions using XML files as a back-end. The implementation provided is extensible in that XMLNode objects are used for all serialisation and deserialisation.


Constructor Summary
XMLPersistenceMechanism(java.lang.String reference, java.io.File storeDir)
           
 
Method Summary
 java.lang.String getReference()
           
 VFile[] loadFiles(FileCollection collection)
          Returns the files associated with the given file collection stored in the persistence mechanism
protected  java.lang.String makeFilename(FileCollection collection)
           
 void saveFiles(FileCollection collection, VFile[] vfiles)
          Associates the given files with the given collection in the persistence mechanism
protected  java.lang.String shortenClassname(java.lang.String classname)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLPersistenceMechanism

public XMLPersistenceMechanism(java.lang.String reference,
                               java.io.File storeDir)
Parameters:
reference - is the chain which this mechanism will operate on
storeDir - is the directory in which XML files should be created
Method Detail

getReference

public java.lang.String getReference()

shortenClassname

protected java.lang.String shortenClassname(java.lang.String classname)

makeFilename

protected java.lang.String makeFilename(FileCollection collection)

loadFiles

public VFile[] loadFiles(FileCollection collection)
Description copied from interface: PersistenceMechanism
Returns the files associated with the given file collection stored in the persistence mechanism

Specified by:
loadFiles in interface PersistenceMechanism

saveFiles

public void saveFiles(FileCollection collection,
                      VFile[] vfiles)
Description copied from interface: PersistenceMechanism
Associates the given files with the given collection in the persistence mechanism

Specified by:
saveFiles in interface PersistenceMechanism