home *** CD-ROM | disk | FTP | other *** search
- import java.io.ByteArrayOutputStream;
- import java.io.PrintStream;
- import java.util.Date;
- import java.util.Hashtable;
-
- public class JDPJob {
- JDPSubsystemMgr manager;
- JDPActiveJob activeJob;
- Hashtable info;
- StringBuffer jobLog;
- boolean jobChanged = false;
- public static final int CREATED = 1;
- public static final int QUEUED = 2;
- public static final int QUEUEDHELD = 3;
- public static final int ACTIVE = 4;
- public static final int ACTIVEHELD = 5;
- public static final int INCOMPLETE = 9;
- public static final int COMPLETE = 10;
-
- public JDPJob(JDPSubsystemMgr var1, String var2) {
- this.manager = var1;
- this.info = new Hashtable();
- this.jobLog = new StringBuffer();
- this.setJobName(var2);
- this.setSubsystem("");
- this.setEventType("");
- this.setJobStatus(1);
- this.setJobPriority(5);
- this.setJobQueuePriority(5);
- this.setJobNumber(var1.getNextJobNumber());
- this.setNotifyUser(-1);
- this.setNotifyVia("");
- this.setNotifyOn("");
- this.setLogEvent("F");
- this.setLogEventNow(false);
- this.setNotifyNow(false);
- this.setSkipJobLog(false);
- }
-
- public JDPJob(JDPSubsystemMgr var1, String var2, int var3) {
- this.manager = var1;
- this.info = new Hashtable();
- this.jobLog = new StringBuffer();
- this.setJobName(var2);
- this.setSubsystem("");
- this.setEventType("");
- this.setJobStatus(1);
- this.setJobPriority(5);
- this.setJobQueuePriority(5);
- this.setJobNumber(var3);
- this.setNotifyUser(-1);
- this.setNotifyVia("");
- this.setNotifyOn("");
- this.setLogEvent("F");
- this.setLogEventNow(false);
- this.setNotifyNow(false);
- this.setSkipJobLog(false);
- }
-
- public JDPActiveJob getActiveJob() {
- return this.activeJob;
- }
-
- public void setActiveJob(JDPActiveJob var1) {
- this.activeJob = var1;
- }
-
- public void setInstance(Object var1) {
- if (this.activeJob != null) {
- this.activeJob.thisInstance = var1;
- }
-
- }
-
- public Object getInstance() {
- return this.activeJob != null ? this.activeJob.thisInstance : null;
- }
-
- public String getJobName() {
- return (String)this.info.get("JobName");
- }
-
- public void setJobName(String var1) {
- this.info.put("JobName", var1);
- }
-
- public String getJDPSystem() {
- return (String)this.info.get("JDPSystem");
- }
-
- public void setJDPSystem(String var1) {
- this.info.put("JDPSystem", var1);
- }
-
- public int getJobNumber() {
- return (Integer)this.info.get("JobNumber");
- }
-
- void setJobNumber(int var1) {
- this.info.put("JobNumber", new Integer(var1));
- }
-
- public String getJobOwner() {
- return (String)this.info.get("JobOwner");
- }
-
- public void setJobOwner(String var1) {
- this.info.put("JobOwner", var1);
- }
-
- public String getJobQueue() {
- return (String)this.info.get("JobQueue");
- }
-
- public void setJobQueue(String var1) {
- this.info.put("JobQueue", var1);
- this.setJobChanged(true);
- }
-
- public String getSubsystem() {
- return (String)this.info.get("Subsystem");
- }
-
- public void setSubsystem(String var1) {
- this.info.put("Subsystem", var1);
- this.setJobChanged(true);
- }
-
- public String getJobLog() {
- return this.jobLog.toString();
- }
-
- public StringBuffer getJobLogBuffer() {
- return this.jobLog;
- }
-
- public void appendJobLog(String var1) {
- if (var1 == null) {
- var1 = "null";
- }
-
- this.jobLog.append(var1);
- if (!var1.endsWith("\r\n")) {
- this.jobLog.append("\r\n");
- }
-
- this.setJobChanged(true);
- }
-
- public void logException(Exception var1) {
- ByteArrayOutputStream var2 = new ByteArrayOutputStream();
- PrintStream var3 = new PrintStream(var2);
- ((Throwable)var1).printStackTrace(var3);
- this.appendJobLog(var2.toString());
- }
-
- public int getJobPriority() {
- return (Integer)this.info.get("JobPriority");
- }
-
- public void setJobPriority(int var1) {
- this.info.put("JobPriority", new Integer(var1));
- this.setJobChanged(true);
- }
-
- public int getJobQueuePriority() {
- return this.info.get("JobQueuePriority") == null ? 5 : (Integer)this.info.get("JobQueuePriority");
- }
-
- public void setJobQueuePriority(int var1) {
- this.info.put("JobQueuePriority", new Integer(var1));
- this.setJobChanged(true);
- }
-
- public String getEventType() {
- return (String)this.info.get("EventType");
- }
-
- public void setEventType(String var1) {
- this.info.put("EventType", var1);
- }
-
- public String getObjectType() {
- return (String)this.info.get("ObjectType");
- }
-
- public void setObjectType(String var1) {
- this.info.put("ObjectType", var1);
- }
-
- public String getObject() {
- return (String)this.info.get("Object");
- }
-
- public void setObject(String var1) {
- this.info.put("Object", var1);
- }
-
- public String getObjectParm() {
- return (String)this.info.get("ObjectParm");
- }
-
- public void setObjectParm(String var1) {
- this.info.put("ObjectParm", var1);
- }
-
- public String getObjectConstructor() {
- return (String)this.info.get("ObjectConstructor");
- }
-
- public void setObjectConstructor(String var1) {
- this.info.put("ObjectConstructor", var1);
- }
-
- public int getNotifyUser() {
- return this.info.get("NotifyUser") == null ? -1 : (Integer)this.info.get("NotifyUser");
- }
-
- public void setNotifyUser(int var1) {
- this.info.put("NotifyUser", new Integer(var1));
- }
-
- public String getNotifyVia() {
- return (String)this.info.get("NotifyVia");
- }
-
- public void setNotifyVia(String var1) {
- this.info.put("NotifyVia", var1);
- }
-
- public String getNotifyOn() {
- return (String)this.info.get("NotifyOn");
- }
-
- public void setNotifyOn(String var1) {
- this.info.put("NotifyOn", var1);
- }
-
- public boolean getNotifyNow() {
- return (Boolean)this.info.get("NotifyNow");
- }
-
- public void setNotifyNow(boolean var1) {
- this.info.put("NotifyNow", new Boolean(var1));
- }
-
- public String getLogEvent() {
- return (String)this.info.get("LogEvent");
- }
-
- public void setLogEvent(String var1) {
- this.info.put("LogEvent", var1);
- }
-
- public boolean getLogEventNow() {
- return (Boolean)this.info.get("LogEventNow");
- }
-
- public void setSkipJobLog(boolean var1) {
- this.info.put("SkipJobLog", new Boolean(var1));
- }
-
- public boolean getSkipJobLog() {
- return (Boolean)this.info.get("SkipJobLog");
- }
-
- public void setLogEventNow(boolean var1) {
- this.info.put("LogEventNow", new Boolean(var1));
- }
-
- public Date getQueuedDate() {
- return (Date)this.info.get("QueuedDate");
- }
-
- public void setQueuedDate(Date var1) {
- this.info.put("QueuedDate", var1);
- }
-
- public long getQueuedTime() {
- return this.info.get("QueuedTime") == null ? 0L : (Long)this.info.get("QueuedTime");
- }
-
- public void setQueuedTime(long var1) {
- this.info.put("QueuedTime", new Long(var1));
- }
-
- public Date getStartDate() {
- return (Date)this.info.get("StartDate");
- }
-
- public void setStartDate(Date var1) {
- this.info.put("StartDate", var1);
- }
-
- public long getStartTime() {
- return this.info.get("StartTime") == null ? 0L : (Long)this.info.get("StartTime");
- }
-
- public void setStartTime(long var1) {
- this.info.put("StartTime", new Long(var1));
- }
-
- public Date getEndDate() {
- return (Date)this.info.get("EndDate");
- }
-
- public void setEndDate(Date var1) {
- this.info.put("EndDate", var1);
- }
-
- public long getEndTime() {
- return this.info.get("EndTime") == null ? 0L : (Long)this.info.get("EndTime");
- }
-
- public void setEndTime(long var1) {
- this.info.put("EndTime", new Long(var1));
- }
-
- public boolean getJobChanged() {
- return this.jobChanged;
- }
-
- void setJobChanged(boolean var1) {
- this.jobChanged = var1;
- if (this.jobChanged) {
- this.manager.requestUpdate();
- }
-
- }
-
- public int getJobStatus() {
- return this.info.get("JobStatus") == null ? 1 : (Integer)this.info.get("JobStatus");
- }
-
- boolean setJobStatus(int var1) {
- if (var1 >= 1 && var1 <= 10) {
- if (var1 == 1) {
- this.info.put("JobStatus", new Integer(var1));
- this.setJobChanged(true);
- return true;
- } else {
- int var2 = this.getJobStatus();
- if (var2 != 1 || var1 != 2 && var1 != 3 && var1 != 9) {
- if (var2 != 2 || var1 != 1 && var1 != 3 && var1 != 4 && var1 != 10 && var1 != 9) {
- if (var2 != 3 || var1 != 2 && var1 != 10 && var1 != 9) {
- if (var2 != 4 || var1 != 5 && var1 != 10 && var1 != 9) {
- if (var2 != 5 || var1 != 4 && var1 != 10) {
- return false;
- } else {
- this.info.put("JobStatus", new Integer(var1));
- this.setJobChanged(true);
- return true;
- }
- } else {
- this.info.put("JobStatus", new Integer(var1));
- this.setJobChanged(true);
- return true;
- }
- } else {
- this.info.put("JobStatus", new Integer(var1));
- this.setJobChanged(true);
- return true;
- }
- } else {
- this.info.put("JobStatus", new Integer(var1));
- this.setJobChanged(true);
- return true;
- }
- } else {
- this.info.put("JobStatus", new Integer(var1));
- this.setJobChanged(true);
- return true;
- }
- }
- } else {
- return false;
- }
- }
- }
-