-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
StepExecutionDao.java
103 lines (90 loc) · 3.2 KB
/
StepExecutionDao.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
* Copyright 2006-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.repository.dao;
import java.util.Collection;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobInstance;
import org.springframework.batch.core.StepExecution;
import org.springframework.lang.Nullable;
public interface StepExecutionDao {
/**
* Save the given StepExecution.
*
* Preconditions: Id must be null.
*
* Postconditions: Id will be set to a unique Long.
* @param stepExecution {@link StepExecution} instance to be saved.
*/
void saveStepExecution(StepExecution stepExecution);
/**
* Save the given collection of StepExecution as a batch.
*
* Preconditions: StepExecution Id must be null.
*
* Postconditions: StepExecution Id will be set to a unique Long.
* @param stepExecutions a collection of {@link JobExecution} instances to be saved.
*/
void saveStepExecutions(Collection<StepExecution> stepExecutions);
/**
* Update the given StepExecution
*
* Preconditions: Id must not be null.
* @param stepExecution {@link StepExecution} instance to be updated.
*/
void updateStepExecution(StepExecution stepExecution);
/**
* Retrieve a {@link StepExecution} from its id.
* @param jobExecution the parent {@link JobExecution}
* @param stepExecutionId the step execution id
* @return a {@link StepExecution}
*/
@Nullable
StepExecution getStepExecution(JobExecution jobExecution, Long stepExecutionId);
/**
* Retrieve the last {@link StepExecution} for a given {@link JobInstance} ordered by
* creation time and then id.
* @param jobInstance the parent {@link JobInstance}
* @param stepName the name of the step
* @return a {@link StepExecution}
*/
@Nullable
default StepExecution getLastStepExecution(JobInstance jobInstance, String stepName) {
throw new UnsupportedOperationException();
}
/**
* Retrieve all the {@link StepExecution} for the parent {@link JobExecution}.
* @param jobExecution the parent job execution
*/
void addStepExecutions(JobExecution jobExecution);
/**
* Counts all the {@link StepExecution} for a given step name.
* @param jobInstance the parent {@link JobInstance}
* @param stepName the name of the step
* @since 4.3
* @return the count of {@link StepExecution}s for a given step
*/
default int countStepExecutions(JobInstance jobInstance, String stepName) {
throw new UnsupportedOperationException();
}
/**
* Delete the given step execution.
* @param stepExecution the step execution to delete
* @since 5.0
*/
default void deleteStepExecution(StepExecution stepExecution) {
throw new UnsupportedOperationException();
}
}