Package gri.tasks.remote.shared

Examples of gri.tasks.remote.shared.BasicResponseMessage


           
            RunningJobInfo jobInfo = new RunningJobInfo(jobKey, taskId, workDir);
            jobInfoManager.storeJobInfo(jobInfo);

            //response:
            BasicResponseMessage msg = new BasicResponseMessage("submitJob");
            msg.setResult("Success");
            msg.setInfo("Submitted Successfully");
            msg.setJobKey(jobKey);
            return serviceUtil.writeXML(msg);
           
        }
        catch(Exception e) {
            logger.error("Error in JobManagerService.submitJob()", e);
View Full Code Here


    public String killJob(String jobKey) throws IOException {
       
        try {
            getJobManager().killJob(jobKey);
           
            BasicResponseMessage msg = new BasicResponseMessage("killJob", jobKey);
            msg.setResult("Success");
            msg.setInfo("Job successfully terminated");
            return serviceUtil.writeXML(msg);
        }
        catch (UnknownJobException e) {
            logger.warn("Unknown job in JobManagerService.killJob(): " + jobKey);
            return serviceUtil.writeFault(e);
View Full Code Here

    }
                                                         
    public String getJobStatus(String jobKey) throws IOException {
       
        try {
            BasicResponseMessage msg = new BasicResponseMessage("getJobStatus", jobKey);
           
            int status = getJobManager().getJobStatus(jobKey);
            String textStatus = Util.writeJobStatus(status);
            msg.setResult(textStatus);
           
            return serviceUtil.writeXML(msg);
        }
        catch (UnknownJobException e) {
            logger.warn("Unknown job in JobManagerService.getJobStatus(): " + jobKey);
View Full Code Here

            //free job:
            jobInfoManager.freeJob(jobId);
            getJobManager().freeJob(jobId);
           
            //response:
            BasicResponseMessage msg = new BasicResponseMessage("freeJob", jobId);
            msg.setResult("Success");
            msg.setInfo("Resources successfully freed");
            return serviceUtil.writeXML(msg);
        }
        catch (UnknownJobException e) {
            logger.warn("Unknown job in JobManagerService.freeJob(): " + jobId);
            return serviceUtil.writeFault(e);
View Full Code Here

        if (msg.getInfo() != null)
            elem.addContent(Util.createElement("info", msg.getInfo()));
    }
   
    public BasicResponseMessage readBasicResponseMessage(Element elem) {
        BasicResponseMessage msg = new BasicResponseMessage();
       
        List children = elem.getChildren();
        Element child;
       
        for (int i=0; i<children.size(); i++) {
            child = (Element)children.get(i);
            String name = child.getName().toLowerCase();
           
            if (name.equals("operation"))
                msg.setOperation(child.getText());
            else if (name.equals("key"))
                msg.setJobKey(child.getText());
            else if (name.equals("result"))
                msg.setResult(child.getText());
            else if (name.equals("info"))
                msg.setInfo(child.getText());
        }
       
        return msg;
    }
View Full Code Here

       
        //parse response:
        Document doc = buildXML(msgXml);
        throwExceptions(doc);
       
        BasicResponseMessage msg = parseBasicResponse(doc);
        return msg.getJobKey();
    }
View Full Code Here

       
        //parse response:
        Document doc = buildXML(msgXml);
        throwExceptions(doc);
       
        BasicResponseMessage msg = parseBasicResponse(doc);
        return msg.getJobKey();
    }
View Full Code Here

        try {
            String xml = service.getJobStatus(jobKey);
            Document doc = buildXML(xml);
            throwExceptions(doc);
           
            BasicResponseMessage msg = parseBasicResponse(doc);          
            String status = msg.getResult().toLowerCase();
            return Util.parseJobStatus(status);
        }
        catch(UnknownJobException e) {
            throw new UnknownJobException(jobKey);
        }
View Full Code Here

           
            RunningJobInfo jobInfo = new RunningJobInfo(wkflId, null, workDir);
            jobInfoManager.storeJobInfo(jobInfo);

            //response:
            BasicResponseMessage msg = new BasicResponseMessage("submitJob");
            msg.setResult("Success");
            msg.setInfo("Submitted Successfully");
            msg.setJobKey(wkflId);
            return xmlUtil.writeXML(msg);
           
        }
        catch(Exception e) {
            logger.error("Error in JobManagerService.submitJob()", e);
View Full Code Here

            //free job:
            jobInfoManager.freeJob(id);
            getWorkflowManager().freeWorkflow(id);
           
            //response:
            BasicResponseMessage msg = new BasicResponseMessage("freeWorkflow", id);
            msg.setResult("Success");
            msg.setInfo("Resources successfully freed");
            return xmlUtil.writeXML(msg);
        }
        catch (UnknownWorkflowException e) {
            logger.warn("Unknown workflow in WorkflowManagerService.freeWorkflow(): " + e.getId());
            return xmlUtil.writeFault(e);
View Full Code Here

TOP

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

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.