X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Frest%2FRestJobThread.java;h=eff38fbad494b01ee97d92cf421a11eac1b55dfa;hb=3459a8a691cb22508d7067f240b7254e588e77d3;hp=acb7904a002390587dc5c9e6c21c000f1b3508bb;hpb=f4766a7bbcfae845fc95923b01fa14ff83d589ff;p=jalview.git diff --git a/src/jalview/ws/rest/RestJobThread.java b/src/jalview/ws/rest/RestJobThread.java index acb7904..eff38fb 100644 --- a/src/jalview/ws/rest/RestJobThread.java +++ b/src/jalview/ws/rest/RestJobThread.java @@ -20,7 +20,9 @@ */ 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; @@ -266,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) @@ -275,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); @@ -284,7 +286,7 @@ 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: @@ -302,7 +304,7 @@ public class RestJobThread extends AWSThread { if (loc.length > 1) { - Cache.log.warn("Ignoring additional " + (loc.length - 1) + Console.warn("Ignoring additional " + (loc.length - 1) + " location(s) provided in response header ( next one is '" + loc[1].getValue() + "' )"); } @@ -324,7 +326,7 @@ public class RestJobThread extends AWSThread 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); @@ -338,8 +340,7 @@ public class RestJobThread extends AWSThread + "
Filtered response content below:
"); } catch (IOException e) { - Cache.log.debug("IOException when consuming unhandled response", - e); + Console.debug("IOException when consuming unhandled response", e); } ; } @@ -401,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(" -1) { @@ -445,7 +446,7 @@ public class RestJobThread extends AWSThread { job.setSubjobComplete(true); job.setAllowedServerExceptions(-1); - Cache.log.error("Exception when trying to start Rest Job.", ex); + Console.error("Exception when trying to start Rest Job.", ex); } } @@ -454,7 +455,7 @@ public class RestJobThread extends AWSThread { // crazy users will see this message // TODO: finish this! and remove the message below! - Cache.log.warn("Rest job result parser is currently INCOMPLETE!"); + Console.warn("Rest job result parser is currently INCOMPLETE!"); int validres = 0; for (RestJob rj : (RestJob[]) jobs) { @@ -463,22 +464,22 @@ public class RestJobThread extends AWSThread String ln = null; try { - Cache.log.debug("Parsing data for job " + rj.getJobId()); + Console.debug("Parsing data for job " + rj.getJobId()); rj.parseResultSet(); if (rj.hasResults()) { validres++; } - Cache.log.debug("Finished parsing data for job " + rj.getJobId()); + Console.debug("Finished parsing data for job " + rj.getJobId()); } catch (Error ex) { - Cache.log.warn( + Console.warn( "Failed to finish parsing data for job " + rj.getJobId()); ex.printStackTrace(); } catch (Exception ex) { - Cache.log.warn( + Console.warn( "Failed to finish parsing data for job " + rj.getJobId()); ex.printStackTrace(); } finally @@ -754,7 +755,7 @@ public class RestJobThread extends AWSThread { // TODO: decide if multiple multiple alignments returned by // non-vseparable services are allowed. - Cache.log.warn( + Console.warn( "dealing with multiple alignment products returned by non-vertically separable service."); } // recover reference to last alignment created for this rest frame @@ -868,7 +869,7 @@ public class RestJobThread extends AWSThread } else { - Cache.log.warn( + Console.warn( "Couldn't resolve original sequence for new sequence."); } } @@ -946,7 +947,7 @@ public class RestJobThread extends AWSThread grass = groupNames.get(alan[nrj][an].groupRef.getName()); if (grass == null) { - Cache.log.error( + Console.error( "Couldn't relocate group referemce for group " + alan[nrj][an].groupRef.getName()); } @@ -997,7 +998,7 @@ public class RestJobThread extends AWSThread { // TODO: process each newick file, lifting over sequence refs to // current alignment, if necessary. - Cache.log.error( + Console.error( "Tree recovery from restjob not yet implemented."); } }