00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030  
00031 package org.objectweb.proactive.scheduler;
00032 
00033 import java.io.Serializable;
00034 import java.util.Date;
00035 import java.util.Vector;
00036 
00037 import org.objectweb.proactive.Job;
00038 import org.objectweb.proactive.core.UniqueID;
00039 
00040 
00063 public class GenericJob implements Serializable, Job {
00064     private String className;
00065     private int priority;
00066     private int userId;
00067     private Date submitDate;
00068     private Vector mainParameters;
00069 
00070     
00071     private int ressourceNb;
00072 
00073     
00074     private int estimatedTime;
00075     private String xmlName;
00076     private String xmlFullPath;
00077 
00078     
00079     private UniqueID jobId;
00080     private String jvmParameters;
00081     private String jobStatus;
00082     private String[] classPath;
00083     private int minRessourceNb = 0;
00084 
00085     
00086     public GenericJob() {
00087         
00088         this.setClassName(null);
00089         this.setPriority(0);
00090         this.setUserId(0);
00091         this.setSubmitDate(new Date());
00092         this.setMainParameters(new Vector());
00093         this.setRessourceNb(1);
00094         this.setEstimatedTime(0);
00095         this.jobId = new UniqueID();
00096         this.classPath = null;
00097     }
00098 
00099     
00100 
00101 
00102 
00103 
00104 
00105 
00106 
00107 
00108 
00109 
00110 
00111 
00112 
00113 
00114 
00115 
00116 
00117 
00118 
00119 
00120 
00121 
00122 
00123 
00124 
00125 
00126 
00127 
00128 
00129 
00130 
00131 
00132 
00133 
00134 
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142 
00143 
00144 
00145 
00146 
00147 
00148 
00149 
00150 
00151 
00152     public void setClassName(String className) {
00153         this.className = className;
00154     }
00155 
00156     public void setPriority(int priority) {
00157         this.priority = priority;
00158     }
00159 
00160     public void setUserId(int userId) {
00161         this.userId = userId;
00162     }
00163 
00164     public void setSubmitDate() {
00165         this.submitDate = new Date();
00166     }
00167 
00168     public void setSubmitDate(Date submitDate) {
00169         this.submitDate = submitDate;
00170     }
00171 
00172     public void setMainParameters(Vector mainParameters) {
00173         this.mainParameters = mainParameters;
00174     }
00175 
00180     public void addMainParameter(String mainParameter) {
00181         this.mainParameters.add(mainParameter);
00182     }
00183 
00184     
00185 
00186 
00187 
00188 
00189     public void setRessourceNb(int ressourceNb) {
00190         this.ressourceNb = ressourceNb;
00191     }
00192 
00193     
00194 
00195 
00196 
00197 
00198     public void setEstimatedTime(int estimatedTime) {
00199         this.estimatedTime = estimatedTime;
00200     }
00201 
00202     public String getClassName() {
00203         return this.className;
00204     }
00205 
00206     public int getPriority() {
00207         return this.priority;
00208     }
00209 
00210     public int getUserId() {
00211         return this.userId;
00212     }
00213 
00214     public Date getSubmitDate() {
00215         return this.submitDate;
00216     }
00217 
00218     public String[] getMainParameters() {
00219         String[] mainParameters = new String[this.mainParameters.size()];
00220 
00221         for (int i = 0; i < mainParameters.length; ++i) {
00222             mainParameters[i] = (String) this.mainParameters.elementAt(i);
00223         }
00224 
00225         return mainParameters;
00226     }
00227 
00228     
00229 
00230 
00231 
00232 
00233     public int getRessourceNb() {
00234         return this.ressourceNb;
00235     }
00236 
00237     
00238 
00239 
00240 
00241 
00242     public int getEstimatedTime() {
00243         return this.estimatedTime;
00244     }
00245 
00246     public String getJobID() {
00247         return this.jobId.toString();
00248     }
00249 
00250     public void setXMLDescriptorName(String XMLDescriptorName) {
00251         this.xmlName = XMLDescriptorName;
00252     }
00253 
00254     public String getXMLDescriptorName() {
00255         return this.xmlName;
00256     }
00257 
00258     public void setXMLFullPath(String XMLFullPath) {
00259         this.xmlFullPath = XMLFullPath;
00260     }
00261 
00262     public String getXMLFullPath() {
00263         return this.xmlFullPath;
00264     }
00265 
00266     public void setJVMParameters(String jvmParameters) {
00267         this.jvmParameters = jvmParameters;
00268     }
00269 
00270     public String getJVMParameters() {
00271         return this.jvmParameters;
00272     }
00273 
00274     public void setJobStatus(String jobStatus) {
00275         this.jobStatus = jobStatus;
00276     }
00277 
00278     public String getJobStatus() {
00279         return this.jobStatus;
00280     }
00281 
00282     public String[] getClassPath() {
00283         return this.classPath;
00284     }
00285 
00286     public void setClassPath(String[] classPath) {
00287         this.classPath = classPath;
00288     }
00289 
00290     public void setMinNbOfNodes(int nbOfNodes) {
00291         this.minRessourceNb = nbOfNodes;
00292     }
00293 
00294     public int getMinNbOfNodes() {
00295         return this.minRessourceNb;
00296     }
00297 }