View Javadoc

1   package org.apache.maven.continuum.builddefinition;
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.BuildDefinition;
23  import org.apache.maven.continuum.model.project.BuildDefinitionTemplate;
24  import org.apache.maven.continuum.model.project.Project;
25  import org.apache.maven.continuum.model.project.ProjectGroup;
26  import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
27  
28  import java.util.List;
29  
30  /**
31   * @author <a href="mailto:olamy@apache.org">olamy</a>
32   * @version $Id: BuildDefinitionService.java 1372267 2012-08-13 05:47:30Z brett $
33   * @since 15 sept. 07
34   */
35  public interface BuildDefinitionService
36  {
37  
38      /**
39       * @param buildDefinitionId
40       * @return null if not in store
41       * @throws BuildDefinitionServiceException
42       *
43       */
44      BuildDefinition getBuildDefinition( int buildDefinitionId )
45          throws BuildDefinitionServiceException;
46  
47      /**
48       * @return List<BuildDefinition> all build defintions
49       * @throws BuildDefinitionServiceException
50       *
51       */
52      List<BuildDefinition> getAllBuildDefinitions()
53          throws BuildDefinitionServiceException;
54  
55      BuildDefinition addBuildDefinition( BuildDefinition buildDefinition )
56          throws BuildDefinitionServiceException;
57  
58      void removeBuildDefinition( BuildDefinition buildDefinition )
59          throws BuildDefinitionServiceException;
60  
61      void updateBuildDefinition( BuildDefinition buildDefinition )
62          throws BuildDefinitionServiceException;
63  
64      List<BuildDefinition> getAllTemplates()
65          throws BuildDefinitionServiceException;
66  
67      /**
68       * @param buildDefinition
69       * @return clone of {@link BuildDefinition} template/continuumDefault set to false
70       */
71      BuildDefinition cloneBuildDefinition( BuildDefinition buildDefinition );
72  
73      // ------------------------------------------------------
74      //  BuildDefinitionTemplate
75      // ------------------------------------------------------
76  
77      void addTemplateInProject( int buildDefinitionTemplateId, Project project )
78          throws BuildDefinitionServiceException;
79  
80  
81      List<BuildDefinitionTemplate> getAllBuildDefinitionTemplate()
82          throws BuildDefinitionServiceException;
83  
84      BuildDefinitionTemplate getBuildDefinitionTemplate( int id )
85          throws BuildDefinitionServiceException;
86  
87      BuildDefinitionTemplate addBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate )
88          throws BuildDefinitionServiceException;
89  
90      BuildDefinitionTemplate updateBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate )
91          throws BuildDefinitionServiceException;
92  
93      void removeBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate )
94          throws BuildDefinitionServiceException;
95  
96      public BuildDefinitionTemplate addBuildDefinitionInTemplate( BuildDefinitionTemplate buildDefinitionTemplate,
97                                                                   BuildDefinition buildDefinition, boolean template )
98          throws BuildDefinitionServiceException;
99  
100     BuildDefinitionTemplate removeBuildDefinitionFromTemplate( BuildDefinitionTemplate buildDefinitionTemplate,
101                                                                BuildDefinition buildDefinition )
102         throws BuildDefinitionServiceException;
103 
104     public BuildDefinitionTemplate getDefaultAntBuildDefinitionTemplate()
105         throws BuildDefinitionServiceException;
106 
107     public BuildDefinitionTemplate getDefaultMavenOneBuildDefinitionTemplate()
108         throws BuildDefinitionServiceException;
109 
110     public BuildDefinitionTemplate getDefaultMavenTwoBuildDefinitionTemplate()
111         throws BuildDefinitionServiceException;
112 
113     public BuildDefinitionTemplate getDefaultShellBuildDefinitionTemplate()
114         throws BuildDefinitionServiceException;
115 
116     public BuildDefinitionTemplate getContinuumDefaultWithType( String type )
117         throws BuildDefinitionServiceException;
118 
119     public List<BuildDefinitionTemplate> getBuildDefinitionTemplatesWithType( String type )
120         throws BuildDefinitionServiceException;
121 
122     public ProjectGroup addBuildDefinitionTemplateToProjectGroup( int projectGroupId,
123                                                                   BuildDefinitionTemplate buildDefinitionTemplate )
124         throws BuildDefinitionServiceException, ContinuumObjectNotFoundException;
125 
126     public List<BuildDefinitionTemplate> getContinuumBuildDefinitionTemplates()
127         throws BuildDefinitionServiceException;
128 }