GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members  

ResourceDescription.java

Go to the documentation of this file.
00001 /*
00002  * Created on Apr 16, 2004
00003  *  
00004  */
00005 package org.gridlab.gat.resources;
00006 
00007 import java.util.Map;
00008 import java.util.NoSuchElementException;
00009 
00010 /**
00011  * @author rob
00012  * 
00013  * The GATResourceDescription interface forms the base for the
00014  * GATSoftwareResourceDescriptions and GATHardwareResourceDescriptions classes;
00015  * these are used to specify and find resources which may then be used, for
00016  * example, to submit a Job to. It has an associated Map whose key/value pairs
00017  * describe the resource.
00018  * 
00019  * A GAT Job may have many requirements, both on software and hardware, which
00020  * need to be satisfied to run, e.g. specific versions of the operating system,
00021  * minimum amount of memory, presence of specific compilers or libraries on a
00022  * system, etc. Each one of these requirements may itself possibly in turn
00023  * depend on some other software or hardware requirement. Sometimes there may be
00024  * possible alternatives, for example the GAT Job may be able to use any one of
00025  * a set of possible system libraries which might be installed. Hence, a
00026  * complete resource description requires a list of possible specifications,
00027  * and, ideally, some way of specifying allowable alternatives. In order to
00028  * accommodate this, a GATResourceDescription has, as well as a table describing
00029  * software of hardware resource requirements, a list of child
00030  * GATResourceDescriptions, at least one of which must be satisfied in addition
00031  * to the requirements of this GATResourceDescription. I.e. a
00032  * GATResourceDescription is a tree, and it is matched if a path exists from the
00033  * root of the tree to any leaf where the requirements of every node on that
00034  * path are met.
00035  */
00036 
00037 public interface ResourceDescription extends java.io.Serializable {
00038 
00039     /**
00040      * Do equality test.
00041      * 
00042      * @param o The object to compare to.
00043      * @return boolean: equal or not.
00044      */
00045     public boolean equals(Object o);
00046 
00047     /**
00048      * Sets the ResourceDescription of this instance.
00049      * 
00050      * @param description the description
00051      */
00052     void setDescription(Map description);
00053 
00054     /**
00055      * Get the ResourceDescription of this instance.
00056      * 
00057      * @return the description.
00058      */
00059     Map getDescription();
00060 
00061     /**
00062      * Adds the name/value pair to the set of name/value pairs which describe
00063      * the "parent" component.
00064      * 
00065      * @param name
00066      *            The Name, a java.lang.String, to add to the name/value pairs
00067      *            which describe the "parent" component.
00068      * @param value
00069      *            The Value, an Object, to add to the name/value pairs which
00070      *            describe the "parent" component.
00071      */
00072     void addResourceAttribute(String name, Object value);
00073 
00074     /**
00075      * Removes the name/value pair with the passed name from the java.util.Map
00076      * of name/value pairs which describe the "parent" hardware component.
00077      * 
00078      * @param name
00079      *            The Name, a java.lang.String, to of the name/value pair to
00080      *            remove from the name/value pairs which describe the "parent"
00081      *            hardware component.
00082      * @throws NoSuchElementException
00083      *             the name cannot be found.
00084      */
00085     void removeResourceAttribute(String name) throws NoSuchElementException;
00086 
00087     /**
00088      * Adds the passed ResourceDescription to the list of ResourceDescriptions
00089      * which describe this ResourceDescription.
00090      * 
00091      * @param ResourceDescription
00092      *            The ResourceDescription to add to the list of
00093      *            ResourceDescriptions which describe this ResourceDescription.
00094      */
00095     void addResourceDescription(ResourceDescription description);
00096 
00097     /**
00098      * Removes the passed ResourceDescription from the list of
00099      * ResourceDescriptions which describe this ResourceDescription.
00100      * 
00101      * @param description
00102      *            The ResourceDescription to remove from the list of
00103      *            ResourceDescriptions which describe this ResourceDescription.
00104      * @throws NoSuchElementException
00105      *             The description could not be found.
00106      */
00107     void removeResourceDescription(ResourceDescription description)
00108             throws NoSuchElementException;
00109 }