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