Skip to content

Commit b11c4b0

Browse files
committed
Reorganize methods in JobOperator
1 parent afdd842 commit b11c4b0

File tree

2 files changed

+195
-195
lines changed

2 files changed

+195
-195
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/launch/JobOperator.java

+92-92
Original file line numberDiff line numberDiff line change
@@ -43,79 +43,11 @@
4343
public interface JobOperator extends JobLauncher {
4444

4545
/**
46-
* List the {@link JobExecution JobExecutions} associated with a particular
47-
* {@link JobInstance}, in reverse order of creation (and therefore usually of
48-
* execution).
49-
* @param instanceId the id of a {@link JobInstance}
50-
* @return the id values of all the {@link JobExecution JobExecutions} associated with
51-
* this instance
52-
* @throws NoSuchJobInstanceException if the {@link JobInstance} associated with the
53-
* {@code instanceId} cannot be found.
54-
* @deprecated Since 6.0 in favor of
55-
* {@link org.springframework.batch.core.repository.JobRepository#getJobExecutions(JobInstance)}.
56-
* Scheduled for removal in 6.2 or later.
57-
*/
58-
@Deprecated(since = "6.0", forRemoval = true)
59-
List<Long> getExecutions(long instanceId) throws NoSuchJobInstanceException;
60-
61-
/**
62-
* List the {@link JobInstance JobInstances} for a given job name, in reverse order of
63-
* creation (and therefore usually of first execution).
64-
* @param jobName the job name that all the instances have
65-
* @param start the start index of the instances
66-
* @param count the maximum number of values to return
67-
* @return the id values of the {@link JobInstance JobInstances}
68-
* @throws NoSuchJobException is thrown if no {@link JobInstance}s for the jobName
69-
* exist.
70-
* @deprecated Since 6.0 in favor of
71-
* {@link org.springframework.batch.core.repository.JobRepository#getJobInstances(String, int, int)}.
72-
* Scheduled for removal in 6.2 or later.
73-
*/
74-
@Deprecated(since = "6.0", forRemoval = true)
75-
List<Long> getJobInstances(String jobName, int start, int count) throws NoSuchJobException;
76-
77-
/**
78-
* @param jobName {@link String} name of the job.
79-
* @param jobParameters {@link JobParameters} parameters for the job instance.
80-
* @return the {@link JobInstance} with the given name and parameters, or
81-
* {@code null}.
82-
* @deprecated Since 6.0 in favor of
83-
* {@link org.springframework.batch.core.repository.JobRepository#getJobInstance(String, JobParameters)}.
84-
* Scheduled for removal in 6.2 or later.
85-
*/
86-
@Deprecated(since = "6.0", forRemoval = true)
87-
@Nullable
88-
default JobInstance getJobInstance(String jobName, JobParameters jobParameters) {
89-
throw new UnsupportedOperationException();
90-
}
91-
92-
/**
93-
* Get the id values of all the running {@link JobExecution JobExecutions} with the
94-
* given job name.
95-
* @param jobName the name of the job to search under
96-
* @return the id values of the running {@link JobExecution} instances
97-
* @throws NoSuchJobException if there are no {@link JobExecution JobExecutions} with
98-
* that job name
99-
* @deprecated Since 6.0 in favor of
100-
* {@link org.springframework.batch.core.repository.JobRepository#findRunningJobExecutions(String)}.
101-
* Scheduled for removal in 6.2 or later.
102-
*/
103-
@Deprecated(since = "6.0", forRemoval = true)
104-
Set<Long> getRunningExecutions(String jobName) throws NoSuchJobException;
105-
106-
/**
107-
* Get the {@link JobParameters} as a human readable String (new line separated
108-
* key=value pairs).
109-
* @param executionId the id of an existing {@link JobExecution}
110-
* @return the job parameters that were used to launch the associated instance
111-
* @throws NoSuchJobExecutionException if the id was not associated with any
112-
* {@link JobExecution}
113-
* @deprecated Since 6.0 in favor of
114-
* {@link org.springframework.batch.core.repository.JobRepository#getJobExecution(Long).getJobParameters()}.
115-
* Scheduled for removal in 6.2 or later.
46+
* List the available job names that can be launched with
47+
* {@link #start(String, Properties)}.
48+
* @return a set of job names
11649
*/
117-
@Deprecated(since = "6.0", forRemoval = true)
118-
String getParameters(long executionId) throws NoSuchJobExecutionException;
50+
Set<String> getJobNames();
11951

12052
/**
12153
* Start a new instance of a job with the parameters specified.
@@ -195,6 +127,94 @@ Long startNextInstance(String jobName) throws NoSuchJobException, JobParametersN
195127
*/
196128
boolean stop(long executionId) throws NoSuchJobExecutionException, JobExecutionNotRunningException;
197129

130+
/**
131+
* Mark the {@link JobExecution} as ABANDONED. If a stop signal is ignored because the
132+
* process died this is the best way to mark a job as finished with (as opposed to
133+
* STOPPED). An abandoned job execution cannot be restarted by the framework.
134+
* @param jobExecutionId the job execution id to abort
135+
* @return the {@link JobExecution} that was aborted
136+
* @throws NoSuchJobExecutionException thrown if there is no job execution for the
137+
* jobExecutionId.
138+
* @throws JobExecutionAlreadyRunningException if the job is running (it should be
139+
* stopped first)
140+
*/
141+
JobExecution abandon(long jobExecutionId) throws NoSuchJobExecutionException, JobExecutionAlreadyRunningException;
142+
143+
/**
144+
* List the {@link JobExecution JobExecutions} associated with a particular
145+
* {@link JobInstance}, in reverse order of creation (and therefore usually of
146+
* execution).
147+
* @param instanceId the id of a {@link JobInstance}
148+
* @return the id values of all the {@link JobExecution JobExecutions} associated with
149+
* this instance
150+
* @throws NoSuchJobInstanceException if the {@link JobInstance} associated with the
151+
* {@code instanceId} cannot be found.
152+
* @deprecated Since 6.0 in favor of
153+
* {@link org.springframework.batch.core.repository.JobRepository#getJobExecutions(JobInstance)}.
154+
* Scheduled for removal in 6.2 or later.
155+
*/
156+
@Deprecated(since = "6.0", forRemoval = true)
157+
List<Long> getExecutions(long instanceId) throws NoSuchJobInstanceException;
158+
159+
/**
160+
* List the {@link JobInstance JobInstances} for a given job name, in reverse order of
161+
* creation (and therefore usually of first execution).
162+
* @param jobName the job name that all the instances have
163+
* @param start the start index of the instances
164+
* @param count the maximum number of values to return
165+
* @return the id values of the {@link JobInstance JobInstances}
166+
* @throws NoSuchJobException is thrown if no {@link JobInstance}s for the jobName
167+
* exist.
168+
* @deprecated Since 6.0 in favor of
169+
* {@link org.springframework.batch.core.repository.JobRepository#getJobInstances(String, int, int)}.
170+
* Scheduled for removal in 6.2 or later.
171+
*/
172+
@Deprecated(since = "6.0", forRemoval = true)
173+
List<Long> getJobInstances(String jobName, int start, int count) throws NoSuchJobException;
174+
175+
/**
176+
* @param jobName {@link String} name of the job.
177+
* @param jobParameters {@link JobParameters} parameters for the job instance.
178+
* @return the {@link JobInstance} with the given name and parameters, or
179+
* {@code null}.
180+
* @deprecated Since 6.0 in favor of
181+
* {@link org.springframework.batch.core.repository.JobRepository#getJobInstance(String, JobParameters)}.
182+
* Scheduled for removal in 6.2 or later.
183+
*/
184+
@Deprecated(since = "6.0", forRemoval = true)
185+
@Nullable
186+
default JobInstance getJobInstance(String jobName, JobParameters jobParameters) {
187+
throw new UnsupportedOperationException();
188+
}
189+
190+
/**
191+
* Get the id values of all the running {@link JobExecution JobExecutions} with the
192+
* given job name.
193+
* @param jobName the name of the job to search under
194+
* @return the id values of the running {@link JobExecution} instances
195+
* @throws NoSuchJobException if there are no {@link JobExecution JobExecutions} with
196+
* that job name
197+
* @deprecated Since 6.0 in favor of
198+
* {@link org.springframework.batch.core.repository.JobRepository#findRunningJobExecutions(String)}.
199+
* Scheduled for removal in 6.2 or later.
200+
*/
201+
@Deprecated(since = "6.0", forRemoval = true)
202+
Set<Long> getRunningExecutions(String jobName) throws NoSuchJobException;
203+
204+
/**
205+
* Get the {@link JobParameters} as a human readable String (new line separated
206+
* key=value pairs).
207+
* @param executionId the id of an existing {@link JobExecution}
208+
* @return the job parameters that were used to launch the associated instance
209+
* @throws NoSuchJobExecutionException if the id was not associated with any
210+
* {@link JobExecution}
211+
* @deprecated Since 6.0 in favor of
212+
* {@link org.springframework.batch.core.repository.JobRepository#getJobExecution(Long).getJobParameters()}.
213+
* Scheduled for removal in 6.2 or later.
214+
*/
215+
@Deprecated(since = "6.0", forRemoval = true)
216+
String getParameters(long executionId) throws NoSuchJobExecutionException;
217+
198218
/**
199219
* Summarise the {@link JobExecution} with the supplied id, giving details of status,
200220
* start and end times etc.
@@ -223,24 +243,4 @@ Long startNextInstance(String jobName) throws NoSuchJobException, JobParametersN
223243
@Deprecated(since = "6.0", forRemoval = true)
224244
Map<Long, String> getStepExecutionSummaries(long executionId) throws NoSuchJobExecutionException;
225245

226-
/**
227-
* List the available job names that can be launched with
228-
* {@link #start(String, Properties)}.
229-
* @return a set of job names
230-
*/
231-
Set<String> getJobNames();
232-
233-
/**
234-
* Mark the {@link JobExecution} as ABANDONED. If a stop signal is ignored because the
235-
* process died this is the best way to mark a job as finished with (as opposed to
236-
* STOPPED). An abandoned job execution cannot be restarted by the framework.
237-
* @param jobExecutionId the job execution id to abort
238-
* @return the {@link JobExecution} that was aborted
239-
* @throws NoSuchJobExecutionException thrown if there is no job execution for the
240-
* jobExecutionId.
241-
* @throws JobExecutionAlreadyRunningException if the job is running (it should be
242-
* stopped first)
243-
*/
244-
JobExecution abandon(long jobExecutionId) throws NoSuchJobExecutionException, JobExecutionAlreadyRunningException;
245-
246246
}

0 commit comments

Comments
 (0)