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:
016: package org.griphyn.cPlanner.visualize;
017:
018: import org.griphyn.vdl.invocation.Data;
019: import org.griphyn.vdl.invocation.Job;
020: import org.griphyn.vdl.invocation.StatInfo;
021:
022: import java.util.List;
023: import java.util.Map;
024:
025: /**
026: * This callback interface has methods to handle the data sections
027: * for stdout, stderr and stdin.
028: *
029: * @author Karan Vahi vahi@isi.edu
030: * @version $Revision: 50 $
031: */
032: public interface Callback {
033:
034: /**
035: * The version of the API.
036: */
037: public static final String VERSION = "1.3";
038:
039: /**
040: * Initializes the callback.
041: *
042: * @param directory the directory where all the files reside.
043: * @param useStatInfo boolean indicating whether to use stat info or not.
044: */
045: public void initialize(String directory, boolean useStatInfo);
046:
047: /**
048: * Callback for the starting of an invocation record.
049: *
050: * @param job the job/file being parsed.
051: * @param resource the site id where the job was executed.
052: */
053: public void cbInvocationStart(String job, String resource);
054:
055: /**
056: * Callback function for the data section of stdin. Since the jobs
057: * ( setup, prejob, main, postjob, cleanup)
058: * do not have separate stdout etc, all are passed.
059: *
060: * @param jobs all the jobs specified in the kickstart record.
061: * @param data the data contents as String.
062: *
063: */
064: public void cbStdIN(List jobs, String data);
065:
066: /**
067: * Callback function for the data section of stdout. Since the jobs
068: * ( setup, prejob, main, postjob, cleanup)
069: * do not have separate stdout etc, all are passed.
070: *
071: * @param jobs all the jobs specified in the kickstart record.
072: * @param data the data contents as String.
073: *
074: */
075: public void cbStdOut(List jobs, String data);
076:
077: /**
078: * Callback function for the data section of stderr. Since the jobs
079: * ( setup, prejob, main, postjob, cleanup)
080: * do not have separate stdout etc, all are passed.
081: *
082: * @param jobs all the jobs specified in the kickstart record.
083: * @param data the data contents as String.
084: *
085: */
086: public void cbStdERR(List jobs, String data);
087:
088: /**
089: * Callback function for when stat information for an input file is
090: * encountered
091: *
092: * @param filename the name of the file.
093: * @param info the <code>StatInfo</code> about the file.
094: *
095: */
096: public void cbInputFile(String filename, StatInfo info);
097:
098: /**
099: * Callback function for when stat information for an output file is
100: * encountered
101: *
102: * @param filename the name of the file.
103: * @param info the <code>StatInfo</code> about the file.
104: *
105: */
106: public void cbOutputFile(String filename, StatInfo info);
107:
108: /**
109: * Callback signalling that an invocation record has been parsed.
110: *
111: */
112: public void cbInvocationEnd();
113:
114: /**
115: * Callback signalling that we are done with the parsing of the files.
116: */
117: public void done();
118:
119: /**
120: * Returns the object constructed.
121: *
122: * @return the <code>Object</code> constructed.
123: */
124: public Object getConstructedObject();
125: }
|