01: /*
02: * This file or a portion of this file is licensed under the terms of
03: * the Globus Toolkit Public License, found in file GTPL, or at
04: * http://www.globus.org/toolkit/download/license.html. This notice must
05: * appear in redistributions of this file, with or without modification.
06: *
07: * Redistributions of this Software, with or without modification, must
08: * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
09: * some other similar material which is provided with the Software (if
10: * any).
11: *
12: * Copyright 1999-2004 University of Chicago and The University of
13: * Southern California. All rights reserved.
14: */
15: package org.griphyn.cPlanner.selector.transformation;
16:
17: import org.griphyn.cPlanner.selector.TransformationSelector;
18:
19: import org.griphyn.common.catalog.TransformationCatalogEntry;
20: import org.griphyn.common.classes.TCType;
21:
22: import java.util.ArrayList;
23: import java.util.Iterator;
24: import java.util.List;
25:
26: /**
27: * This implementation of the Selector select a transformation of type STATIC_BINARY and only on the submit site.
28: * @author Gaurang Mehta
29: * @version $Revision: 50 $
30: */
31: public class Submit extends TransformationSelector {
32:
33: /**
34: * This method returns a list of TransformationCatalogEntry objects of type
35: * STATIC_BINARY and only available on the Submit machine( "local" site).
36: *
37: * @param tcentries the original list of TransformationCatalogEntry objects
38: * on which the selector needs to run.
39: *
40: * @return List
41: */
42: public List getTCEntry(List tcentries) {
43: List results = null;
44: for (Iterator i = tcentries.iterator(); i.hasNext();) {
45: TransformationCatalogEntry tc = (TransformationCatalogEntry) i
46: .next();
47: if ((tc.getType().equals(TCType.STATIC_BINARY))
48: && (tc.getResourceId().equalsIgnoreCase("local"))) {
49: if (results == null) {
50: results = new ArrayList(5);
51: }
52: results.add(tc);
53: }
54: }
55: return results;
56:
57: }
58: }
|