001: /**
002: *
003: * This file or a portion of this file is licensed under the terms of
004: * the Globus Toolkit Public License, found at $PEGASUS_HOME/GTPL or
005: * http://www.globus.org/toolkit/download/license.html.
006: * This notice must appear in redistributions of this file
007: * with or without modification.
008: *
009: * Redistributions of this Software, with or without modification, must reproduce
010: * the GTPL in:
011: * (1) the Software, or
012: * (2) the Documentation or
013: * some other similar material which is provided with the Software (if any).
014: *
015: * Copyright 1999-2004
016: * University of Chicago and The University of Southern California.
017: * All rights reserved.
018: */package org.griphyn.common.catalog;
019:
020: import org.griphyn.common.classes.SysInfo;
021: import org.griphyn.common.classes.TCType;
022:
023: import java.util.List;
024:
025: /**
026: * This class is an interface to the various TxCatalog implementations that Pegasus will use.
027: * It defines the basic functionality for interfacing with various transformation Catalogs
028: * It defines api's for the querying, adding and deleting transformation and associated mappings from the implementing Tx Catalog
029: * By implementing this inteface a user can easily use his own TX Catalog with Pegasus.
030: *
031: *
032: *
033: * @author Gaurang Mehta gmehta@isi.edu
034: * @version $Revision: 127 $
035: */
036: public interface TransformationCatalog extends
037: org.griphyn.common.catalog.Catalog {
038:
039: /**
040: * Returns TC entries for a particular logical transformation and/or on a particular resource and/or of a particular type.
041: * @param namespace String The namespace of the logical transformation.
042: * @param name String the name of the logical transformation.
043: * @param version String The version of the logical transformation.
044: * @param resourceid String The resourceid where the transformation is located. If <B>NULL</B> it returns all resources.
045: * @param type TCType The type of the transformation to search for. If <B>NULL</b> it returns all types.
046: * @return List Returns a list of TransformationCatalogEntry objects containing the corresponding entries from the TC. Returns null if no entry found.
047: * @throws Exception
048: * @see org.griphyn.common.classes.TCType
049: * @see org.griphyn.common.catalog.TransformationCatalogEntry
050: */
051: List getTCEntries(String namespace, String name, String version,
052: String resourceid, TCType type) throws Exception;
053:
054: /**
055: * Returns TC entries for a particular logical transformation and/or on a number of resources and/or of a particular type.
056: * @param namespace String The namespace of the logical transformation.
057: * @param name String the name of the logical transformation.
058: * @param version String The version of the logical transformation.
059: * @param resourceids List The List resourceid where the transformation is located. If <b>NULL</b> it returns all resources.
060: * @param type TCType The type of the transformation to search for. If <b>NULL</b> it returns all types.
061: * @return List Returns a list of TransformationCatalogEntry objects containing the corresponding entries from the TC. Returns null if no entry found.
062: * @throws Exception
063: * @see org.griphyn.common.classes.TCType
064: * @see org.griphyn.common.catalog.TransformationCatalogEntry
065: */
066: List getTCEntries(String namespace, String name, String version,
067: List resourceids, TCType type) throws Exception;
068:
069: /**
070: * Get the list of Resource ID's where a particular transformation may reside.
071: * @param namespace String The namespace of the transformation to search for.
072: * @param name String The name of the transformation to search for.
073: * @param version String The version of the transformation to search for.
074: * @param type TCType The type of the transformation to search for.<BR>
075: * (Enumerated type includes SOURCE, STATIC-BINARY, DYNAMIC-BINARY, PACMAN, INSTALLED, SCRIPT)<BR>
076: * If <B>NULL</B> it returns all types.
077: * @return List Returns a list of Resource Id's as strings. Returns <B>NULL</B> if no results found.
078: * @throws Exception NotImplementedException if not implemented
079: * @see org.griphyn.common.classes.TCType
080: */
081: List getTCResourceIds(String namespace, String name,
082: String version, TCType type) throws Exception;
083:
084: /**
085: * Get the list of PhysicalNames for a particular transformation on a site/sites for a particular type/types;
086: * @param namespace String The namespace of the transformation to search for.
087: * @param name String The name of the transformation to search for.
088: * @param version String The version of the transformation to search for.
089: * @param resourceid String The id of the resource on which you want to search. <BR>
090: * If <B>NULL</B> then returns entries on all resources
091: * @param type TCType The type of the transformation to search for. <BR>
092: * (Enumerated type includes source, binary, dynamic-binary, pacman, installed)<BR>
093: * If <B>NULL</B> then returns entries of all types.
094: * @return List Returns a list of String Arrays.
095: * Each array contains the resourceid, the physical transformation, the type of the tr and the systeminfo.
096: * The last entry in the List is a int array containing the column lengths for pretty print.
097: * Returns <B>NULL</B> if no results found.
098: * @throws Exception NotImplementedException if not implemented.
099: * @see org.griphyn.common.classes.TCType
100: * @see org.griphyn.common.classes.SysInfo
101: */
102: List getTCPhysicalNames(String namespace, String name,
103: String version, String resourceid, TCType type)
104: throws Exception;
105:
106: /**
107: * Get the list of LogicalNames available on a particular resource.
108: * @param resourceid String The id of the resource on which you want to search
109: * @param type TCType The type of the transformation to search for. <BR>
110: * (Enumerated type includes source, binary, dynamic-binary, pacman, installed)<BR>
111: * If <B>NULL</B> then return logical name for all types.
112: * @return List Returns a list of String Arrays.
113: * Each array contains the resourceid, logical transformation
114: * in the format namespace::name:version and type.
115: * The last entry in the list is an array of integers specifying the column length for pretty print.
116: * Returns <B>NULL</B> if no results found.
117: * @throws Exception NotImplementedException if not implemented.
118: */
119: List getTCLogicalNames(String resourceid, TCType type)
120: throws Exception;
121:
122: /**
123: * Get the list of Profiles associated with a particular logical transformation.
124: * @param namespace String The namespace of the transformation to search for.
125: * @param name String The name of the transformation to search for.
126: * @param version String The version of the transformation to search for.
127: * @return List Returns a list of Profile Objects containing profiles assocaited with the transformation.
128: * Returns <B>NULL</B> if no profiles found.
129: * @throws Exception NotImplementedException if not implemented.
130: * @see org.griphyn.cPlanner.classes.Profile
131: */
132: List getTCLfnProfiles(String namespace, String name, String version)
133: throws Exception;
134:
135: /**
136: * Get the list of Profiles associated with a particular physical transformation.
137: * @param pfn The physical file name to search the transformation by.
138: * @param resourceid String The id of the resource on which you want to search.
139: * @param type TCType The type of the transformation to search for. <br>
140: * (Enumerated type includes source, binary, dynamic-binary, pacman, installed)<br>
141: * @throws Exception NotImplementedException if not implemented.
142: * @return List Returns a list of Profile Objects containing profiles assocaited with the transformation.
143: * Returns <B>NULL</B> if no profiless found.
144: * @see org.griphyn.cPlanner.classes.Profile
145: */
146: List getTCPfnProfiles(String pfn, String resourceid, TCType type)
147: throws Exception;
148:
149: /**
150: * List all the contents of the TC
151: *
152: * @return List Returns a List of TransformationCatalogEntry objects.
153: * @throws Exception
154: */
155: List getTC() throws Exception;
156:
157: /**
158: * ADDITIONS
159: */
160:
161: /**
162: * Add multiple TCEntries to the Catalog.
163: * @param tcentry List Takes a list of TransformationCatalogEntry objects as input
164: * @throws Exception
165: * @return boolean Return true if succesful, false if error. Exception is thrown when error occurs.
166: * @see org.griphyn.common.catalog.TransformationCatalogEntry
167: */
168: boolean addTCEntry(List tcentry) throws Exception;
169:
170: /**
171: * Add single TCEntry to the Catalog.
172: * @param tcentry Takes a single TransformationCatalogEntry object as input
173: * @throws Exception
174: * @return boolean Return true if succesful, false if error. Exception is thrown when error occurs.
175: * @see org.griphyn.common.catalog.TransformationCatalogEntry
176: */
177: boolean addTCEntry(TransformationCatalogEntry tcentry)
178: throws Exception;
179:
180: /**
181: * Add single TCEntry object temporarily to the in memory Catalog.
182: * This is a hack to get around for adding soft state entries to the TC
183: * @param tcentry Takes a single TransformationCatalogEntry object as input
184: * @param write boolean enable write commits to backed catalog or not.
185: * @throws Exception
186: * @return boolean Return true if succesful, false if error. Exception is thrown when error occurs.
187: * @see org.griphyn.common.catalog.TransformationCatalogEntry
188: */
189: boolean addTCEntry(TransformationCatalogEntry tcentry, boolean write)
190: throws Exception;
191:
192: /**
193: * Add an single entry into the transformation catalog.
194: *
195: * @param namespace String The namespace of the transformation to be added (Can be null)
196: * @param name String The name of the transformation to be added.
197: * @param version String The version of the transformation to be added. (Can be null)
198: * @param physicalname String The physical name/location of the transformation to be added.
199: * @param type TCType The type of the physical transformation.
200: * @param resourceid String The resource location id where the transformation is located.
201: * @param lfnprofiles List The List of Profile objects associated with a Logical Transformation. (can be null)
202: * @param pfnprofiles List The List of Profile objects associated with a Physical Transformation. (can be null)
203: * @param sysinfo SysInfo The System information associated with a physical transformation.
204: * @throws Exception
205: * @return boolean Returns true if succesfully added, returns false if error and throws exception.
206: * @see org.griphyn.common.catalog.TransformationCatalogEntry
207: * @see org.griphyn.common.classes.SysInfo
208: * @see org.griphyn.cPlanner.classes.Profile
209: */
210: boolean addTCEntry(String namespace, String name, String version,
211: String physicalname, TCType type, String resourceid,
212: List lfnprofiles, List pfnprofiles, SysInfo sysinfo)
213: throws Exception;
214:
215: /**
216: *Add additional profile to a logical transformation .
217: * @param namespace String The nsamespace of the transformation to be added. (can be null)
218: * @param name String The name of the transformation to be added.
219: * @param version String The version of the transformation to be added. (can be null)
220: * @param profiles List The List of Profile objects that are to be added to the transformation.
221: * @return boolean Returns true if success, false if error.
222: * @throws Exception
223: * @see org.griphyn.cPlanner.classes.Profile
224: */
225: boolean addTCLfnProfile(String namespace, String name,
226: String version, List profiles) throws Exception;
227:
228: /**
229: * Add additional profile to a physical transformation.
230: * @param pfn String The physical name of the transformation
231: * @param type TCType The type of transformation that the profile is associated with.
232: * @param resourcename String The resource on which the physical transformation exists
233: * @param profiles List The List of Profile objects that are to be added to the transformation.
234: * @return boolean Returns true for success, false for error.
235: * @throws Exception
236: * @see org.griphyn.cPlanner.classes.Profile
237: */
238: boolean addTCPfnProfile(String pfn, TCType type,
239: String resourcename, List profiles) throws Exception;
240:
241: /**
242: * DELETIONS
243: */
244:
245: /**
246: * Delete all entries in the transformation catalog for a give logical tranformation and/or on a resource and/or of
247: * a particular type
248: * @param namespace String The namespace of the transformation to be added. (can be null)
249: * @param name String The name of the transformation to be added.
250: * @param version String The version of the transformation to be added. ( can be null)
251: * @param resourceid String The resource id for which the transformation is to be deleted.
252: * If <B>NULL</B> then transformation on all resource are deleted
253: * @param type TCType The type of the transformation. If <B>NULL</B> then all types are deleted for the transformation.
254: * @throws Exception
255: * @return boolean Returns true if success , false if there is any error.
256: * @see org.griphyn.common.classes.TCType
257: */
258: boolean deleteTCbyLogicalName(String namespace, String name,
259: String version, String resourceid, TCType type)
260: throws Exception;
261:
262: /**
263: * Delete all entries in the transformation catalog for pair of logical and physical transformation.
264: * @param physicalname String The physical name of the transformation
265: * @param namespace String The namespace assocaited in the logical name of the transformation.
266: * @param name String The name of the logical transformation.
267: * @param version String The version number of the logical transformation.
268: * @param resourceid String The resource on which the transformation is to be deleted.
269: * If <B>NULL</B> then it searches all the resource id.
270: * @param type TCType The type of transformation. If <B>NULL</B> then it search and deletes entries for all types.
271: * @throws Exception
272: * @return boolean Returns true if sucess, false if any error occurs.
273: * @see org.griphyn.common.classes.TCType
274: */
275: boolean deleteTCbyPhysicalName(String physicalname,
276: String namespace, String name, String version,
277: String resourceid, TCType type) throws Exception;
278:
279: /**
280: * Delete a paricular type of transformation, and/or on a particular resource
281: * @param type TCType The type of the transformation
282: * @param resourceid String The resource on which the transformation exists.
283: * If <B>NULL</B> then that type of transformation is deleted from all the resources.
284: * @throws Exception
285: * @return boolean Returns true if success, false if any error occurs.
286: * @see org.griphyn.common.classes.TCType
287: */
288: boolean deleteTCbyType(TCType type, String resourceid)
289: throws Exception;
290:
291: /**
292: * Delete all entries on a particular resource from the transformation catalog.
293: * @param resourceid String The resource which you want to remove.
294: * @throws Exception
295: * @return boolean Returns true if successm false if any error occurs.
296: */
297: boolean deleteTCbyResourceId(String resourceid) throws Exception;
298:
299: /**
300: * Deletes entries from the catalog which have a particular system information.
301: * @param sysinfo SysInfo The System Information by which you want to delete
302: * @return boolean Returns true for success, false if any error occurs.
303: * @see org.griphyn.common.classes.SysInfo
304: * @throws Exception
305: */
306: boolean deleteTCbySysInfo(SysInfo sysinfo) throws Exception;
307:
308: /**
309: * Deletes the entire transformation catalog. CLEAN............. USE WITH CAUTION.
310: * @return boolean Returns true if delete succeeds, false if any error occurs.
311: * @throws Exception
312: */
313: boolean deleteTC() throws Exception;
314:
315: /**
316: * Delete a list of profiles or all the profiles associated with a pfn on a resource and of a type.
317: * @param physicalname String The physical name of the transformation.
318: * @param type TCType The type of the transformation.
319: * @param resourceid String The resource of the transformation.
320: * @param profiles List The list of profiles to be deleted. If <B>NULL</B> then all profiles for that pfn+resource+type are deleted.
321: * @return boolean Returns true if success, false if any error occurs.
322: * @see org.griphyn.cPlanner.classes.Profile
323: * @throws Exception
324: */
325: boolean deleteTCPfnProfile(String physicalname, TCType type,
326: String resourceid, List profiles) throws Exception;
327:
328: /**
329: * Delete a list of profiles or all the profiles associated with a logical transformation.
330: * @param namespace String The namespace of the logical transformation.
331: * @param name String The name of the logical transformation.
332: * @param version String The version of the logical transformation.
333: * @param profiles List The List of profiles to be deleted. If <B>NULL</B> then all profiles for the logical transformation are deleted.
334: * @return boolean Returns true if success, false if any error occurs.
335: * @see org.griphyn.cPlanner.classes.Profile
336: * @throws Exception
337: */
338: boolean deleteTCLfnProfile(String namespace, String name,
339: String version, List profiles) throws Exception;
340:
341: /**
342: * Returns the TC implementation being used
343: * @return String
344: */
345: String getTCMode();
346:
347: }
|