View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.continuum.builddefinition;
20  
21  import java.util.List;
22  
23  import org.apache.maven.continuum.model.project.BuildDefinition;
24  import org.apache.maven.continuum.model.project.BuildDefinitionTemplate;
25  import org.apache.maven.continuum.model.project.Project;
26  import org.apache.maven.continuum.model.project.ProjectGroup;
27  import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
28  
29  /**
30   * @author <a href="mailto:olamy@apache.org">olamy</a>
31   * @since 15 sept. 07
32   * @version $Id: BuildDefinitionService.java 729143 2008-12-23 22:21:06Z olamy $
33   */
34  public interface BuildDefinitionService
35  {
36      
37      /**
38       * @param buildDefinitionId
39       * @return null if not in store
40       * @throws BuildDefinitionServiceException
41       */
42      BuildDefinition getBuildDefinition( int buildDefinitionId )
43          throws BuildDefinitionServiceException;
44      
45     /**
46      * @return List<BuildDefinition> all build defintions
47      * @throws BuildDefinitionServiceException
48      */
49      List<BuildDefinition> getAllBuildDefinitions()
50          throws BuildDefinitionServiceException;
51  
52      BuildDefinition addBuildDefinition( BuildDefinition buildDefinition )
53          throws BuildDefinitionServiceException;
54  
55      void removeBuildDefinition( BuildDefinition buildDefinition )
56          throws BuildDefinitionServiceException;
57  
58      void updateBuildDefinition( BuildDefinition buildDefinition )
59          throws BuildDefinitionServiceException;
60  
61      List<BuildDefinition> getAllTemplates()
62          throws BuildDefinitionServiceException;    
63      
64      /**
65       * @param buildDefinition
66       * @return clone of {@link BuildDefinition} template/continuumDefault set to false
67       */
68      BuildDefinition cloneBuildDefinition( BuildDefinition buildDefinition );
69      
70      // ------------------------------------------------------
71      //  BuildDefinitionTemplate
72      // ------------------------------------------------------
73  
74      void addTemplateInProject( int buildDefinitionTemplateId, Project project )
75          throws BuildDefinitionServiceException;
76      
77      
78      List<BuildDefinitionTemplate> getAllBuildDefinitionTemplate()
79          throws BuildDefinitionServiceException;
80  
81      BuildDefinitionTemplate getBuildDefinitionTemplate( int id )
82          throws BuildDefinitionServiceException;
83  
84      BuildDefinitionTemplate addBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate )
85          throws BuildDefinitionServiceException;
86  
87      BuildDefinitionTemplate updateBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate )
88          throws BuildDefinitionServiceException;
89  
90      void removeBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate )
91          throws BuildDefinitionServiceException;
92  
93      public BuildDefinitionTemplate addBuildDefinitionInTemplate( BuildDefinitionTemplate buildDefinitionTemplate,
94                                                                   BuildDefinition buildDefinition, boolean template )
95          throws BuildDefinitionServiceException;
96  
97      BuildDefinitionTemplate removeBuildDefinitionFromTemplate( BuildDefinitionTemplate buildDefinitionTemplate,
98                                                                 BuildDefinition buildDefinition )
99          throws BuildDefinitionServiceException;
100 
101     public BuildDefinitionTemplate getDefaultAntBuildDefinitionTemplate()
102         throws BuildDefinitionServiceException;
103 
104     public BuildDefinitionTemplate getDefaultMavenOneBuildDefinitionTemplate()
105         throws BuildDefinitionServiceException;
106 
107     public BuildDefinitionTemplate getDefaultMavenTwoBuildDefinitionTemplate()
108         throws BuildDefinitionServiceException;
109 
110     public BuildDefinitionTemplate getDefaultShellBuildDefinitionTemplate()
111         throws BuildDefinitionServiceException;
112 
113     public BuildDefinitionTemplate getContinuumDefaultWithType( String type )
114         throws BuildDefinitionServiceException;
115 
116     public List<BuildDefinitionTemplate> getBuildDefinitionTemplatesWithType( String type )
117         throws BuildDefinitionServiceException;
118     
119     public ProjectGroup addBuildDefinitionTemplateToProjectGroup( int projectGroupId,
120                                                                   BuildDefinitionTemplate buildDefinitionTemplate )
121         throws BuildDefinitionServiceException, ContinuumObjectNotFoundException;
122 
123     public List<BuildDefinitionTemplate> getContinuumBuildDefinitionTemplates()
124         throws BuildDefinitionServiceException;
125 }