X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Frest%2FRestJobThread.java;h=0895f0fff90431425ed8ef8bfca7817b69fa20d4;hb=d043ce47fc710d3eb2629ba926a8a7417bd67d8c;hp=cff127b6616c85227ce7eae1739b2dab02b593eb;hpb=49db0dff1da16c3355b43a41498c1fc93ef47e91;p=jalview.git
diff --git a/src/jalview/ws/rest/RestJobThread.java b/src/jalview/ws/rest/RestJobThread.java
index cff127b..0895f0f 100644
--- a/src/jalview/ws/rest/RestJobThread.java
+++ b/src/jalview/ws/rest/RestJobThread.java
@@ -22,7 +22,7 @@ package jalview.ws.rest;
import java.util.Locale;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
@@ -262,7 +262,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 +271,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,14 +280,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:
markJobAsRunning(rj);
break;
-
case 201:
// Created - redirect may be present. Fallthrough to 302
case 302:
@@ -302,7 +300,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);
@@ -316,8 +314,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);
}
;
}
@@ -370,8 +367,7 @@ public class RestJobThread extends AWSThread
{
if (loc.length > 1)
{
- Cache.log
- .warn("Ignoring additional "
+ Console.warn("Ignoring additional "
+ (loc.length - 1)
+ " location(s) provided in response header ( next one is '"
+ loc[1].getValue() + "' )");
@@ -381,7 +377,6 @@ public class RestJobThread extends AWSThread
}
}
}
-
/**
* job has completed. Something valid should be available from con
*
@@ -481,7 +476,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);
}
}
@@ -490,7 +485,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)
{
@@ -499,22 +494,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
@@ -611,12 +606,12 @@ public class RestJobThread extends AWSThread
/**
* alignment panels derived from each alignment set returned by service.
*/
- ArrayList destPanels = new ArrayList<>();
+ ArrayList destPanels = new ArrayList();
/**
* list of instructions for how to process each distinct alignment set
* returned by the job set
*/
- ArrayList resultDest = new ArrayList<>();
+ ArrayList resultDest = new ArrayList();
/**
* when false, zeroth pane is panel derived from input deta.
*/
@@ -635,9 +630,9 @@ public class RestJobThread extends AWSThread
boolean vsepjobs = restClient.service.isVseparable();
// total number of distinct alignment sets generated by job set.
int numAlSets = 0, als = 0;
- List destAls = new ArrayList<>();
- List destColsel = new ArrayList<>();
- List> trees = new ArrayList<>();
+ List destAls = new ArrayList();
+ List destColsel = new ArrayList();
+ List> trees = new ArrayList>();
do
{
@@ -696,7 +691,7 @@ public class RestJobThread extends AWSThread
if (alset.trees != null)
{
- trees.add(new ArrayList<>(alset.trees));
+ trees.add(new ArrayList(alset.trees));
}
else
{
@@ -724,8 +719,8 @@ public class RestJobThread extends AWSThread
*/
int vrestjob = 0;
// Destination alignments for all result data.
- ArrayList visgrps = new ArrayList<>();
- Hashtable groupNames = new Hashtable<>();
+ ArrayList visgrps = new ArrayList();
+ Hashtable groupNames = new Hashtable();
ArrayList visAlAn = null;
for (nvertsep = 0; nvertsep < nvertseps; nvertsep++)
{
@@ -790,7 +785,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
@@ -904,7 +899,7 @@ public class RestJobThread extends AWSThread
}
else
{
- Cache.log.warn(
+ Console.warn(
"Couldn't resolve original sequence for new sequence.");
}
}
@@ -982,14 +977,14 @@ 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());
}
}
if (visAlAn == null)
{
- visAlAn = new ArrayList<>();
+ visAlAn = new ArrayList();
}
AlignmentAnnotation visan = null;
for (AlignmentAnnotation v : visAlAn)
@@ -1033,7 +1028,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.");
}
}
@@ -1285,7 +1280,7 @@ public class RestJobThread extends AWSThread
*/
public boolean isValid()
{
- ArrayList _warnings = new ArrayList<>();
+ ArrayList _warnings = new ArrayList();
boolean validt = true;
if (jobs != null)
{