View Javadoc

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