Package gri.tasks.remote.shared

Examples of gri.tasks.remote.shared.OutputRequestMessage


    }
   
    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);
View Full Code Here


   
    public Map getWorkflowOutputs(String wkflId, int jobIndex) throws UnknownWorkflowException, UnknownJobException {

        try {
            //request:
            OutputRequestMessage request = new OutputRequestMessage(wkflId)
            request.setParameter("JOB_INDEX", String.valueOf(jobIndex));
            if (allowLocalFileTransfers)
          request.setParameter("ALLOW_LOCAL_FILE_TRANSFERS", "TRUE");
           
            Element reqElem = new Element("retrieve");
            serializers.getOutputRequestSerializer().write(request, reqElem);
            String xmlRequest = serviceUtil.writeXML(reqElem);
           
View Full Code Here

   
    public Map getJobOutputs(String jobId) throws UnknownJobException {

        try {
            //request:
            OutputRequestMessage request = new OutputRequestMessage(jobId);
            if (allowLocalFileTransfers)
          request.setParameter("ALLOW_LOCAL_FILE_TRANSFERS", "TRUE");
           
            Element reqElem = new Element("retrieve");
            serializers.getOutputRequestSerializer().write(request, reqElem);
            String xmlRequest = serviceUtil.writeXML(reqElem);
           
View Full Code Here

     
      elem.addContent(paramsElem);
  }
    }
    public OutputRequestMessage readRequest(Element elem) throws IOException {
  OutputRequestMessage msg = new OutputRequestMessage(null);
 
  Element jobIdElem = elem.getChild("jobId");
  if (jobIdElem == null)
      throw new MissingElementException("jobId");
 
  msg.setJobId(jobIdElem.getText());
 
  Element paramsElem = elem.getChild("params");
  if (paramsElem != null) {
      Map params = (Map)paramSerializer.read(paramsElem);
      msg.setParameters(params);
  }
 
  return msg;
    }
View Full Code Here

          
    //TODO:
    public String getWorkflowOutputs(String xml) throws IOException {
       
  //parse request:
  OutputRequestMessage req;
  try {
      Element rootElem = xmlUtil.parseXML(xml).getRootElement();
      req = serializers.getOutputRequestSerializer().readRequest(rootElem);
  }
  catch(Exception e) {
      logger.error("Error in JobManagerService.getJobOutputs()", e);
            return xmlUtil.writeFault(e);
  }
 
  String wkflId = req.getJobId();     
  if (!req.hasParameter("JOB_INDEX"))
      throw new IOException("Invalid request: Missing required JOB_INDEX parameter");
  int jobIndex = Integer.parseInt(req.getParameter("JOB_INDEX"));
 
  //process:
  try {
     
      WorkflowManager wkflManager = getWorkflowManager();
      WorkflowInfo wkflInfo = wkflManager.getWorkflowInfo(wkflId);
      String taskId = wkflInfo.getJobInfo(jobIndex).getTaskId();
     
      RunningJobInfo jobInfo = jobInfoManager.getJobInfo(wkflId);
                
            //create serializer config:
            Map config = new HashMap();
           
            config.putAll(req.getParameters())//do first (so user can't overwrite following params)
           
            config.put("WORKFLOW_MANAGER", wkflManager);
            config.put("WORKFLOW_MANAGER_SERVICE", this);
            config.put("WORKFLOW_ID", req.getJobId());
            config.put("WORKFLOW_ID", wkflId);
            config.put("WORKING_DIRECTORY", jobInfo.getWorkingDirectory())//TODO: this is wrong
           
           
            JDOMSerializer paramSerializer = serializers
View Full Code Here

TOP

Related Classes of gri.tasks.remote.shared.OutputRequestMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.