From 214e3ec5b769a9413b6301cb6514968d2e810928 Mon Sep 17 00:00:00 2001 From: Costantino Perciante Date: Fri, 20 Jan 2017 11:16:07 +0000 Subject: [PATCH] modified the JobStatusType names, and added the service name attribute to the RunningJob class git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/social-networking-library@141662 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../portal/databook/shared/JobStatusType.java | 22 ++++----- .../portal/databook/shared/RunningJob.java | 48 +++++++++++++++---- 2 files changed, 50 insertions(+), 20 deletions(-) diff --git a/src/main/java/org/gcube/portal/databook/shared/JobStatusType.java b/src/main/java/org/gcube/portal/databook/shared/JobStatusType.java index e528c79..126aaea 100644 --- a/src/main/java/org/gcube/portal/databook/shared/JobStatusType.java +++ b/src/main/java/org/gcube/portal/databook/shared/JobStatusType.java @@ -9,45 +9,45 @@ public enum JobStatusType { /** * The job has been cancelled. */ - STATUS_CANCELLED, + CANCELLED, /** * The job is in the process of being cancelled. */ - STATUS_CANCELLING, + CANCELLING, /** * The job has been deleted. */ - STATUS_DELETED, + DELETED, /** * The job is in the process of being deleted. */ - STATUS_DELETING,// + DELETING,// /** * The job is being executed by job processor. */ - STATUS_EXECUTING,// + EXECUTING,// /** * he job execution has failed. */ - STATUS_FAILED, + FAILED, /** * The job is new. */ - STATUS_NEW,// + NEW,// /** * The job is submitted for execution. */ - STATUS_SUBMITTED, + SUBMITTED, /** * The job has completed successfully */ - STATUS_SUCCEEDED, + SUCCEEDED, /** * The job execution has timed out. */ - STATUS_TIMED_OUT, + TIMED_OUT, /** * The job is waiting for available job processor. */ - STATUS_WAITING + WAITING } diff --git a/src/main/java/org/gcube/portal/databook/shared/RunningJob.java b/src/main/java/org/gcube/portal/databook/shared/RunningJob.java index 8cd1ea5..a69cd74 100644 --- a/src/main/java/org/gcube/portal/databook/shared/RunningJob.java +++ b/src/main/java/org/gcube/portal/databook/shared/RunningJob.java @@ -3,10 +3,9 @@ package org.gcube.portal.databook.shared; import java.io.Serializable; /** - * - * @author Massimiliano Assante, ISTI-CNR - * @version 0.1 Dec 2012 - * + * The RunningJob class. + * @author Massimiliano Assante, ISTI-CNR (massimiliano.assante@isti.cnr.it) + * @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it) */ @SuppressWarnings("serial") public class RunningJob implements Serializable { @@ -14,18 +13,37 @@ public class RunningJob implements Serializable { private String jobId; private String jobName; private JobStatusType status; + private String message; + private String serviceName; // i.e., Dataminer, SmartExecutor.. public RunningJob() { super(); } - public RunningJob(String jobId, String jobName, JobStatusType status) { + /** Buind a RunningJob object. + * @param jobId + * @param jobName + * @param status + * @param message + * @param serviceName + */ + public RunningJob(String jobId, String jobName, JobStatusType status, + String message, String serviceName) { super(); this.jobId = jobId; this.jobName = jobName; this.status = status; + this.message = message; + this.serviceName = serviceName; } - + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + public String getJobId() { return jobId; } @@ -44,10 +62,22 @@ public class RunningJob implements Serializable { public void setStatus(JobStatusType status) { this.status = status; } + + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + @Override public String toString() { - return "RunningJob [jobId=" + jobId + ", jobName=" + jobName - + ", status=" + status + "]"; + return "RunningJob [" + (jobId != null ? "jobId=" + jobId + ", " : "") + + (jobName != null ? "jobName=" + jobName + ", " : "") + + (status != null ? "status=" + status + ", " : "") + + (message != null ? "message=" + message + ", " : "") + + (serviceName != null ? "serviceName=" + serviceName : "") + + "]"; } - }