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.cPlanner.classes;
016:
017: /**
018: * This is a data class that stores the contents of the transfer job that
019: * transfers the data. Later on stdin etc, would be stored in it.
020: *
021: * @author Karan Vahi vahi@isi.edu
022: * @author Gaurang Mehta gmehta@isi.edu
023: * @version $Revision: 50 $
024: */
025: public class TransferJob extends SubInfo {
026:
027: /**
028: * The site at which the transfer jobs would have run, had it been running
029: * in a peer 2 peer transfer mode (non third party mode).
030: */
031: private String mNonTPTSite;
032:
033: /**
034: * The default constructor.
035: */
036: public TransferJob() {
037: super ();
038: mNonTPTSite = null;
039: }
040:
041: /**
042: * The overloaded construct that constructs a GRMS job by wrapping around
043: * the <code>SubInfo</code> job.
044: *
045: * @param job the original job description.
046: */
047: public TransferJob(SubInfo job) {
048: super (job);
049: mNonTPTSite = null;
050: }
051:
052: /**
053: * Returns the site at which the job would have run if the transfer job was
054: * being run in non third party mode. If the job is run in a non third party
055: * mode, the result should be the same as the site where the transfer job
056: * has been scheduled.
057: *
058: * @return the site at which the job would have run in a non third party mode,
059: * null if not set.
060: */
061: public String getNonThirdPartySite() {
062: return mNonTPTSite;
063: }
064:
065: /**
066: * Sets the non third party site for the transfer job. This is the site
067: * at which the job would have run if the transfer job was being run in
068: * non third party mode.
069: *
070: * @param site the name of the site
071: */
072: public void setNonThirdPartySite(String site) {
073: mNonTPTSite = site;
074: }
075:
076: /**
077: * Returns a textual description of the Transfer Job.
078: *
079: * @return the textual description.
080: */
081: public String toString() {
082: StringBuffer sb = new StringBuffer(super .toString());
083: sb.append("\n").append(" Non TPT Site :").append(
084: getNonThirdPartySite());
085:
086: return sb.toString();
087:
088: }
089:
090: /**
091: * Returns a new copy of the Object. The implementation is faulty.
092: * There is a shallow copy for the profiles. That is the clone retains
093: * references to the original object.
094: *
095: * @return Object
096: */
097: public Object clone() {
098: TransferJob newJob = new TransferJob((SubInfo) super.clone());
099: newJob.setNonThirdPartySite(this.getNonThirdPartySite());
100: return newJob;
101: }
102:
103: }
|