|
1 | 1 | /* |
2 | | - * Copyright 2006-2022 the original author or authors. |
| 2 | + * Copyright 2006-2023 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. |
|
17 | 17 |
|
18 | 18 | import java.util.List; |
19 | 19 | import java.util.Map; |
| 20 | +import java.util.Properties; |
20 | 21 | import java.util.Set; |
21 | 22 |
|
22 | 23 | import org.springframework.batch.core.Job; |
@@ -111,10 +112,29 @@ default JobInstance getJobInstance(String jobName, JobParameters jobParameters) |
111 | 112 | * parameters already exists |
112 | 113 | * @throws JobParametersInvalidException thrown if any of the job parameters are |
113 | 114 | * invalid. |
| 115 | + * @deprecated use {@link #start(String, Properties)} instead. Will be removed in |
| 116 | + * v5.2. |
114 | 117 | */ |
| 118 | + @Deprecated(since = "5.0.1", forRemoval = true) |
115 | 119 | Long start(String jobName, String parameters) |
116 | 120 | throws NoSuchJobException, JobInstanceAlreadyExistsException, JobParametersInvalidException; |
117 | 121 |
|
| 122 | + /** |
| 123 | + * Start a new instance of a job with the parameters specified. |
| 124 | + * @param jobName the name of the {@link Job} to launch |
| 125 | + * @param parameters the parameters to launch it with |
| 126 | + * @return the id of the {@link JobExecution} that is launched |
| 127 | + * @throws NoSuchJobException if there is no {@link Job} with the specified name |
| 128 | + * @throws JobInstanceAlreadyExistsException if a job instance with this name and |
| 129 | + * parameters already exists |
| 130 | + * @throws JobParametersInvalidException thrown if any of the job parameters are |
| 131 | + * invalid. |
| 132 | + */ |
| 133 | + default Long start(String jobName, Properties parameters) |
| 134 | + throws NoSuchJobException, JobInstanceAlreadyExistsException, JobParametersInvalidException { |
| 135 | + throw new UnsupportedOperationException(); |
| 136 | + } |
| 137 | + |
118 | 138 | /** |
119 | 139 | * Restart a failed or stopped {@link JobExecution}. Fails with an exception if the id |
120 | 140 | * provided does not exist or corresponds to a {@link JobInstance} that in normal |
@@ -199,7 +219,7 @@ Long startNextInstance(String jobName) throws NoSuchJobException, JobParametersN |
199 | 219 |
|
200 | 220 | /** |
201 | 221 | * List the available job names that can be launched with |
202 | | - * {@link #start(String, String)}. |
| 222 | + * {@link #start(String, Properties)}. |
203 | 223 | * @return a set of job names |
204 | 224 | */ |
205 | 225 | Set<String> getJobNames(); |
|
0 commit comments