View Javadoc

1   /*
2    * Copyright 2006-2007 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springframework.batch.core.repository.dao;
18  
19  
20  import org.springframework.batch.core.JobExecution;
21  import org.springframework.batch.core.StepExecution;
22  
23  public interface StepExecutionDao {
24  
25  	/**
26  	 * Save the given StepExecution.
27  	 * 
28  	 * Preconditions: Id must be null.
29  	 * 
30  	 * Postconditions: Id will be set to a unique Long.
31  	 * 
32  	 * @param stepExecution
33  	 */
34  	void saveStepExecution(StepExecution stepExecution);
35  
36  	/**
37  	 * Update the given StepExecution
38  	 * 
39  	 * Preconditions: Id must not be null.
40  	 * 
41  	 * @param stepExecution
42  	 */
43  	void updateStepExecution(StepExecution stepExecution);
44  
45  	/**
46  	 * Retrieve a {@link StepExecution} from its id.
47  	 * 
48  	 * @param jobExecution the parent {@link JobExecution}
49  	 * @param stepExecutionId the step execution id
50  	 * @return a {@link StepExecution}
51  	 */
52  	StepExecution getStepExecution(JobExecution jobExecution, Long stepExecutionId);
53  	
54  	/**
55  	 * Retrieve all the {@link StepExecution} for the parent {@link JobExecution}.
56  	 * 
57  	 * @param jobExecution the parent job execution
58  	 */
59  	void addStepExecutions(JobExecution jobExecution);
60  
61  }