コード例 #1
0
  public EndpointResponse removeWorkflow(RemoveWorkflowRequest request) {
    try {
      workflowDao.remove(request.getWorkflowId());

      for (Job j : jobDao.findJobs(request.getWorkflowId(), null)) {
        jobDao.remove(j.get_id());
      }

      return EndpointHelper.createResponse(EndpointResponse.class, request);

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(EndpointResponse.class, request, e);
    }
  }
コード例 #2
0
  public EndpointResponse removeJob(RemoveJobRequest request) {
    try {
      jobDao.remove(request.getJobId());
      return EndpointHelper.createResponse(EndpointResponse.class, request);

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(EndpointResponse.class, request, e);
    }
  }
コード例 #3
0
  public ListJobsResponse listJobs(ListJobsRequest request) {
    try {
      ListJobsResponse r = EndpointHelper.createResponse(ListJobsResponse.class, request);
      r.setJobs(jobDao.findJobs(request.getWorkflowId(), request.getJobState()));
      return r;

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(ListJobsResponse.class, request, e);
    }
  }
コード例 #4
0
  public FindJobResponse findJob(FindJobRequest request) {

    try {
      FindJobResponse r = EndpointHelper.createResponse(FindJobResponse.class, request);
      r.setJob(jobDao.get(request.getJobId()));
      return r;

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(FindJobResponse.class, request, e);
    }
  }
コード例 #5
0
  public EndpointResponse submitJob(SubmitJobRequest request) {

    try {
      jobDao.add(request.getJob());
      jobDispatcher.notifyNewJobAdded();
      return EndpointHelper.createResponse(EndpointResponse.class, request);

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(EndpointResponse.class, request, e);
    }
  }