X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fjws1%2FSeqSearchWSThread.java;h=aeefcd1b12406585a79a6806478b3822420c5072;hb=a45774ee31d9f35d4eff46d54d7deab719afb092;hp=259a0b9786adc8726fd2da1e6a6f7a415eb52a34;hpb=add30afdc46a14e61ccf55881fa91b9ca9abfe80;p=jalview.git diff --git a/src/jalview/ws/jws1/SeqSearchWSThread.java b/src/jalview/ws/jws1/SeqSearchWSThread.java index 259a0b9..aeefcd1 100644 --- a/src/jalview/ws/jws1/SeqSearchWSThread.java +++ b/src/jalview/ws/jws1/SeqSearchWSThread.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5) - * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) + * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle * * This file is part of Jalview. * @@ -30,26 +30,6 @@ import jalview.ws.WSClientI; import vamsas.objects.simple.MsaResult; import vamsas.objects.simple.SeqSearchResult; -/** - *

- * Title: - *

- * - *

- * Description: - *

- * - *

- * Copyright: Copyright (c) 2004 - *

- * - *

- * Company: Dundee University - *

- * - * @author not attributable - * @version 1.0 - */ class SeqSearchWSThread extends JWS1Thread implements WSClientI { String dbs = null; @@ -124,8 +104,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI // for // any // subjob - SeqNames.put(newname, jalview.analysis.SeqsetUtils - .SeqCharacterHash(seqs[i])); + SeqNames.put(newname, + jalview.analysis.SeqsetUtils.SeqCharacterHash(seqs[i])); if (valid && seqs[i].getEnd() - seqs[i].getStart() > minlen - 1) { seqarray[n] = new vamsas.objects.simple.Sequence(); @@ -140,8 +120,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI if (seqs[i].getEnd() >= seqs[i].getStart()) { empty = (submitGaps) ? seqs[i].getSequenceAsString() : AlignSeq - .extractGaps(jalview.util.Comparison.GapChars, seqs[i] - .getSequenceAsString()); + .extractGaps(jalview.util.Comparison.GapChars, + seqs[i].getSequenceAsString()); } emptySeqs.add(new String[] { newname, empty }); @@ -374,9 +354,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI } if (njobs > 0) { - wsinfo - .setProgressName("region " + jobs[j].getJobnum(), - jobs[j].getJobnum()); + wsinfo.setProgressName("region " + jobs[j].getJobnum(), + jobs[j].getJobnum()); } wsinfo.setProgressText(jobs[j].getJobnum(), OutputHeader); } @@ -430,7 +409,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI cancelledMessage += ("\nProblems cancelling the job : Exception received...\n" + exc + "\n"); Cache.log.warn( - "Exception whilst cancelling " + jobs[job].getJobId(), exc); + "Exception whilst cancelling " + jobs[job].getJobId(), + exc); } wsInfo.setProgressText(jobs[job].getJobnum(), OutputHeader + cancelledMessage + "\n"); @@ -447,17 +427,16 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI { if (!jobComplete) { - wsInfo - .setProgressText(OutputHeader - + "Server cannot cancel this job because it has not been submitted properly. just close the window.\n"); + wsInfo.setProgressText(OutputHeader + + "Server cannot cancel this job because it has not been submitted properly. just close the window.\n"); } } } public void pollJob(AWsJob job) throws Exception { - ((SeqSearchWSJob) job).result = server - .getResult(((SeqSearchWSJob) job).getJobId()); + ((SeqSearchWSJob) job).result = server.getResult(((SeqSearchWSJob) job) + .getJobId()); } public void StartJob(AWsJob job) @@ -488,8 +467,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI } try { - vamsas.objects.simple.WsJobId jobsubmit = server.search(j.seqs - .getSeqs()[0], dbArg); + vamsas.objects.simple.WsJobId jobsubmit = server.search( + j.seqs.getSeqs()[0], dbArg); if ((jobsubmit != null) && (jobsubmit.getStatus() == 1)) { @@ -521,13 +500,13 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI + e.toString() + "\n"); j.setAllowedServerExceptions(0); wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR); - wsInfo.setStatus(j.getJobnum(), WebserviceInfo.STATE_STOPPED_SERVERERROR); - wsInfo - .appendProgressText( - j.getJobnum(), - "Failed to submit sequences for alignment.\n" - + "It is most likely that there is a problem with the server.\n" - + "Just close the window\n"); + wsInfo.setStatus(j.getJobnum(), + WebserviceInfo.STATE_STOPPED_SERVERERROR); + wsInfo.appendProgressText( + j.getJobnum(), + "Failed to submit sequences for alignment.\n" + + "It is most likely that there is a problem with the server.\n" + + "Just close the window\n"); // e.printStackTrace(); // TODO: JBPNote DEBUG } @@ -541,8 +520,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI for (int i = 0, j = seqs.length; i < j; i++) { - msa[i] = new jalview.datamodel.Sequence(seqs[i].getId(), seqs[i] - .getSeq()); + msa[i] = new jalview.datamodel.Sequence(seqs[i].getId(), + seqs[i].getSeq()); } return msa; @@ -561,7 +540,7 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI && jobs[j].hasResults()) { results++; - vamsas.objects.simple.Alignment valign = ((SeqSearchResult) ((SeqSearchWSJob)jobs[j]).result) + vamsas.objects.simple.Alignment valign = ((SeqSearchResult) ((SeqSearchWSJob) jobs[j]).result) .getAlignment(); if (valign != null) { @@ -570,7 +549,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI String[] lines = valign.getMethod(); for (int line = 0; line < lines.length; line++) { - wsInfo.appendProgressText(jobs[j].getJobnum(), lines[line] + "\n"); + wsInfo.appendProgressText(jobs[j].getJobnum(), lines[line] + + "\n"); } // JBPNote The returned files from a webservice could be // hidden behind icons in the monitor window that,