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 org.apache.maven.continuum.model.project.BuildResult;
23  import org.apache.maven.continuum.model.project.Project;
24  import org.apache.maven.continuum.store.ContinuumStoreException;
25  
26  import java.util.Date;
27  import java.util.List;
28  import java.util.Map;
29  
30  /**
31   * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
32   * @version $Id: BuildResultDao.java 1372260 2012-08-13 04:29:09Z brett $
33   */
34  public interface BuildResultDao
35  {
36      BuildResult getBuildResult( int buildId )
37          throws ContinuumStoreException;
38  
39      void addBuildResult( Project project, BuildResult build )
40          throws ContinuumStoreException;
41  
42      void updateBuildResult( BuildResult build )
43          throws ContinuumStoreException;
44  
45      void removeBuildResult( BuildResult buildResult );
46  
47      BuildResult getLatestBuildResultForProject( int projectId );
48  
49      BuildResult getLatestBuildResultForProjectWithDetails( int projectId );
50  
51      BuildResult getLatestBuildResultForBuildDefinition( int projectId, int buildDefinitionId );
52  
53      BuildResult getLatestBuildResultInSuccess( int projectId );
54  
55      BuildResult getPreviousBuildResultInSuccess( int projectId, int buildResultId )
56          throws ContinuumStoreException;
57  
58      long getNbBuildResultsForProject( int projectId );
59  
60      /**
61       * Returns the list of build results between the fromdate and the buildResult defined by its toBuildResultId
62       *
63       * @param projectId       The project id
64       * @param fromDate        the from date
65       * @param tobuildResultId the build result id
66       * @return the list of build results
67       */
68      List<BuildResult> getBuildResultsForProjectWithDetails( int projectId, long fromDate, int tobuildResultId );
69  
70      /**
71       * Returns the number of build results in success since fromDate
72       *
73       * @param projectId The project id
74       * @param fromDate  The from date
75       * @return the number of build results
76       */
77      long getNbBuildResultsInSuccessForProject( int projectId, long fromDate );
78  
79      List<BuildResult> getBuildResultsForProject( int projectId );
80  
81      List<BuildResult> getBuildResultsForProject( int projectId, long startIndex, long endIndex );
82  
83      /**
84       * @param projectId
85       * @param startId
86       * @return the returned list will contains all BuildResult for this project after the startId
87       * @since 1.2
88       */
89      List<BuildResult> getBuildResultsForProjectFromId( int projectId, long startId )
90          throws ContinuumStoreException;
91  
92      Map<Integer, BuildResult> getLatestBuildResultsByProjectGroupId( int projectGroupId );
93  
94      Map<Integer, BuildResult> getBuildResultsInSuccessByProjectGroupId( int projectGroupId );
95  
96      List<BuildResult> getBuildResultByBuildNumber( int projectId, int buildNumber );
97  
98      List<BuildResult> getBuildResultsByBuildDefinition( int projectId, int buildDefinitionId );
99  
100     List<BuildResult> getBuildResultsByBuildDefinition( int projectId, int buildDefinitionId, long startIndex,
101                                                         long endIndex );
102 
103     List<BuildResult> getAllBuildsForAProjectByDate( int projectId );
104 
105     List<BuildResult> getBuildResultsInRange( Date fromDate, Date toDate, int state, String triggeredBy,
106                                               int projectGroupId );
107 }