Package org.springframework.batch.core

Examples of org.springframework.batch.core.BatchStatus


   * @param jobExecution the jobExecution to check for
   * @return boolean flag to set if this job execution can be restarted
   */
  private boolean isJobExecutionRestartable(JobExecution jobExecution) {
    JobInstance jobInstance = jobExecution.getJobInstance();
    BatchStatus status = jobExecution.getStatus();
    try {
      List<JobExecution> jobExecutionsForJobInstance = (List<JobExecution>) jobService.getJobExecutionsForJobInstance(
          jobInstance.getJobName(), jobInstance.getId());
      for (JobExecution jobExecutionForJobInstance : jobExecutionsForJobInstance) {
        if (jobExecutionForJobInstance.getStatus() == BatchStatus.COMPLETED) {
          return false;
        }
      }
    }
    catch (NoSuchJobException e) {
      throw new NoSuchBatchJobException(jobInstance.getJobName());
    }
    return status.isGreaterThan(BatchStatus.STOPPING) && status.isLessThan(BatchStatus.ABANDONED);
  }
View Full Code Here


      throw new org.springframework.xd.dirt.job.JobParametersInvalidException(
          "The Job Parameters for Job Execution " + jobExecution.getId()
          + " are invalid.");
    }

    final BatchStatus status = jobExecution.getStatus();

    if (status == BatchStatus.COMPLETED || status == BatchStatus.ABANDONED) {
      throw new org.springframework.xd.dirt.job.JobInstanceAlreadyCompleteException(
          "Job Execution " + jobExecution.getId() + " is already complete.");
    }
View Full Code Here

    this.jobParametersString = new JobParametersExtractor().fromJobParameters(jobExecution.getJobParameters());

    JobInstance jobInstance = jobExecution.getJobInstance();
    if (jobInstance != null) {
      this.jobName = jobInstance.getJobName();
      BatchStatus status = jobExecution.getStatus();
      this.restartable = status.isGreaterThan(BatchStatus.STOPPING) && status.isLessThan(BatchStatus.ABANDONED);
      this.abandonable = status.isGreaterThan(BatchStatus.STARTED) && status != BatchStatus.ABANDONED;
      this.stoppable = status.isLessThan(BatchStatus.STOPPING);
    }
    else {
      this.jobName = "?";
    }
View Full Code Here

    this.jobParametersString = new JobParametersExtractor().fromJobParameters(jobExecution.getJobParameters());

    JobInstance jobInstance = jobExecution.getJobInstance();
    if (jobInstance != null) {
      this.jobName = jobInstance.getJobName();
      BatchStatus status = jobExecution.getStatus();
      this.restartable = status.isGreaterThan(BatchStatus.STOPPING) && status.isLessThan(BatchStatus.ABANDONED);
      this.abandonable = status.isGreaterThan(BatchStatus.STARTED) && status != BatchStatus.ABANDONED;
      this.stoppable = status.isLessThan(BatchStatus.STOPPING) && status != BatchStatus.COMPLETED;
    }
    else {
      this.jobName = "?";
    }
View Full Code Here

    JobExecution jobExecution2 = new JobExecution(jobInstance2, 3l, jobParameters2, null);
    JobExecution jobExecution3 = new JobExecution(jobInstance3, 33l, jobParameters3, null);
    JobExecution jobExecution4 = new JobExecution(jobInstance4, 4l, jobParameters3, null);
    JobExecution jobExecution5 = new JobExecution(jobInstance5, 5l, jobParameters5, null);

    BatchStatus status = BatchStatus.COMPLETED;
    jobExecution3.setStatus(status);

    jobExecution2.setEndTime(new Date());
    jobExecution3.setEndTime(new Date());
    jobExecution5.setEndTime(new Date());
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.BatchStatus

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.