Java Code Examples for org.springframework.batch.core.BatchStatus#isGreaterThan()

The following examples show how to use org.springframework.batch.core.BatchStatus#isGreaterThan() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JobUtils.java    From spring-cloud-dataflow with Apache License 2.0 5 votes vote down vote up
/**
 * Determine whether the provided {@link JobExecution} is restartable.
 *
 * @param jobExecution Must not be null and its {@link BatchStatus} must not be null
 * either.
 * @return Never returns null
 */
public static boolean isJobExecutionRestartable(JobExecution jobExecution) {
	Assert.notNull(jobExecution, "The provided jobExecution must not be null.");

	final BatchStatus batchStatus = jobExecution.getStatus();
	Assert.notNull(batchStatus, "The BatchStatus of the provided jobExecution must not be null.");

	return batchStatus.isGreaterThan(BatchStatus.STOPPING) && batchStatus.isLessThan(BatchStatus.ABANDONED);
}
 
Example 2
Source File: JobUtils.java    From spring-cloud-dataflow with Apache License 2.0 5 votes vote down vote up
/**
 * Determine whether the provided {@link JobExecution} is abandonable.
 *
 * @param jobExecution Must not be null and its {@link BatchStatus} must not be null
 * either.
 * @return Never returns null
 */
public static boolean isJobExecutionAbandonable(JobExecution jobExecution) {
	Assert.notNull(jobExecution, "The provided jobExecution must not be null.");

	final BatchStatus batchStatus = jobExecution.getStatus();
	Assert.notNull(batchStatus, "The BatchStatus of the provided jobExecution must not be null.");

	return batchStatus.isGreaterThan(BatchStatus.STARTED) && batchStatus != BatchStatus.ABANDONED;
}
 
Example 3
Source File: DeployerPartitionHandler.java    From spring-cloud-task with Apache License 2.0 4 votes vote down vote up
private boolean isComplete(BatchStatus status) {
	return status.equals(BatchStatus.COMPLETED)
			|| status.isGreaterThan(BatchStatus.STARTED);
}