uk.ac.ed.inf.ogsaconfig.garm.collections
Class HistoryCollection

java.lang.Object
  |
  +--uk.ac.ed.inf.ogsaconfig.garm.collections.MetaCollection
        |
        +--uk.ac.ed.inf.ogsaconfig.garm.collections.HistoryCollection
All Implemented Interfaces:
FileCollection

public class HistoryCollection
extends MetaCollection

A history collection stores information about which sources have provided a given vfile in the underlying collection layers, and provides a means to rollback state after failed installed. This works as follows: when a new file is successfully installed, any old file is stored in the history for that location. Should the new file be uninstalled, the old file will be replaced


Nested Class Summary
 class HistoryCollection.HFile
           
 
Constructor Summary
HistoryCollection(FileCollection base, boolean enabled, PersistenceMechanism store)
           
HistoryCollection(FileCollection base, boolean enabled, PersistenceMechanism store, FileTypeSet types)
           
 
Method Summary
 boolean add(VFile vfile)
          Adds a new file to the collection, which may or may not replace the existing file.
 FileCollection[] bases()
          Returns the list of file collections which presently have files in this collection.
 void destroy()
          Informs the collection of an impending shutdown, and instructs it to save all necessary state.
 boolean remove(VFile vfile)
          Removes a file from the collection.
 
Methods inherited from class uk.ac.ed.inf.ogsaconfig.garm.collections.MetaCollection
contents, contents, retrieve, root
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistoryCollection

public HistoryCollection(FileCollection base,
                         boolean enabled,
                         PersistenceMechanism store)

HistoryCollection

public HistoryCollection(FileCollection base,
                         boolean enabled,
                         PersistenceMechanism store,
                         FileTypeSet types)
Method Detail

destroy

public void destroy()
Description copied from interface: FileCollection
Informs the collection of an impending shutdown, and instructs it to save all necessary state. This is guaranteed to be called before the collection is destroyed.

Specified by:
destroy in interface FileCollection
Overrides:
destroy in class MetaCollection

add

public boolean add(VFile vfile)
Description copied from interface: FileCollection
Adds a new file to the collection, which may or may not replace the existing file. Returns true if the operation was successful, false otherwise.

Specified by:
add in interface FileCollection
Overrides:
add in class MetaCollection

remove

public boolean remove(VFile vfile)
Description copied from interface: FileCollection
Removes a file from the collection. Returns true if the particular (source specific) file is no longer present in the collection

Specified by:
remove in interface FileCollection
Overrides:
remove in class MetaCollection

bases

public FileCollection[] bases()
Description copied from interface: FileCollection
Returns the list of file collections which presently have files in this collection.

Specified by:
bases in interface FileCollection
Overrides:
bases in class MetaCollection