}
public String getJobOutputs(String xml) throws IOException {
//parse request:
OutputRequestMessage req;
try {
Element rootElem = serviceUtil.parseXML(xml).getRootElement();
req = serializers.getOutputRequestSerializer().readRequest(rootElem);
}
catch(Exception e) {
logger.error("Error in JobManagerService.getJobOutputs()", e);
return serviceUtil.writeFault(e);
}
//process:
try {
//get serializer:
RunningJobInfo info = jobInfoManager.getJobInfo(req.getJobId());
String taskId = info.getTaskId();
JobManager jobManager = getJobManager();
Map config = new HashMap();
config.putAll(req.getParameters()); //do first (so user can't overwrite following params)
config.put("JOB_MANAGER", jobManager);
config.put("JOB_MANAGER_SERVICE", this);
config.put("JOB_ID", req.getJobId());
config.put("TASK_ID", taskId);
config.put("WORKING_DIRECTORY", info.getWorkingDirectory());
JDOMSerializer paramSerializer = serializers
.getTaskSerializerSet(jobManager, taskId)
.getOutputParameterSerializer(config);
//get outputs:
Map outputs = jobManager.getJobOutputs(req.getJobId());
Element elem = new Element("outputs");
paramSerializer.write(outputs, elem);
return serviceUtil.writeXML(elem);
}
catch (UnknownJobException e) {
logger.warn("Unknown job in JobManagerService.getJobOutputs(): " + req.getJobId());
return serviceUtil.writeFault(e);
}
catch (Exception e) {
logger.error("Error in JobManagerService.getJobOutputs()", e);
return serviceUtil.writeFault(e);