001: /*
002: * This file or a portion of this file is licensed under the terms of
003: * the Globus Toolkit Public License, found in file ../GTPL, or at
004: * http://www.globus.org/toolkit/download/license.html. This notice must
005: * appear in redistributions of this file, with or without modification.
006: *
007: * Redistributions of this Software, with or without modification, must
008: * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
009: * some other similar material which is provided with the Software (if
010: * any).
011: *
012: * Copyright 1999-2004 University of Chicago and The University of
013: * Southern California. All rights reserved.
014: */
015: package org.griphyn.vdl.classes;
016:
017: import java.util.Enumeration;
018: import java.util.List;
019:
020: /**
021: * This interface defines a common base for {@link Derivation} and
022: * {@link Call}. The latter is in a sense an anonymous DV.
023: *
024: * @author Jens-S. Vöckler
025: * @author Yong Zhao
026: * @version $Revision: 50 $
027: */
028: public interface HasPass {
029: /**
030: * Accessor: Adds an actual argument to the bag of arguments.
031: *
032: * @param vPass is the new actual argument to add.
033: * @see Pass
034: */
035: public void addPass(Pass vPass) throws NullPointerException;
036:
037: /**
038: * Accessor: Provides an iterator for the bag of actual arguments.
039: * @return the iterator for <code>Pass</code> elements.
040: * @see Pass
041: * @see java.util.Enumeration
042: */
043: public Enumeration enumeratePass();
044:
045: /**
046: * Determines all LFN instances from the actual arguments of a given
047: * derivation that match the specified linkage. This is a higher-level
048: * method employing the given interface. Note that also linkage of
049: * NONE will not be found in wildcard search mode.
050: *
051: * @param linkage is the linkage type to match against, -1 for all
052: * files.
053: * @return a list of logical filenames from the given derivation which
054: * match the given linkage. For a linkage of -1, complete LFNs will be
055: * returned, for any other linkage, just the filename will be returned.
056: *
057: * @see Value#getLFNList( int )
058: * @see LFN
059: */
060: public java.util.List getLFNList(int linkage);
061:
062: /**
063: * Determines if the list contains an LFN of the specified linkage.
064: * The logic uses short-circuit evaluation, thus finding things is
065: * faster than not finding things. Searching a list is a potentially
066: * expensive method.
067: *
068: * @param filename is the name of the LFN
069: * @param linkage is the linkage to check for, -1 for any linkage type.
070: * @return true if the LFN is contained in the scalar, false otherwise.
071: *
072: * @see Value#containsLFN( String, int )
073: * @see LFN
074: */
075: public boolean containsLFN(String filename, int linkage);
076:
077: /**
078: * Accessor: Obtains an actual argument identified by the bound variable.
079: *
080: * @param name is the binding name.
081: * @return the bound value to the given name.
082: * @see Pass
083: */
084: public Pass getPass(String name);
085:
086: /**
087: * Accessor: Obtains the bag of actual arguments as array. Note that the
088: * order is arbitrary.
089: *
090: * @return an array containing all bound variables.
091: * @see Pass
092: */
093: public Pass[] getPass();
094:
095: /**
096: * Accessor: Counts the number of actual arguments.
097: *
098: * @return the number of actual arguments in the internal bag.
099: */
100: public int getPassCount();
101:
102: /**
103: * Accessor: Removes all actual arguments. Effectively empties the bag.
104: */
105: public void removeAllPass();
106:
107: /**
108: * Accessor: Removes a specific actual argument.
109: *
110: * @param name is the bound variable name of the argument to remove.
111: * @return the object that was removed, or null, if not found.
112: * @see Pass
113: */
114: public Pass removePass(String name);
115:
116: /**
117: * Accessor: Adds a new or overwrites an existing actual argument.
118: *
119: * @param vPass is a new actual argument with bound name and value.
120: * @see Pass
121: */
122: public void setPass(Pass vPass);
123:
124: /**
125: * Accessor: Replaces the bag of actual argument with new arguments.
126: *
127: * @param passArray is the new actual argument list.
128: * @see Pass
129: */
130: public void setPass(Pass[] passArray);
131:
132: /**
133: * Accessor: Obtains the name of the logical {@link Transformation}
134: * that this derivation refers to.
135: */
136: public java.lang.String getUses();
137:
138: /**
139: * Accessor: Obtains the namespace of the logical {@link Transformation}
140: * that this derivation refers to.
141: */
142: public java.lang.String getUsesspace();
143:
144: /**
145: * Accessor: Obtains the maximum inclusive version permissable for
146: * binding to a {@link Transformation}.
147: *
148: * @return the maximum inclusive version number.
149: */
150: public String getMaxIncludeVersion();
151:
152: /**
153: * Accessor: Obtains the minimum inclusive version permissable for
154: * binding to a {@link Transformation}.
155: *
156: * @return the minimum inclusive version number.
157: */
158: public String getMinIncludeVersion();
159:
160: /**
161: * Identify the transformation or derivation by its name.
162: */
163: public String identify();
164:
165: /**
166: * Constructs dynamically a short descriptive, hopefully unique
167: * identifier for this derivation w/o referring to any transformation.
168: * FIXME: Anonymous derivations get their hash code, which is well
169: * for the first versions working without database. Later versions
170: * with database must use some unique sequence mechanism instead.
171: *
172: * @return a string describing the derivation
173: * @see Object#hashCode()
174: */
175: public String shortID();
176: }
|