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

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

public class DependentCollection
extends MetaCollection

A dependent collection is a meta collection which stores dependency information for the layers below it. This means that when a new file fails to install because it would overwrite an existing file, the file is stored as a dependency of the existing file. Later should there be an attempt to uninstall the existing file without having removed the dependency, it will fail


Nested Class Summary
 class DependentCollection.DFile
           
 
Constructor Summary
DependentCollection(FileCollection base, boolean enabled, PersistenceMechanism store)
           
DependentCollection(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

DependentCollection

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

DependentCollection

public DependentCollection(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