View Javadoc

1   package org.apache.continuum.dao;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.util.List;
23  import java.util.Map;
24  
25  import org.apache.maven.continuum.model.project.BuildResult;
26  import org.apache.maven.continuum.model.project.Project;
27  import org.apache.maven.continuum.store.ContinuumStoreException;
28  
29  /**
30   * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
31   * @version $Id: BuildResultDao.java 790386 2009-07-01 21:27:25Z evenisse $
32   */
33  public interface BuildResultDao
34  {
35      BuildResult getBuildResult( int buildId )
36          throws ContinuumStoreException;
37  
38      void addBuildResult( Project project, BuildResult build )
39          throws ContinuumStoreException;
40  
41      void updateBuildResult( BuildResult build )
42          throws ContinuumStoreException;
43  
44      void removeBuildResult( BuildResult buildResult );
45  
46      BuildResult getLatestBuildResultForProject( int projectId );
47  
48      BuildResult getLatestBuildResultForProjectWithDetails( int projectId );
49  
50      BuildResult getLatestBuildResultForBuildDefinition( int projectId, int buildDefinitionId );
51  
52      BuildResult getLatestBuildResultInSuccess( int projectId );
53  
54      BuildResult getPreviousBuildResultInSuccess( int projectId, int buildResultId )
55          throws ContinuumStoreException;
56  
57      long getNbBuildResultsForProject( int projectId );
58  
59      /**
60       * Returns the list of build results between the fromdate and the buildResult defined by its toBuildResultId
61       *
62       * @param projectId       The project id
63       * @param fromDate        the from date
64       * @param tobuildResultId the build result id
65       * @return the list of build results
66       */
67      List<BuildResult> getBuildResultsForProjectWithDetails( int projectId, long fromDate, int tobuildResultId );
68  
69      /**
70       * Returns the number of build results in success since fromDate
71       *
72       * @param projectId The project id
73       * @param fromDate  The from date
74       * @return the number of build results
75       */
76      long getNbBuildResultsInSuccessForProject( int projectId, long fromDate );
77  
78      List<BuildResult> getBuildResultsForProject( int projectId );
79  
80      List<BuildResult> getBuildResultsForProject( int projectId, long startIndex, long endIndex );
81  
82      /**
83       * @param projectId
84       * @param startId
85       * @return the returned list will contains all BuildResult for this project after the startId
86       * @since 1.2
87       */
88      List<BuildResult> getBuildResultsForProjectFromId( int projectId, long startId )
89          throws ContinuumStoreException;
90  
91      Map<Integer, BuildResult> getLatestBuildResultsByProjectGroupId( int projectGroupId );
92  
93      Map<Integer, BuildResult> getBuildResultsInSuccessByProjectGroupId( int projectGroupId );
94  
95      List<BuildResult> getBuildResultByBuildNumber( int projectId, int buildNumber );
96  
97      List<BuildResult> getBuildResultsByBuildDefinition( int projectId, int buildDefinitionId );
98  
99      List<BuildResult> getBuildResultsByBuildDefinition( int projectId, int buildDefinitionId, long startIndex,
100                                                         long endIndex );
101 
102     List<BuildResult> getAllBuildsForAProjectByDate( int projectId );
103 }