View Javadoc

1   package org.apache.continuum.buildagent.taskqueue;
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.continuum.buildagent.buildcontext.BuildContext;
23  import org.apache.continuum.utils.build.BuildTrigger;
24  import org.codehaus.plexus.taskqueue.Task;
25  
26  import java.util.List;
27  
28  public class PrepareBuildProjectsTask
29      implements Task
30  {
31      private final List<BuildContext> buildContexts;
32  
33      private BuildTrigger buildTrigger;
34  
35      private final int projectGroupId;
36  
37      private final String scmRootAddress;
38  
39      private final int scmRootId;
40  
41      public PrepareBuildProjectsTask( List<BuildContext> buildContexts, BuildTrigger buildTrigger, int projectGroupId,
42                                       String scmRootAddress, int scmRootId )
43      {
44          this.buildContexts = buildContexts;
45          this.buildTrigger = buildTrigger;
46          this.projectGroupId = projectGroupId;
47          this.scmRootAddress = scmRootAddress;
48          this.scmRootId = scmRootId;
49      }
50  
51      public long getMaxExecutionTime()
52      {
53          // TODO Auto-generated method stub
54          return 0;
55      }
56  
57      public List<BuildContext> getBuildContexts()
58      {
59          return buildContexts;
60      }
61  
62      public BuildTrigger getBuildTrigger()
63      {
64          return buildTrigger;
65      }
66  
67      public int getProjectGroupId()
68      {
69          return projectGroupId;
70      }
71  
72      public String getScmRootAddress()
73      {
74          return scmRootAddress;
75      }
76  
77      public int getScmRootId()
78      {
79          return scmRootId;
80      }
81  
82      public int getHashCode()
83      {
84          return projectGroupId + scmRootId + buildTrigger.getTrigger();
85      }
86  }