2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.ws.jws2;
23 import jalview.ws.AWsJob;
25 import compbio.metadata.JobStatus;
28 * job status processing for JWS2 jobs.
33 public abstract class JWs2Job extends AWsJob
35 JobStatus status = null;
37 public void setjobStatus(JobStatus jobStatus)
46 * @see jalview.ws.AWsJob#clearResponse()
49 public void clearResponse()
57 * @see jalview.ws.AWsJob#getState()
60 public String getState()
62 return status == null ? ("Unknown") : status.toString();
68 * @see jalview.ws.AWsJob#hasResponse()
71 public boolean hasResponse()
73 // TODO Auto-generated method stub
74 return status != null;
78 * StringBuffer statusBuffer = null; (non-Javadoc)
80 * @see jalview.ws.AWsJob#getStatus()
82 * @Override public String getStatus() { return statusBuffer.toString(); }
85 * @see jalview.ws.AWsJob#hasStatus()
87 * @Override public boolean hasStatus() { return statusBuffer!=null; }
93 * @see jalview.ws.AWsJob#isBroken()
96 public boolean isBroken()
98 return status == null ? false : status.equals(status.UNDEFINED);
104 * @see jalview.ws.AWsJob#isFailed()
107 public boolean isFailed()
109 return status == null ? false : status.equals(status.FAILED);
115 * @see jalview.ws.AWsJob#isFinished()
118 public boolean isFinished()
120 return status == null ? false : status.equals(status.FINISHED);
126 * @see jalview.ws.AWsJob#isQueued()
129 public boolean isQueued()
131 return status == null ? false
132 : status.equals(status.SUBMITTED)
133 || status.equals(status.PENDING);
139 * @see jalview.ws.AWsJob#isRunning()
142 public boolean isRunning()
144 // TODO Auto-generated method stub
145 return status != null && (status.equals(status.RUNNING)
146 || status.equals(status.STARTED));
152 * @see jalview.ws.AWsJob#isServerError()
155 public boolean isServerError()
157 // server errors are raised as exceptions on the service method calls.
158 return status == null ? false : false; // status.equals(status.FAILED);