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.vdl.diagnozer;
16:
17: import java.util.*;
18: import java.io.*;
19:
20: /**
21: * Description of a job.
22: */
23: class JobInfos {
24: private Map m_jobs;
25: String m_id;
26:
27: public JobInfos(String id) {
28: m_jobs = new HashMap();
29: m_id = id;
30: }
31:
32: public void addJobInfo(JobInfo job, String key) {
33: m_jobs.put(key, job);
34: }
35:
36: public JobInfo getJobInfo(String key) {
37: return (JobInfo) m_jobs.get(key);
38: }
39:
40: public void dump(PrintWriter pw) {
41: try {
42: System.out
43: .println("****************************************************");
44: System.out.println("* " + m_id
45: + "'s record *");
46: System.out
47: .println("****************************************************");
48: pw.flush();
49: for (Iterator i = m_jobs.keySet().iterator(); i.hasNext();) {
50: String jid = (String) i.next();
51: ((JobInfo) m_jobs.get(jid)).dump(pw);
52: }
53: } catch (Exception e) {
54: e.printStackTrace();
55: }
56: }
57: }
|