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  import org.springframework.batch.core.JobExecution;
20  import org.springframework.batch.core.StepExecution;
21  import org.springframework.batch.item.ExecutionContext;
22  
23  /**
24   * DAO interface for persisting and retrieving {@link ExecutionContext}s.
25   * 
26   * @author Robert Kasanicky
27   */
28  public interface ExecutionContextDao {
29  
30  	/**
31  	 * @param jobExecution
32  	 * @return execution context associated with the given jobExecution
33  	 */
34  	ExecutionContext getExecutionContext(JobExecution jobExecution);
35  
36  	/**
37  	 * @param stepExecution
38  	 * @return execution context associated with the given stepExecution
39  	 */
40  	ExecutionContext getExecutionContext(StepExecution stepExecution);
41  
42  	/**
43  	 * Persist the execution context associated with the given jobExecution,
44  	 * persistent entry for the context should not exist yet.
45  	 * @param jobExecution
46  	 */
47  	void saveExecutionContext(final JobExecution jobExecution);
48  
49  	/**
50  	 * Persist the execution context associated with the given stepExecution,
51  	 * persistent entry for the context should not exist yet.
52  	 * @param stepExecution
53  	 */
54  	void saveExecutionContext(final StepExecution stepExecution);
55  
56  	/**
57  	 * Persist the updates of execution context associated with the given
58  	 * jobExecution. Persistent entry should already exist for this context.
59  	 * @param jobExecution
60  	 */
61  	void updateExecutionContext(final JobExecution jobExecution);
62  
63  	/**
64  	 * Persist the updates of execution context associated with the given
65  	 * stepExecution. Persistent entry should already exist for this context.
66  	 * @param stepExecution
67  	 */
68  	void updateExecutionContext(final StepExecution stepExecution);
69  }