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 package org.springframework.batch.admin.service;
17
18 import java.util.Collection;
19
20 import org.springframework.batch.core.StepExecution;
21 import org.springframework.batch.core.repository.dao.StepExecutionDao;
22
23 /**
24 * Extension of the {@link StepExecutionDao} interface to add additional search
25 * features.
26 *
27 * @author Dave Syer
28 *
29 */
30 public interface SearchableStepExecutionDao extends StepExecutionDao {
31
32 /**
33 * Find all the names of steps that have been executed as part of this job.
34 * Implementations should remove step names matching the pattern provided.
35 *
36 * @param jobName
37 * the name of the job to search for
38 * @param excludesPattern
39 * a pattern for step names to exclude
40 * @return the names of step executions from job executions in the
41 * repository
42 */
43 Collection<String> findStepNamesForJobExecution(String jobName,
44 String excludesPattern);
45
46 /**
47 * Find all the step executions for a given step name, or step name pattern
48 * (with wildcards specified as '*') sorted in descending order of id.
49 * @param jobName the job name or pattern
50 * @param stepName
51 * the step name or pattern
52 * @param start
53 * the start index of the step executions to return
54 * @param count
55 * the maximum number of step executions to return
56 *
57 * @return a collection of step executions
58 */
59 Collection<StepExecution> findStepExecutions(String jobName, String stepName,
60 int start, int count);
61
62 /**
63 * Count all the step executions for a given step name pattern.
64 * @param jobName the job name pattern
65 * @param stepName the step name pattern.
66 *
67 * @return the total number of step executions in the repository matching the pattern
68 */
69 int countStepExecutions(String jobName, String stepName);
70 }