2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 package jalview.ws.jws2;
20 import compbio.metadata.JobStatus;
22 import jalview.ws.AWsJob;
25 * job status processing for JWS2 jobs.
30 public abstract class JWs2Job extends AWsJob
32 JobStatus status = null;
34 public void setjobStatus(JobStatus jobStatus)
43 * @see jalview.ws.AWsJob#clearResponse()
46 public void clearResponse()
54 * @see jalview.ws.AWsJob#getState()
57 public String getState()
59 return status == null ? ("Unknown") : status.toString();
65 * @see jalview.ws.AWsJob#hasResponse()
68 public boolean hasResponse()
70 // TODO Auto-generated method stub
71 return status != null;
75 * StringBuffer statusBuffer = null; (non-Javadoc)
77 * @see jalview.ws.AWsJob#getStatus()
79 * @Override public String getStatus() { return statusBuffer.toString(); }
82 * @see jalview.ws.AWsJob#hasStatus()
84 * @Override public boolean hasStatus() { return statusBuffer!=null; }
90 * @see jalview.ws.AWsJob#isBroken()
93 public boolean isBroken()
95 return status == null ? false : status.equals(status.UNDEFINED);
101 * @see jalview.ws.AWsJob#isFailed()
104 public boolean isFailed()
106 return status == null ? false : status.equals(status.FAILED);
112 * @see jalview.ws.AWsJob#isFinished()
115 public boolean isFinished()
117 return status == null ? false : status.equals(status.FINISHED);
123 * @see jalview.ws.AWsJob#isQueued()
126 public boolean isQueued()
128 return status == null ? false : status.equals(status.SUBMITTED)
129 || status.equals(status.PENDING);
135 * @see jalview.ws.AWsJob#isRunning()
138 public boolean isRunning()
140 // TODO Auto-generated method stub
141 return status != null
142 && (status.equals(status.RUNNING) || status
143 .equals(status.STARTED));
149 * @see jalview.ws.AWsJob#isServerError()
152 public boolean isServerError()
154 // server errors are raised as exceptions on the service method calls.
155 return status == null ? false : false; // status.equals(status.FAILED);