1
1
/*
2
- * Copyright 2006-2019 the original author or authors.
2
+ * Copyright 2006-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
26
26
import org .springframework .lang .Nullable ;
27
27
28
28
/**
29
- * Entry point for browsing executions of running or historical jobs and steps. Since the
30
- * data may be re-hydrated from persistent storage, it may not contain volatile fields
29
+ * Entry point for browsing the executions of running or historical jobs and steps. Since
30
+ * the data may be re-hydrated from persistent storage, it cannot contain volatile fields
31
31
* that would have been present when the execution was active.
32
32
*
33
33
* @author Dave Syer
39
39
public interface JobExplorer {
40
40
41
41
/**
42
- * Fetch {@link JobInstance} values in descending order of creation (and therefore
43
- * usually of first execution).
44
- * @param jobName the name of the job to query
45
- * @param start the start index of the instances to return
46
- * @param count the maximum number of instances to return
47
- * @return the {@link JobInstance} values up to a maximum of count values
42
+ * Fetch {@link JobInstance} values in descending order of creation (and, therefore,
43
+ * usually, of first execution).
44
+ * @param jobName The name of the job to query.
45
+ * @param start The start index of the instances to return.
46
+ * @param count The maximum number of instances to return.
47
+ * @return the {@link JobInstance} values up to a maximum of count values.
48
48
*/
49
49
List <JobInstance > getJobInstances (String jobName , int start , int count );
50
50
51
51
/**
52
- * Find the last job instance by Id for the given job.
53
- * @param jobName name of the job
54
- * @return the last job instance by Id if any or null otherwise
52
+ * Find the last job instance, by ID, for the given job.
53
+ * @param jobName The name of the job.
54
+ * @return the last job instance by Id if any or {@code null} otherwise.
55
55
*
56
56
* @since 4.2
57
57
*/
@@ -61,52 +61,53 @@ default JobInstance getLastJobInstance(String jobName) {
61
61
}
62
62
63
63
/**
64
- * Retrieve a {@link JobExecution} by its id . The complete object graph for this
65
- * execution should be returned (unless otherwise indicated) including the parent
64
+ * Retrieve a {@link JobExecution} by its ID . The complete object graph for this
65
+ * execution should be returned (unless otherwise indicated), including the parent
66
66
* {@link JobInstance} and associated {@link ExecutionContext} and
67
67
* {@link StepExecution} instances (also including their execution contexts).
68
- * @param executionId the job execution id
69
- * @return the {@link JobExecution} with this id, or null if not found
68
+ * @param executionId The job execution ID.
69
+ * @return the {@link JobExecution} that has this ID or {@code null} if not found.
70
70
*/
71
71
@ Nullable
72
72
JobExecution getJobExecution (@ Nullable Long executionId );
73
73
74
74
/**
75
- * Retrieve a {@link StepExecution} by its id and parent {@link JobExecution} id . The
75
+ * Retrieve a {@link StepExecution} by its ID and parent {@link JobExecution} ID . The
76
76
* execution context for the step should be available in the result, and the parent
77
- * job execution should have its primitive properties, but may not contain the job
77
+ * job execution should have its primitive properties, but it may not contain the job
78
78
* instance information.
79
- * @param jobExecutionId the parent job execution id
80
- * @param stepExecutionId the step execution id
81
- * @return the {@link StepExecution} with this id, or null if not found
79
+ * @param jobExecutionId The parent job execution ID.
80
+ * @param stepExecutionId The step execution ID.
81
+ * @return the {@link StepExecution} that has this ID or {@code null} if not found.
82
82
*
83
83
* @see #getJobExecution(Long)
84
84
*/
85
85
@ Nullable
86
86
StepExecution getStepExecution (@ Nullable Long jobExecutionId , @ Nullable Long stepExecutionId );
87
87
88
88
/**
89
- * @param instanceId {@link Long} id for the jobInstance to obtain.
90
- * @return the {@link JobInstance} with this id , or null
89
+ * @param instanceId {@link Long} The ID for the {@link jobInstance} to obtain.
90
+ * @return the {@code JobInstance} that has this ID , or {@code null} if not found.
91
91
*/
92
92
@ Nullable
93
93
JobInstance getJobInstance (@ Nullable Long instanceId );
94
94
95
95
/**
96
96
* Retrieve job executions by their job instance. The corresponding step executions
97
- * may not be fully hydrated (e.g. their execution context may be missing), depending
98
- * on the implementation. Use {@link #getStepExecution(Long, Long)} to hydrate them in
99
- * that case .
100
- * @param jobInstance the {@link JobInstance} to query
101
- * @return the set of all executions for the specified {@link JobInstance}
97
+ * may not be fully hydrated (for example, their execution context may be missing),
98
+ * depending on the implementation. In that case, use
99
+ * {@link #getStepExecution(Long, Long)} to hydrate them .
100
+ * @param jobInstance The {@link JobInstance} to query.
101
+ * @return the set of all executions for the specified {@link JobInstance}.
102
102
*/
103
103
List <JobExecution > getJobExecutions (JobInstance jobInstance );
104
104
105
105
/**
106
106
* Find the last {@link JobExecution} that has been created for a given
107
107
* {@link JobInstance}.
108
- * @param jobInstance the {@link JobInstance}
109
- * @return the last {@link JobExecution} that has been created for this instance or
108
+ * @param jobInstance The {@code JobInstance} for which to find the last
109
+ * {@code JobExecution}.
110
+ * @return the last {@code JobExecution} that has been created for this instance or
110
111
* {@code null} if no job execution is found for the given job instance.
111
112
*
112
113
* @since 4.2
@@ -118,39 +119,39 @@ default JobExecution getLastJobExecution(JobInstance jobInstance) {
118
119
119
120
/**
120
121
* Retrieve running job executions. The corresponding step executions may not be fully
121
- * hydrated (e.g. their execution context may be missing), depending on the
122
- * implementation. Use {@link #getStepExecution(Long, Long)} to hydrate them in that
123
- * case .
124
- * @param jobName the name of the job
125
- * @return the set of running executions for jobs with the specified name
122
+ * hydrated (for example, their execution context may be missing), depending on the
123
+ * implementation. In that case, use {@link #getStepExecution(Long, Long)} to hydrate
124
+ * them .
125
+ * @param jobName The name of the job.
126
+ * @return the set of running executions for jobs with the specified name.
126
127
*/
127
128
Set <JobExecution > findRunningJobExecutions (@ Nullable String jobName );
128
129
129
130
/**
130
131
* Query the repository for all unique {@link JobInstance} names (sorted
131
132
* alphabetically).
132
- * @return the set of job names that have been executed
133
+ * @return the set of job names that have been executed.
133
134
*/
134
135
List <String > getJobNames ();
135
136
136
137
/**
137
- * Fetch {@link JobInstance} values in descending order of creation (and there for
138
- * usually of first execution) with a 'like'/ wildcard criteria.
139
- * @param jobName the name of the job to query for .
140
- * @param start the start index of the instances to return.
141
- * @param count the maximum number of instances to return.
142
- * @return a list of {@link JobInstance} for the job name requested .
138
+ * Fetch {@link JobInstance} values in descending order of creation (and, therefore,
139
+ * usually of first execution) with a 'like' or wildcard criteria.
140
+ * @param jobName The name of the job for which to query.
141
+ * @param start The start index of the instances to return.
142
+ * @param count The maximum number of instances to return.
143
+ * @return a list of {@link JobInstance} for the requested job name.
143
144
*/
144
145
List <JobInstance > findJobInstancesByJobName (String jobName , int start , int count );
145
146
146
147
/**
147
- * Query the repository for the number of unique {@link JobInstance}s associated with
148
- * the supplied job name.
149
- * @param jobName the name of the job to query for
148
+ * Query the repository for the number of unique {@link JobInstance} objects
149
+ * associated with the supplied job name.
150
+ * @param jobName The name of the job for which to query.
150
151
* @return the number of {@link JobInstance}s that exist within the associated job
151
- * repository
152
- * @throws NoSuchJobException thrown when there is no {@link JobInstance} for the
153
- * jobName specified.
152
+ * repository.
153
+ * @throws {@code NoSuchJobException} thrown when there is no {@link JobInstance} for
154
+ * the jobName specified.
154
155
*/
155
156
int getJobInstanceCount (@ Nullable String jobName ) throws NoSuchJobException ;
156
157
0 commit comments