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

java.lang.Object
  |
  +--uk.ac.ed.inf.ogsaconfig.garm.collections.MetaCollection
All Implemented Interfaces:
FileCollection
Direct Known Subclasses:
DependentCollection, GeneratedCollection, HistoryCollection, PolicyCollection

public abstract class MetaCollection
extends java.lang.Object
implements FileCollection

A meta collection does not provide any different files than the layers below it, instead it stores properties of the lower level collection. A meta collection need not implement any method it does not wish to, although add() and remove() are typical


Constructor Summary
protected MetaCollection(FileCollection base)
           
 
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.
 VFile[] contents()
          Returns all the files present in this collection
 VFile[] contents(FileType ft)
          Returns all the files of the given type 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.
 VFile retrieve(VFile vfile)
          Returns the file in the collection corresponding to the given file.
 FileCollection root()
          Returns the base layer of the stack of file collections of which this is top.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaCollection

protected MetaCollection(FileCollection base)
Parameters:
base - is the level below this
Method Detail

contents

public final VFile[] contents()
Description copied from interface: FileCollection
Returns all the files present in this collection

Specified by:
contents in interface FileCollection

contents

public final VFile[] contents(FileType ft)
Description copied from interface: FileCollection
Returns all the files of the given type in this collection

Specified by:
contents in interface FileCollection

retrieve

public final VFile retrieve(VFile vfile)
Description copied from interface: FileCollection
Returns the file in the collection corresponding to the given file. Many file collections are layered on other collections, and this can be used to determine the file in this collection corresponding to one in another collection

Specified by:
retrieve in interface FileCollection

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

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

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

root

public final FileCollection root()
Description copied from interface: FileCollection
Returns the base layer of the stack of file collections of which this is top. This is commonly used to identify collections from different points in the stack.

Specified by:
root in interface FileCollection

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