X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Frest%2FRestJobThread.java;h=c8efcda78938399afabf52d42cdda90ddc3278f8;hb=a9177efb4097815d9a8031aa22700c61a7d6260a;hp=cbbfd07ce1810d45249833d63b093a11fce6b7c0;hpb=838e4f91d4a53dd315640dbc9ff6ef7a815ee576;p=jalview.git
diff --git a/src/jalview/ws/rest/RestJobThread.java b/src/jalview/ws/rest/RestJobThread.java
index cbbfd07..c8efcda 100644
--- a/src/jalview/ws/rest/RestJobThread.java
+++ b/src/jalview/ws/rest/RestJobThread.java
@@ -1,6 +1,6 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
@@ -20,13 +20,15 @@
*/
package jalview.ws.rest;
-import jalview.bin.Cache;
+import java.util.Locale;
+
+import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentOrder;
import jalview.datamodel.Annotation;
-import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.HiddenColumns;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
@@ -90,8 +92,8 @@ public class RestJobThread extends AWSThread
{
jobs = new RestJob[1];
jobs[0] = new RestJob(0, this,
- restClient._input.getVisibleAlignment(restClient.service
- .getGapCharacter()),
+ restClient._input.getVisibleAlignment(
+ restClient.service.getGapCharacter()),
restClient._input.getVisibleContigs());
// need a function to get a range on a view/alignment and return both
// annotation, groups and selection subsetted to just that region.
@@ -101,8 +103,8 @@ public class RestJobThread extends AWSThread
{
int[] viscontig = restClient._input.getVisibleContigs();
AlignmentI[] viscontigals = restClient._input
- .getVisibleContigAlignments(restClient.service
- .getGapCharacter());
+ .getVisibleContigAlignments(
+ restClient.service.getGapCharacter());
if (viscontigals != null && viscontigals.length > 0)
{
jobs = new RestJob[viscontigals.length];
@@ -173,9 +175,13 @@ public class RestJobThread extends AWSThread
private String getStage(Stage stg)
{
if (stg == Stage.SUBMIT)
+ {
return "submitting ";
+ }
if (stg == Stage.POLL)
+ {
return "checking status of ";
+ }
return (" being confused about ");
}
@@ -229,8 +235,8 @@ public class RestJobThread extends AWSThread
{
if (input.getValue().validFor(rj))
{
- postentity.addPart(input.getKey(), input.getValue()
- .formatForInput(rj));
+ postentity.addPart(input.getKey(),
+ input.getValue().formatForInput(rj));
}
else
{
@@ -262,7 +268,7 @@ public class RestJobThread extends AWSThread
+ "
See Console output for details.";
rj.setAllowedServerExceptions(0);// unrecoverable;
rj.error = true;
- Cache.log.fatal("Unexpected REST Job " + getStage(stg)
+ Console.fatal("Unexpected REST Job " + getStage(stg)
+ "exception for URL " + rj.rsd.postUrl);
throw (he);
} catch (IOException e)
@@ -271,7 +277,7 @@ public class RestJobThread extends AWSThread
+ "Job.
Problematic url was " + request.getURI()
+ "
See Console output for details.";
- Cache.log.warn("IO Exception for REST Job " + getStage(stg)
+ Console.warn("IO Exception for REST Job " + getStage(stg)
+ "exception for URL " + rj.rsd.postUrl);
throw (e);
@@ -280,15 +286,12 @@ public class RestJobThread extends AWSThread
{
case 200:
rj.running = false;
- Cache.log.debug("Processing result set.");
+ Console.debug("Processing result set.");
processResultSet(rj, response, request);
break;
case 202:
rj.statMessage = "
Job submitted successfully. Results available at this URL:\n"
- + ""
- + rj.getJobId()
+ + "" + rj.getJobId()
+ "
";
rj.running = true;
break;
@@ -301,11 +304,9 @@ public class RestJobThread extends AWSThread
{
if (loc.length > 1)
{
- Cache.log
- .warn("Ignoring additional "
- + (loc.length - 1)
- + " location(s) provided in response header ( next one is '"
- + loc[1].getValue() + "' )");
+ Console.warn("Ignoring additional " + (loc.length - 1)
+ + " location(s) provided in response header ( next one is '"
+ + loc[1].getValue() + "' )");
}
rj.setJobId(loc[0].getValue());
rj.setSubmitted(true);
@@ -319,13 +320,13 @@ public class RestJobThread extends AWSThread
rj.setSubjobComplete(true);
rj.error = true;
rj.running = false;
- completeStatus(rj, response, "" + getStage(stg)
- + "failed. Reason below:\n");
+ completeStatus(rj, response,
+ "" + getStage(stg) + "failed. Reason below:\n");
break;
default:
// Some other response. Probably need to pop up the content in a window.
// TODO: deal with all other HTTP response codes from server.
- Cache.log.warn("Unhandled response status when " + getStage(stg)
+ Console.warn("Unhandled response status when " + getStage(stg)
+ "for " + postUrl + ": " + response.getStatusLine());
rj.error = true;
rj.setAllowedServerExceptions(0);
@@ -333,20 +334,13 @@ public class RestJobThread extends AWSThread
rj.setSubmitted(true);
try
{
- completeStatus(
- rj,
- response,
- ""
- + getStage(stg)
- + " resulted in an unexpected server response.
Url concerned was "
- + request.getURI()
- + "
Filtered response content below:
");
+ completeStatus(rj, response, "" + getStage(stg)
+ + " resulted in an unexpected server response.
Url concerned was " + request.getURI()
+ + "
Filtered response content below:
");
} catch (IOException e)
{
- Cache.log.debug("IOException when consuming unhandled response",
- e);
+ Console.debug("IOException when consuming unhandled response", e);
}
;
}
@@ -408,7 +402,7 @@ public class RestJobThread extends AWSThread
*/
String f;
StringBuffer content = new StringBuffer(f = EntityUtils.toString(en));
- f = f.toLowerCase();
+ f = f.toLowerCase(Locale.ROOT);
int body = f.indexOf("