View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello
4    any modifications will be overwritten.
5    ==============================================================
6    */
7   
8   package org.apache.maven.continuum.model.project;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
12  //---------------------------------/
13  
14  import org.apache.continuum.model.project.ProjectScmRoot;
15  import org.apache.continuum.model.release.ContinuumReleaseResult;
16  import org.apache.continuum.model.repository.AbstractPurgeConfiguration;
17  import org.apache.continuum.model.repository.DirectoryPurgeConfiguration;
18  import org.apache.continuum.model.repository.DistributedDirectoryPurgeConfiguration;
19  import org.apache.continuum.model.repository.LocalRepository;
20  import org.apache.continuum.model.repository.RepositoryPurgeConfiguration;
21  import org.apache.maven.continuum.model.scm.ChangeFile;
22  import org.apache.maven.continuum.model.scm.ChangeSet;
23  import org.apache.maven.continuum.model.scm.ScmResult;
24  import org.apache.maven.continuum.model.system.Installation;
25  import org.apache.maven.continuum.model.system.NotificationAddress;
26  import org.apache.maven.continuum.model.system.Profile;
27  import org.apache.maven.continuum.model.system.SystemConfiguration;
28  import org.apache.maven.continuum.project.ContinuumProjectState;
29  
30  /**
31   * 
32   *         Configures one method for notifying users/developers
33   * when a build breaks.
34   *       
35   * 
36   * @version $Revision$ $Date$
37   */
38  @SuppressWarnings( "all" )
39  public class ProjectNotifier
40      implements java.io.Serializable
41  {
42  
43        //--------------------------/
44       //- Class/Member Variables -/
45      //--------------------------/
46  
47      /**
48       * Field id.
49       */
50      private int id = 0;
51  
52      /**
53       * The mechanism used to deliver notifications.
54       */
55      private String type = "mail";
56  
57      /**
58       * The origin of the notifier (pom or user).
59       */
60      private int from = 0;
61  
62      /**
63       * Field enabled.
64       */
65      private boolean enabled = true;
66  
67      /**
68       * Field recipientType.
69       */
70      private int recipientType = 0;
71  
72      /**
73       * Field sendOnSuccess.
74       */
75      private boolean sendOnSuccess = true;
76  
77      /**
78       * Field sendOnFailure.
79       */
80      private boolean sendOnFailure = true;
81  
82      /**
83       * Field sendOnError.
84       */
85      private boolean sendOnError = true;
86  
87      /**
88       * Field sendOnWarning.
89       */
90      private boolean sendOnWarning = true;
91  
92      /**
93       * Field configuration.
94       */
95      private java.util.Map configuration;
96  
97      /**
98       * Field sendOnScmFailure.
99       */
100     private boolean sendOnScmFailure = false;
101 
102 
103       //-----------/
104      //- Methods -/
105     //-----------/
106 
107     /**
108      * Method addConfiguration.
109      * 
110      * @param key
111      * @param value
112      */
113     public void addConfiguration( Object key, String value )
114     {
115         getConfiguration().put( key, value );
116     } //-- void addConfiguration( Object, String )
117 
118     /**
119      * Method equals.
120      * 
121      * @param other
122      * @return boolean
123      */
124     public boolean equals( Object other )
125     {
126         if ( this == other )
127         {
128             return true;
129         }
130 
131         if ( !( other instanceof ProjectNotifier ) )
132         {
133             return false;
134         }
135 
136         ProjectNotifier that = (ProjectNotifier) other;
137         boolean result = true;
138 
139         result = result && id == that.id;
140 
141         return result;
142     } //-- boolean equals( Object )
143 
144     /**
145      * Method getConfiguration.
146      * 
147      * @return Map
148      */
149     public java.util.Map getConfiguration()
150     {
151         if ( this.configuration == null )
152         {
153             this.configuration = new java.util.HashMap();
154         }
155 
156         return this.configuration;
157     } //-- java.util.Map getConfiguration()
158 
159     /**
160      * Get the origin of the notifier (pom or user).
161      * 
162      * @return int
163      */
164     public int getFrom()
165     {
166         return this.from;
167     } //-- int getFrom()
168 
169     /**
170      * Get the id field.
171      * 
172      * @return int
173      */
174     public int getId()
175     {
176         return this.id;
177     } //-- int getId()
178 
179     /**
180      * Get the recipientType field.
181      * 
182      * @return int
183      */
184     public int getRecipientType()
185     {
186         return this.recipientType;
187     } //-- int getRecipientType()
188 
189     /**
190      * Get the mechanism used to deliver notifications.
191      * 
192      * @return String
193      */
194     public String getType()
195     {
196         return this.type;
197     } //-- String getType()
198 
199     /**
200      * Method hashCode.
201      * 
202      * @return int
203      */
204     public int hashCode()
205     {
206         int result = 17;
207 
208         result = 37 * result + (int) id;
209 
210         return result;
211     } //-- int hashCode()
212 
213     /**
214      * Get the enabled field.
215      * 
216      * @return boolean
217      */
218     public boolean isEnabled()
219     {
220         return this.enabled;
221     } //-- boolean isEnabled()
222 
223     /**
224      * Get the sendOnError field.
225      * 
226      * @return boolean
227      */
228     public boolean isSendOnError()
229     {
230         return this.sendOnError;
231     } //-- boolean isSendOnError()
232 
233     /**
234      * Get the sendOnFailure field.
235      * 
236      * @return boolean
237      */
238     public boolean isSendOnFailure()
239     {
240         return this.sendOnFailure;
241     } //-- boolean isSendOnFailure()
242 
243     /**
244      * Get the sendOnScmFailure field.
245      * 
246      * @return boolean
247      */
248     public boolean isSendOnScmFailure()
249     {
250         return this.sendOnScmFailure;
251     } //-- boolean isSendOnScmFailure()
252 
253     /**
254      * Get the sendOnSuccess field.
255      * 
256      * @return boolean
257      */
258     public boolean isSendOnSuccess()
259     {
260         return this.sendOnSuccess;
261     } //-- boolean isSendOnSuccess()
262 
263     /**
264      * Get the sendOnWarning field.
265      * 
266      * @return boolean
267      */
268     public boolean isSendOnWarning()
269     {
270         return this.sendOnWarning;
271     } //-- boolean isSendOnWarning()
272 
273     /**
274      * Set extended configuration specific to this notifier goes
275      * here.
276      * 
277      * @param configuration
278      */
279     public void setConfiguration( java.util.Map configuration )
280     {
281         this.configuration = configuration;
282     } //-- void setConfiguration( java.util.Map )
283 
284     /**
285      * Set the enabled field.
286      * 
287      * @param enabled
288      */
289     public void setEnabled( boolean enabled )
290     {
291         this.enabled = enabled;
292     } //-- void setEnabled( boolean )
293 
294     /**
295      * Set the origin of the notifier (pom or user).
296      * 
297      * @param from
298      */
299     public void setFrom( int from )
300     {
301         this.from = from;
302     } //-- void setFrom( int )
303 
304     /**
305      * Set the id field.
306      * 
307      * @param id
308      */
309     public void setId( int id )
310     {
311         this.id = id;
312     } //-- void setId( int )
313 
314     /**
315      * Set the recipientType field.
316      * 
317      * @param recipientType
318      */
319     public void setRecipientType( int recipientType )
320     {
321         this.recipientType = recipientType;
322     } //-- void setRecipientType( int )
323 
324     /**
325      * Set the sendOnError field.
326      * 
327      * @param sendOnError
328      */
329     public void setSendOnError( boolean sendOnError )
330     {
331         this.sendOnError = sendOnError;
332     } //-- void setSendOnError( boolean )
333 
334     /**
335      * Set the sendOnFailure field.
336      * 
337      * @param sendOnFailure
338      */
339     public void setSendOnFailure( boolean sendOnFailure )
340     {
341         this.sendOnFailure = sendOnFailure;
342     } //-- void setSendOnFailure( boolean )
343 
344     /**
345      * Set the sendOnScmFailure field.
346      * 
347      * @param sendOnScmFailure
348      */
349     public void setSendOnScmFailure( boolean sendOnScmFailure )
350     {
351         this.sendOnScmFailure = sendOnScmFailure;
352     } //-- void setSendOnScmFailure( boolean )
353 
354     /**
355      * Set the sendOnSuccess field.
356      * 
357      * @param sendOnSuccess
358      */
359     public void setSendOnSuccess( boolean sendOnSuccess )
360     {
361         this.sendOnSuccess = sendOnSuccess;
362     } //-- void setSendOnSuccess( boolean )
363 
364     /**
365      * Set the sendOnWarning field.
366      * 
367      * @param sendOnWarning
368      */
369     public void setSendOnWarning( boolean sendOnWarning )
370     {
371         this.sendOnWarning = sendOnWarning;
372     } //-- void setSendOnWarning( boolean )
373 
374     /**
375      * Set the mechanism used to deliver notifications.
376      * 
377      * @param type
378      */
379     public void setType( String type )
380     {
381         this.type = type;
382     } //-- void setType( String )
383 
384     /**
385      * Method toString.
386      * 
387      * @return String
388      */
389     public java.lang.String toString()
390     {
391         StringBuilder buf = new StringBuilder( 128 );
392 
393         buf.append( "id = '" );
394         buf.append( getId() );
395         buf.append( "'" );
396 
397         return buf.toString();
398     } //-- java.lang.String toString()
399 
400     
401 
402               public static final int FROM_PROJECT = 1;
403 
404               public static final int FROM_USER = 2;
405 
406               public boolean isFromProject()
407               {
408                   return from == FROM_PROJECT;
409               }
410 
411               public boolean isFromUser()
412               {
413                   return from == FROM_USER;
414               }
415           
416 }