View Javadoc

1   package org.apache.maven.continuum.buildcontroller;
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.BuildResult;
24  import org.apache.maven.continuum.model.project.Project;
25  import org.apache.maven.continuum.model.project.ProjectDependency;
26  import org.apache.maven.continuum.model.scm.ScmResult;
27  
28  import java.util.ArrayList;
29  import java.util.HashMap;
30  import java.util.List;
31  import java.util.Map;
32  
33  /**
34   * This class holds build context information.
35   *
36   * @author <a href="mailto:kenney@apache.org">Kenney Westerhof</a>
37   */
38  public class BuildContext
39  {
40      private long startTime;
41  
42      private Project project;
43  
44      private BuildDefinition buildDefinition;
45  
46      private BuildResult oldBuildResult;
47  
48      private ScmResult oldScmResult;
49  
50      private Map<String, Object> actionContext;
51  
52      private ScmResult scmResult;
53  
54      private int trigger;
55  
56      private BuildResult buildResult;
57  
58      private List<ProjectDependency> modifiedDependencies;
59  
60      private boolean cancelled;
61  
62      public void setStartTime( long startTime )
63      {
64          this.startTime = startTime;
65      }
66  
67      public long getStartTime()
68      {
69          return startTime;
70      }
71  
72      public void setProject( Project project )
73      {
74          this.project = project;
75      }
76  
77      public Project getProject()
78      {
79          return project;
80      }
81  
82      public void setBuildDefinition( BuildDefinition buildDefinition )
83      {
84          this.buildDefinition = buildDefinition;
85      }
86  
87      public BuildDefinition getBuildDefinition()
88      {
89          return buildDefinition;
90      }
91  
92      public void setBuildResult( BuildResult build )
93      {
94          this.buildResult = build;
95      }
96  
97      public BuildResult getBuildResult()
98      {
99          return buildResult;
100     }
101 
102     public void setOldBuildResult( BuildResult buildResult )
103     {
104         this.oldBuildResult = buildResult;
105     }
106 
107     public BuildResult getOldBuildResult()
108     {
109         return oldBuildResult;
110     }
111 
112     public void setOldScmResult( ScmResult oldScmResult )
113     {
114         this.oldScmResult = oldScmResult;
115     }
116 
117     public ScmResult getOldScmResult()
118     {
119         return oldScmResult;
120     }
121 
122     public void setScmResult( ScmResult scmResult )
123     {
124         this.scmResult = scmResult;
125     }
126 
127     public ScmResult getScmResult()
128     {
129         return scmResult;
130     }
131 
132     public Map<String, Object> getActionContext()
133     {
134         if ( actionContext == null )
135         {
136             actionContext = new HashMap<String, Object>();
137         }
138         return actionContext;
139     }
140 
141     public int getTrigger()
142     {
143         return trigger;
144     }
145 
146     public void setTrigger( int trigger )
147     {
148         this.trigger = trigger;
149     }
150 
151     public List<ProjectDependency> getModifiedDependencies()
152     {
153         if ( modifiedDependencies == null )
154         {
155             modifiedDependencies = new ArrayList<ProjectDependency>();
156         }
157         return modifiedDependencies;
158     }
159 
160     public void setModifiedDependencies( List<ProjectDependency> modifiedDependencies )
161     {
162         this.modifiedDependencies = modifiedDependencies;
163     }
164 
165     public boolean isCancelled()
166     {
167         return cancelled;
168     }
169 
170     public void setCancelled( boolean cancelled )
171     {
172         this.cancelled = cancelled;
173     }
174 }