2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
3 * Copyright (C) 2010 J Procter, AM Waterhouse, 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.
29 public abstract class JWs2Job extends AWsJob
31 JobStatus status=null;
32 public void setjobStatus(JobStatus jobStatus)
39 * @see jalview.ws.AWsJob#clearResponse()
42 public void clearResponse()
48 * @see jalview.ws.AWsJob#getState()
51 public String getState()
53 return status==null ? ("Unknown") : status.toString();
56 * @see jalview.ws.AWsJob#hasResponse()
59 public boolean hasResponse()
61 // TODO Auto-generated method stub
65 StringBuffer statusBuffer = null;
67 * @see jalview.ws.AWsJob#getStatus()
70 public String getStatus()
72 return statusBuffer.toString();
75 * @see jalview.ws.AWsJob#hasStatus()
78 public boolean hasStatus()
80 return statusBuffer!=null;
85 * @see jalview.ws.AWsJob#isBroken()
88 public boolean isBroken()
90 return status==null ? false : status.equals(status.UNDEFINED);
94 * @see jalview.ws.AWsJob#isFailed()
97 public boolean isFailed()
99 return status==null ? false : status.equals(status.FAILED);
103 * @see jalview.ws.AWsJob#isFinished()
106 public boolean isFinished()
108 return status==null ? false : status.equals(status.FINISHED);
112 * @see jalview.ws.AWsJob#isQueued()
115 public boolean isQueued()
117 return status==null ? false : status.equals(status.SUBMITTED) || status.equals(status.PENDING);
121 * @see jalview.ws.AWsJob#isRunning()
124 public boolean isRunning()
126 // TODO Auto-generated method stub
127 return status!=null && (status.equals(status.RUNNING) || status.equals(status.STARTED));
131 * @see jalview.ws.AWsJob#isServerError()
134 public boolean isServerError()
136 // server errors are raised as exceptions on the service method calls.
137 return status==null ? false : false; // status.equals(status.FAILED);