Package org.apache.oodt.cas.workflow.system

Examples of org.apache.oodt.cas.workflow.system.XmlRpcWorkflowManagerClient


      Validate.notNull(getUrl());

      if (client != null) {
         return client;
      } else {
         return new XmlRpcWorkflowManagerClient(new URL(getUrl()));
      }
   }
View Full Code Here


   @Override
   public void execute(ActionMessagePrinter printer)
         throws CmdLineActionException {
      try {
         XmlRpcWorkflowManagerClient client = getClient();
         WorkflowInstance inst = client.getWorkflowInstanceById(instanceId);
         if (inst == null) {
            throw new Exception(
                  "WorkflowManager returned null workflow instance");
         }
         printer.println("Instance: [id=" + inst.getId() + ", status="
               + inst.getStatus() + ", currentTask=" + inst.getCurrentTaskId()
               + ", workflow=" + inst.getWorkflow().getName()
               + ",wallClockTime="
               + client.getWorkflowWallClockMinutes(inst.getId())
               + ",currentTaskWallClockTime="
               + client.getWorkflowCurrentTaskWallClockMinutes(inst.getId())
               + "]");
      } catch (Exception e) {
         throw new CmdLineActionException(
               "Failed to get workflow instance information for"
                     + " instanceId '" + instanceId + "' : " + e.getMessage(),
View Full Code Here

   public void execute(ActionMessagePrinter printer)
         throws CmdLineActionException {
      Validate.isTrue(pageNum != -1);

      try {
         XmlRpcWorkflowManagerClient client = getClient();
         WorkflowInstancePage page = null;
         if (status != null && !status.equals("")) {
            page = client.paginateWorkflowInstances(pageNum + 1, status);
         } else {
            page = client.paginateWorkflowInstances(pageNum + 1);
         }

         printer.println("Page: [num=" + page.getPageNum() + ","
               + "pageSize=" + page.getPageSize() + ",totalPages="
               + page.getTotalPages() + "]");
         if (page.getPageWorkflows() == null) {
            throw new Exception(
                  "WorkflowManager returned null page of workflows");
         }
         for (WorkflowInstance inst : (List<WorkflowInstance>) page
               .getPageWorkflows()) {
            printer.println("Instance: [id=" + inst.getId() + ", status="
                  + inst.getStatus() + ", currentTask="
                  + inst.getCurrentTaskId() + ", workflow="
                  + inst.getWorkflow().getName() + ",wallClockTime="
                  + client.getWorkflowWallClockMinutes(inst.getId())
                  + ",currentTaskWallClockTime="
                  + client.getWorkflowCurrentTaskWallClockMinutes(inst.getId())
                  + "]");
         }
      } catch (Exception e) {
         throw new CmdLineActionException(
               "Failed to get next page of workflows for page '" + pageNum
View Full Code Here

   @SuppressWarnings("unchecked")
   @Override
   public void execute(ActionMessagePrinter printer)
         throws CmdLineActionException {
      try {
         XmlRpcWorkflowManagerClient client = getClient();
         WorkflowInstancePage page = null;
         if (status != null && !status.equals("")) {
            page = client.paginateWorkflowInstances(1, status);
         } else {
            page = client.getFirstPage();
         }

         printer.println("Page: [num=" + page.getPageNum() + ","
               + "pageSize=" + page.getPageSize() + ",totalPages="
               + page.getTotalPages() + "]");
         if (page.getPageWorkflows() == null) {
            throw new Exception(
                  "WorkflowManager returned null page of workflows");
         }
         for (WorkflowInstance inst : (List<WorkflowInstance>) page
               .getPageWorkflows()) {
            printer.println("Instance: [id=" + inst.getId() + ", status="
                  + inst.getStatus() + ", currentTask="
                  + inst.getCurrentTaskId() + ", workflow="
                  + inst.getWorkflow().getName() + ", wallClockTime="
                  + client.getWorkflowWallClockMinutes(inst.getId())
                  + ", currentTaskWallClockTime="
                  + client.getWorkflowCurrentTaskWallClockMinutes(inst.getId())
                  + "]");
         }

      } catch (Exception e) {
         throw new CmdLineActionException(
View Full Code Here

   public void execute(ActionMessagePrinter printer)
         throws CmdLineActionException {
      Validate.isTrue(pageNum != -1);

      try {
         XmlRpcWorkflowManagerClient client = getClient();
         WorkflowInstancePage page = null;
         if (status != null && !status.equals("")) {
            page = client.paginateWorkflowInstances(pageNum - 1, status);
         } else {
            page = client.paginateWorkflowInstances(pageNum - 1);
         }

         printer.println("Page: [num=" + page.getPageNum() + ","
               + "pageSize=" + page.getPageSize() + ",totalPages="
               + page.getTotalPages() + "]");
         if (page.getPageWorkflows() == null) {
            throw new Exception(
                  "WorkflowManager returned null page of workflows");
         }
         for (WorkflowInstance inst : (List<WorkflowInstance>) page
               .getPageWorkflows()) {
            printer.println("Instance: [id=" + inst.getId() + ", status="
                  + inst.getStatus() + ", currentTask="
                  + inst.getCurrentTaskId() + ", workflow="
                  + inst.getWorkflow().getName() + ",wallClockTime="
                  + client.getWorkflowWallClockMinutes(inst.getId())
                  + ",currentTaskWallClockTime="
                  + client.getWorkflowCurrentTaskWallClockMinutes(inst.getId())
                  + "]");
         }
      } catch (Exception e) {
         throw new CmdLineActionException(
               "Failed to get previous page of workflows for " + "pageNum '"
View Full Code Here

   @SuppressWarnings("unchecked")
   @Override
   public void execute(ActionMessagePrinter printer)
         throws CmdLineActionException {
      try {
         XmlRpcWorkflowManagerClient client = getClient();
         WorkflowInstancePage page = null;
         if (status != null && !status.equals("")) {
            WorkflowInstancePage firstPage = client.paginateWorkflowInstances(
                  1, status);
            page = client.paginateWorkflowInstances(firstPage.getTotalPages(),
                  status);
         } else {
            page = client.getLastPage();
         }

         printer.println("Page: [num=" + page.getPageNum() + ","
               + "pageSize=" + page.getPageSize() + ",totalPages="
               + page.getTotalPages() + "]");
         if (page.getPageWorkflows() == null) {
            throw new Exception(
                  "WorkflowManager returned null page of workflows");
         }
         for (WorkflowInstance inst : (List<WorkflowInstance>) page
               .getPageWorkflows()) {
            printer.println("Instance: [id=" + inst.getId() + ", status="
                  + inst.getStatus() + ", currentTask="
                  + inst.getCurrentTaskId() + ", workflow="
                  + inst.getWorkflow().getName() + ",wallClockTime="
                  + client.getWorkflowWallClockMinutes(inst.getId())
                  + ",currentTaskWallClockTime="
                  + client.getWorkflowCurrentTaskWallClockMinutes(inst.getId())
                  + "]");
         }
      } catch (Exception e) {
         throw new CmdLineActionException(
               "Failed to get last page of workflows with " + "status '"
View Full Code Here

   @Override
   public void execute(ActionMessagePrinter printer)
         throws CmdLineActionException {

      try {
         XmlRpcWorkflowManagerClient client = getClient();
         @SuppressWarnings("unchecked")
         List<WorkflowInstance> insts = client.getWorkflowInstances();

         if (insts == null) {
            throw new Exception(
                  "WorkflowManager return null workflow instances list");
         }
         for (WorkflowInstance inst : insts) {
            printer.println("Instance: [id="
                  + inst.getId()
                  + ", status="
                  + inst.getStatus()
                  + ", currentTask="
                  + inst.getCurrentTaskId()
                  + ", workflow="
                  + inst.getWorkflow().getName()
                  + ",wallClockTime="
                  + client.getWorkflowWallClockMinutes(inst.getId())
                  + ",currentTaskWallClockTime="
                  + client.getWorkflowCurrentTaskWallClockMinutes(inst
                        .getId()) + "]");
         }
      } catch (Exception e) {
         throw new CmdLineActionException(
               "Failed to get workflow instances from URL '" + getUrl()
View Full Code Here

   }

   public boolean performAction(File product, Metadata productMetadata)
         throws CrawlerActionException {
      try {
         XmlRpcWorkflowManagerClient wClient = new XmlRpcWorkflowManagerClient(
               new URL(this.workflowMgrUrl));
         String ingestSuffix = this.ingestSuffix;
         return wClient.sendEvent(productMetadata.getMetadata(PRODUCT_TYPE)
               + ingestSuffix, productMetadata);
      } catch (Exception e) {
         throw new CrawlerActionException(
               "Failed to update workflow manager : " + e.getMessage());
      }
View Full Code Here

   }

   public void testUpdateStatus() throws Exception {
      final Map<String, String> args = Maps.newHashMap();
      PGETaskInstance pgeTask = createTestInstance();
      pgeTask.wm = new XmlRpcWorkflowManagerClient(null) {
         @Override
         public boolean updateWorkflowInstanceStatus(String instanceId,
               String status) {
            args.put("InstanceId", instanceId);
            args.put("Status", status);
View Full Code Here

   public void testCreateWorkflowManagerClient() throws Exception {
      PGETaskInstance pgeTask = createTestInstance();
      pgeTask.pgeMetadata.replaceMetadata(WORKFLOW_MANAGER_URL,
            "http://localhost:8888");
      XmlRpcWorkflowManagerClient wmClient =
         pgeTask.createWorkflowManagerClient();
      assertNotNull(wmClient);
   }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.workflow.system.XmlRpcWorkflowManagerClient

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.