X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fjws1%2FWSJob.java;fp=src%2Fjalview%2Fws%2Fjws1%2FWSJob.java;h=c2e1bf9318a268de4edf99663721994c8a7651b1;hb=add30afdc46a14e61ccf55881fa91b9ca9abfe80;hp=0000000000000000000000000000000000000000;hpb=9b2272a1679b87760b193ecc87f994d7f5141c75;p=jalview.git diff --git a/src/jalview/ws/jws1/WSJob.java b/src/jalview/ws/jws1/WSJob.java new file mode 100644 index 0000000..c2e1bf9 --- /dev/null +++ b/src/jalview/ws/jws1/WSJob.java @@ -0,0 +1,125 @@ +/** + * + */ +package jalview.ws.jws1; + +import jalview.ws.AWsJob; + +abstract class WSJob extends AWsJob +{ + /* (non-Javadoc) + * @see jalview.ws.AWsJob#clearResponse() + */ + @Override + public void clearResponse() + { + result = null; + } + + /* (non-Javadoc) + * @see jalview.ws.AWsJob#hasResponse() + */ + @Override + public boolean hasResponse() + { + return result!=null; + } + + /* (non-Javadoc) + * @see jalview.ws.AWsJob#hasStatus() + */ + @Override + public boolean hasStatus() + { + return result!=null && result.getStatus()!=null; + } + + /** + * The last result object returned by the service. + */ + vamsas.objects.simple.Result result; + + /** + * @return + * @see vamsas.objects.simple.Result#getStatus() + */ + public String getStatus() + { + return result==null ? null : result.getStatus(); + } + + public String getState() { + return result==null ? "NULL result" : ""+result.getState(); + } + /** + * @return + * @see vamsas.objects.simple.Result#isBroken() + */ + public boolean isBroken() + { + return result!=null && result.isBroken(); + } + + /** + * @return + * @see vamsas.objects.simple.Result#isFailed() + */ + public boolean isFailed() + { + return result!=null && result.isFailed(); + } + + /** + * @return + * @see vamsas.objects.simple.Result#isFinished() + */ + public boolean isFinished() + { + return result!=null && result.isFinished(); + } + + /** + * @return + * @see vamsas.objects.simple.Result#isInvalid() + */ + public boolean isInvalid() + { + return result!=null && result.isInvalid(); + } + + /** + * @return + * @see vamsas.objects.simple.Result#isJobFailed() + */ + public boolean isJobFailed() + { + return result!=null && result.isJobFailed(); + } + + /** + * @return + * @see vamsas.objects.simple.Result#isQueued() + */ + public boolean isQueued() + { + return result!=null && result.isQueued(); + } + + /** + * @return + * @see vamsas.objects.simple.Result#isRunning() + */ + public boolean isRunning() + { + return result!=null && result.isRunning(); + } + + /** + * @return + * @see vamsas.objects.simple.Result#isServerError() + */ + public boolean isServerError() + { + return result!=null && result.isServerError(); + } +} \ No newline at end of file