continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r209320 - in /maven/continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/core/action/ continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/ continuum-notifiers/continuum-notifier-irc/src/main/java/or...
Date Tue, 05 Jul 2005 20:42:17 GMT
Author: trygvis
Date: Tue Jul  5 13:42:15 2005
New Revision: 209320

URL: http://svn.apache.org/viewcvs?rev=209320&view=rev
Log:
Fixing: http://jira.codehaus.org/browse/CONTINUUM-192: "Do not send mail if
there aren't any recipients".
o This was valid for all notifiers.
o Also, the notifiers wasn't thread safe, fixed that too.

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
    maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
    maven/continuum/trunk/continuum-notifiers/continuum-notifier-jabber/src/main/java/org/apache/maven/continuum/notification/jabber/JabberContinuumNotifier.java
    maven/continuum/trunk/continuum-notifiers/continuum-notifier-msn/src/main/java/org/apache/maven/continuum/notification/msn/MsnContinuumNotifier.java

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java?rev=209320&r1=209319&r2=209320&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
Tue Jul  5 13:42:15 2005
@@ -34,6 +34,7 @@
 
 import java.io.File;
 import java.util.Map;
+import java.util.Iterator;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -225,6 +226,14 @@
 
         if ( value == null )
         {
+            System.err.println( "context" );
+            for ( Iterator it = context.keySet().iterator(); it.hasNext(); )
+            {
+                String s = (String) it.next();
+
+                System.err.println( s );
+            }
+
             throw new RuntimeException( "Missing value for key '" + key + "'." );
         }
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java?rev=209320&r1=209319&r2=209320&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java
Tue Jul  5 13:42:15 2005
@@ -19,7 +19,6 @@
 import java.util.Map;
 
 import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.store.AbstractContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
 import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java?rev=209320&r1=209319&r2=209320&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
Tue Jul  5 13:42:15 2005
@@ -57,26 +57,38 @@
     // Requirements
     // ----------------------------------------------------------------------
 
-    /** @plexus.requirement */
+    /**
+     * @plexus.requirement
+     */
     private VelocityComponent velocity;
 
-    /** @plexus.configuration */
+    /**
+     * @plexus.configuration
+     */
     private ContinuumStore store;
 
-    /** @plexus.configuration */
+    /**
+     * @plexus.configuration
+     */
     private MailSender mailSender;
 
     // ----------------------------------------------------------------------
     // Configuration
     // ----------------------------------------------------------------------
 
-    /** @plexus.configuration */
+    /**
+     * @plexus.configuration
+     */
     private String fromMailbox;
 
-    /** @plexus.configuration */
+    /**
+     * @plexus.configuration
+     */
     private String fromName;
 
-    /** @plexus.configuration */
+    /**
+     * @plexus.configuration
+     */
     private String timestampFormat;
 
     // ----------------------------------------------------------------------
@@ -87,8 +99,6 @@
 
     private FormatterTool formatterTool;
 
-    private Map configuration;
-
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -147,11 +157,12 @@
     // Notifier Implementation
     // ----------------------------------------------------------------------
 
-    public void sendNotification( String source, Set recipients, Map configuration, Map context
)
+    public void sendNotification( String source,
+                                  Set recipients,
+                                  Map configuration,
+                                  Map context )
         throws NotificationException
     {
-        this.configuration = configuration;
-
         ContinuumProject project = (ContinuumProject) context.get( ContinuumNotificationDispatcher.CONTEXT_PROJECT
);
 
         ContinuumBuild build = (ContinuumBuild) context.get( ContinuumNotificationDispatcher.CONTEXT_BUILD
);
@@ -166,6 +177,17 @@
         }
 
         // ----------------------------------------------------------------------
+        //
+        // ----------------------------------------------------------------------
+
+        if ( recipients.size() == 0 )
+        {
+            getLogger().info( "No mail recipients for '" + project.getName() + "'." );
+
+            return;
+        }
+
+        // ----------------------------------------------------------------------
         // Generate and send email
         // ----------------------------------------------------------------------
 
@@ -173,7 +195,7 @@
         {
             if ( source.equals( ContinuumNotificationDispatcher.MESSAGE_ID_BUILD_COMPLETE
) )
             {
-                buildComplete( project, build, source, recipients );
+                buildComplete( project, build, source, recipients, configuration );
             }
         }
         catch ( ContinuumException e )
@@ -185,7 +207,8 @@
     private void buildComplete( ContinuumProject project,
                                 ContinuumBuild build,
                                 String source,
-                                Set recipients )
+                                Set recipients,
+                                Map configuration )
         throws ContinuumException
     {
         // ----------------------------------------------------------------------
@@ -260,7 +283,7 @@
 
         String subject = generateSubject( project, build );
 
-        sendMessage( project, recipients, subject, content );
+        sendMessage( project, recipients, subject, content, configuration );
     }
 
     // ----------------------------------------------------------------------
@@ -291,10 +314,14 @@
         }
     }
 
-    private void sendMessage( ContinuumProject project, Set recipients, String subject, String
content )
+    private void sendMessage( ContinuumProject project,
+                              Set recipients,
+                              String subject,
+                              String content,
+                              Map configuration )
         throws ContinuumException
     {
-        String fromMailbox = getFromMailbox();
+        String fromMailbox = getFromMailbox( configuration );
 
         if ( fromMailbox == null )
         {
@@ -343,7 +370,7 @@
         }
     }
 
-    private String getFromMailbox()
+    private String getFromMailbox( Map configuration )
     {
         if ( fromMailbox != null )
         {

Modified: maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java?rev=209320&r1=209319&r2=209320&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
(original)
+++ maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
Tue Jul  5 13:42:15 2005
@@ -44,27 +44,26 @@
     // Requirements
     // ----------------------------------------------------------------------
 
-    /** @plexus.configuration */
+    /**
+     * @plexus.configuration
+     */
     private ContinuumStore store;
 
-    /** @plexus.configuration */
+    /**
+     * @plexus.configuration
+     */
     private IrcBot ircClient;
 
     // ----------------------------------------------------------------------
-    //
-    // ----------------------------------------------------------------------
-
-    private Map configuration;
-
-    // ----------------------------------------------------------------------
     // Notifier Implementation
     // ----------------------------------------------------------------------
 
-    public void sendNotification( String source, Set recipients, Map configuration, Map context
)
+    public void sendNotification( String source,
+                                  Set recipients,
+                                  Map configuration,
+                                  Map context )
         throws NotificationException
     {
-        this.configuration = configuration;
-
         ContinuumProject project = (ContinuumProject) context.get( ContinuumNotificationDispatcher.CONTEXT_PROJECT
);
 
         ContinuumBuild build = (ContinuumBuild) context.get( ContinuumNotificationDispatcher.CONTEXT_BUILD
);
@@ -77,6 +76,16 @@
         {
             return;
         }
+        // ----------------------------------------------------------------------
+        //
+        // ----------------------------------------------------------------------
+
+        if ( recipients.size() == 0 )
+        {
+            getLogger().info( "No IRC recipients for '" + project.getName() + "'." );
+
+            return;
+        }
 
         // ----------------------------------------------------------------------
         // Generate and send message
@@ -86,7 +95,7 @@
         {
             if ( source.equals( ContinuumNotificationDispatcher.MESSAGE_ID_BUILD_COMPLETE
) )
             {
-                buildComplete( project, build );
+                buildComplete( project, build, configuration );
             }
         }
         catch ( ContinuumException e )
@@ -96,7 +105,8 @@
     }
 
     private void buildComplete( ContinuumProject project,
-                                ContinuumBuild build )
+                                ContinuumBuild build,
+                                Map configuration )
         throws ContinuumException
     {
         // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-notifiers/continuum-notifier-jabber/src/main/java/org/apache/maven/continuum/notification/jabber/JabberContinuumNotifier.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-notifiers/continuum-notifier-jabber/src/main/java/org/apache/maven/continuum/notification/jabber/JabberContinuumNotifier.java?rev=209320&r1=209319&r2=209320&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-notifiers/continuum-notifier-jabber/src/main/java/org/apache/maven/continuum/notification/jabber/JabberContinuumNotifier.java
(original)
+++ maven/continuum/trunk/continuum-notifiers/continuum-notifier-jabber/src/main/java/org/apache/maven/continuum/notification/jabber/JabberContinuumNotifier.java
Tue Jul  5 13:42:15 2005
@@ -23,7 +23,6 @@
 import org.codehaus.plexus.jabber.JabberClientException;
 import org.codehaus.plexus.notification.NotificationException;
 import org.codehaus.plexus.notification.notifier.AbstractNotifier;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.util.StringUtils;
 
 import java.util.Iterator;
@@ -37,13 +36,14 @@
  */
 public class JabberContinuumNotifier
     extends AbstractNotifier
-    implements Initializable
 {
     // ----------------------------------------------------------------------
     // Requirements
     // ----------------------------------------------------------------------
 
-    /** @plexus.requirement */
+    /**
+     * @plexus.requirement
+     */
     private JabberClient jabberClient;
 
     // ----------------------------------------------------------------------
@@ -71,59 +71,57 @@
     private String port;
 
     // ----------------------------------------------------------------------
-    //
-    // ----------------------------------------------------------------------
-
-    private Map configuration;
-
-    private Set recipients;
-
-    // ----------------------------------------------------------------------
-    // Component Lifecycle
-    // ----------------------------------------------------------------------
-
-    public void initialize()
-    {
-    }
-
-    // ----------------------------------------------------------------------
     // Notifier Implementation
     // ----------------------------------------------------------------------
 
-    public void sendNotification( String source, Set recipients, Map configuration, Map context
)
+    public void sendNotification( String source,
+                                  Set recipients,
+                                  Map configuration,
+                                  Map context )
         throws NotificationException
     {
-        this.configuration = configuration;
-
-        this.recipients = recipients;
-
         ContinuumProject project = (ContinuumProject) context.get( ContinuumNotificationDispatcher.CONTEXT_PROJECT
);
 
         ContinuumBuild build = (ContinuumBuild) context.get( ContinuumNotificationDispatcher.CONTEXT_BUILD
);
 
+        // ----------------------------------------------------------------------
+        //
+        // ----------------------------------------------------------------------
+
+        if ( recipients.size() == 0 )
+        {
+            getLogger().info( "No mail recipients for '" + project.getName() + "'." );
+
+            return;
+        }
+
+        // ----------------------------------------------------------------------
+        //
+        // ----------------------------------------------------------------------
+
         if ( source.equals( ContinuumNotificationDispatcher.MESSAGE_ID_BUILD_STARTED ) )
         {
-            buildStarted( project );
+            buildStarted( project, recipients, configuration );
         }
         else if ( source.equals( ContinuumNotificationDispatcher.MESSAGE_ID_CHECKOUT_STARTED
) )
         {
-            checkoutStarted( project );
+            checkoutStarted( project, recipients, configuration );
         }
         else if ( source.equals( ContinuumNotificationDispatcher.MESSAGE_ID_CHECKOUT_COMPLETE
) )
         {
-            checkoutComplete( project );
+            checkoutComplete( project, recipients, configuration );
         }
         else if ( source.equals( ContinuumNotificationDispatcher.MESSAGE_ID_RUNNING_GOALS
) )
         {
-            runningGoals( project, build );
+            runningGoals( project, build, recipients, configuration );
         }
         else if ( source.equals( ContinuumNotificationDispatcher.MESSAGE_ID_GOALS_COMPLETED
) )
         {
-            goalsCompleted( project, build );
+            goalsCompleted( project, build, recipients, configuration );
         }
         else if ( source.equals( ContinuumNotificationDispatcher.MESSAGE_ID_BUILD_COMPLETE
) )
         {
-            buildComplete( project, build );
+            buildComplete( project, build, recipients, configuration );
         }
         else
         {
@@ -135,71 +133,75 @@
     //
     // ----------------------------------------------------------------------
 
-    private void buildStarted( ContinuumProject project )
+    private void buildStarted( ContinuumProject project, Set recipients, Map configuration
)
     throws NotificationException
     {
-        sendMessage( project, null, "Build started." );
+        sendMessage( project, null, "Build started.", recipients, configuration );
     }
 
-    private void checkoutStarted( ContinuumProject project )
+    private void checkoutStarted( ContinuumProject project, Set recipients, Map configuration
)
     throws NotificationException
     {
-        sendMessage( project, null, "Checkout started." );
+        sendMessage( project, null, "Checkout started.", recipients, configuration );
     }
 
-    private void checkoutComplete( ContinuumProject project )
+    private void checkoutComplete( ContinuumProject project, Set recipients, Map configuration
)
     throws NotificationException
     {
-        sendMessage( project, null, "Checkout complete." );
+        sendMessage( project, null, "Checkout complete.", recipients, configuration );
     }
 
-    private void runningGoals( ContinuumProject project, ContinuumBuild build )
+    private void runningGoals( ContinuumProject project, ContinuumBuild build, Set recipients,
Map configuration )
     throws NotificationException
     {
-        sendMessage( project, build, "Running goals." );
+        sendMessage( project, build, "Running goals.", recipients, configuration );
     }
 
-    private void goalsCompleted( ContinuumProject project, ContinuumBuild build )
+    private void goalsCompleted( ContinuumProject project, ContinuumBuild build, Set recipients,
Map configuration )
     throws NotificationException
     {
         if ( build.getError() == null )
         {
-            sendMessage( project, build, "Goals completed. state: " + build.getState() );
+            sendMessage( project, build, "Goals completed. state: " + build.getState(), recipients,
configuration );
         }
         else
         {
-            sendMessage( project, build, "Goals completed." );
+            sendMessage( project, build, "Goals completed.", recipients, configuration );
         }
     }
 
-    private void buildComplete( ContinuumProject project, ContinuumBuild build )
+    private void buildComplete( ContinuumProject project, ContinuumBuild build, Set recipients,
Map configuration )
     throws NotificationException
     {
         if ( build.getError() == null )
         {
-            sendMessage( project, build, "Build complete. state: " + build.getState() );
+            sendMessage( project, build, "Build complete. state: " + build.getState(), recipients,
configuration );
         }
         else
         {
-            sendMessage( project, build, "Build complete." );
+            sendMessage( project, build, "Build complete.", recipients, configuration );
         }
     }
 
-    private void sendMessage( ContinuumProject project, ContinuumBuild build, String msg
)
+    private void sendMessage( ContinuumProject project,
+                              ContinuumBuild build,
+                              String msg,
+                              Set recipients,
+                              Map configuration )
         throws NotificationException
     {
         String message = "Build event for project '" + project.getName() + "':" + msg;
 
-        jabberClient.setHost( getHost() );
+        jabberClient.setHost( getHost( configuration ) );
 
         if ( configuration.containsKey( "port" ) )
         {
             jabberClient.setPort( ( (Integer) configuration.get( "port" ) ).intValue() );
         }
 
-        jabberClient.setUser( getUsername() );
+        jabberClient.setUser( getUsername( configuration ) );
 
-        jabberClient.setPassword( getPassword() );
+        jabberClient.setPassword( getPassword( configuration ) );
 
         try
         {
@@ -211,7 +213,7 @@
             {
                 String recipient = (String) i.next();
 
-                if ( isGroup() )
+                if ( isGroup( configuration ) )
                 {
                     jabberClient.sendMessageToGroup( recipient, message );
                 }
@@ -243,16 +245,13 @@
         }
     }
 
-    /**
-     * @see org.codehaus.plexus.notification.notifier.Notifier#sendNotification(java.lang.String,
java.util.Set, java.util.Properties)
-     */
     public void sendNotification( String arg0, Set arg1, Properties arg2 )
         throws NotificationException
     {
         throw new NotificationException( "Not implemented." );
     }
 
-    private String getHost()
+    private String getHost( Map configuration )
     {
         if ( configuration.containsKey( "host" ) )
         {
@@ -274,7 +273,7 @@
         return host;
     }
 
-    private String getUsername()
+    private String getUsername( Map configuration )
     {
         if ( configuration.containsKey( "address" ) )
         {
@@ -291,7 +290,7 @@
         return fromAddress;
     }
 
-    private String getPassword()
+    private String getPassword( Map configuration )
     {
         if ( configuration.containsKey( "password" ) )
         {
@@ -303,7 +302,7 @@
         return fromPassword;
     }
 
-    private boolean isGroup()
+    private boolean isGroup( Map configuration )
     {
         if ( configuration.containsKey( "isGroup" ) )
         {

Modified: maven/continuum/trunk/continuum-notifiers/continuum-notifier-msn/src/main/java/org/apache/maven/continuum/notification/msn/MsnContinuumNotifier.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-notifiers/continuum-notifier-msn/src/main/java/org/apache/maven/continuum/notification/msn/MsnContinuumNotifier.java?rev=209320&r1=209319&r2=209320&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-notifiers/continuum-notifier-msn/src/main/java/org/apache/maven/continuum/notification/msn/MsnContinuumNotifier.java
(original)
+++ maven/continuum/trunk/continuum-notifiers/continuum-notifier-msn/src/main/java/org/apache/maven/continuum/notification/msn/MsnContinuumNotifier.java
Tue Jul  5 13:42:15 2005
@@ -16,34 +16,35 @@
  * limitations under the License.
  */
 
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumProject;
+
 import org.codehaus.plexus.msn.MsnClient;
 import org.codehaus.plexus.msn.MsnException;
 import org.codehaus.plexus.notification.NotificationException;
 import org.codehaus.plexus.notification.notifier.AbstractNotifier;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id: $
  */
 public class MsnContinuumNotifier
     extends AbstractNotifier
-    implements Initializable
 {
     // ----------------------------------------------------------------------
     // Requirements
     // ----------------------------------------------------------------------
 
-    /** @plexus.requirement */
+    /**
+     * @plexus.requirement
+     */
     private MsnClient msnClient;
 
     // ----------------------------------------------------------------------
@@ -64,56 +65,58 @@
     //
     // ----------------------------------------------------------------------
 
-    private Map configuration;
-
-    private Set recipients;
-
-    // ----------------------------------------------------------------------
-    // Component Lifecycle
-    // ----------------------------------------------------------------------
-
-    public void initialize()
-    {
-    }
-
     // ----------------------------------------------------------------------
     // Notifier Implementation
     // ----------------------------------------------------------------------
 
-    public void sendNotification( String source, Set recipients, Map configuration, Map context
)
+    public void sendNotification( String source,
+                                  Set recipients,
+                                  Map configuration,
+                                  Map context )
         throws NotificationException
     {
-        this.configuration = configuration;
-
-        this.recipients = recipients;
-
         ContinuumProject project = (ContinuumProject) context.get( ContinuumNotificationDispatcher.CONTEXT_PROJECT
);
 
         ContinuumBuild build = (ContinuumBuild) context.get( ContinuumNotificationDispatcher.CONTEXT_BUILD
);
 
+        // ----------------------------------------------------------------------
+        //
+        // ----------------------------------------------------------------------
+
+        if ( recipients.size() == 0 )
+        {
+            getLogger().info( "No mail recipients for '" + project.getName() + "'." );
+
+            return;
+        }
+
+        // ----------------------------------------------------------------------
+        //
+        // ----------------------------------------------------------------------
+
         if ( source.equals( ContinuumNotificationDispatcher.MESSAGE_ID_BUILD_STARTED ) )
         {
-            buildStarted( project );
+            buildStarted( project, recipients, configuration );
         }
         else if ( source.equals( ContinuumNotificationDispatcher.MESSAGE_ID_CHECKOUT_STARTED
) )
         {
-            checkoutStarted( project );
+            checkoutStarted( project, recipients, configuration );
         }
         else if ( source.equals( ContinuumNotificationDispatcher.MESSAGE_ID_CHECKOUT_COMPLETE
) )
         {
-            checkoutComplete( project );
+            checkoutComplete( project, recipients, configuration );
         }
         else if ( source.equals( ContinuumNotificationDispatcher.MESSAGE_ID_RUNNING_GOALS
) )
         {
-            runningGoals( project, build );
+            runningGoals( project, build, recipients, configuration );
         }
         else if ( source.equals( ContinuumNotificationDispatcher.MESSAGE_ID_GOALS_COMPLETED
) )
         {
-            goalsCompleted( project, build );
+            goalsCompleted( project, build, recipients, configuration );
         }
         else if ( source.equals( ContinuumNotificationDispatcher.MESSAGE_ID_BUILD_COMPLETE
) )
         {
-            buildComplete( project, build );
+            buildComplete( project, build, recipients, configuration );
         }
         else
         {
@@ -125,64 +128,68 @@
     //
     // ----------------------------------------------------------------------
 
-    private void buildStarted( ContinuumProject project )
-    throws NotificationException
+    private void buildStarted( ContinuumProject project, Set recipients, Map configuration
)
+        throws NotificationException
     {
-        sendMessage( project, null, "Build started." );
+        sendMessage( project, null, "Build started.", recipients, configuration );
     }
 
-    private void checkoutStarted( ContinuumProject project )
-    throws NotificationException
+    private void checkoutStarted( ContinuumProject project, Set recipients, Map configuration
)
+        throws NotificationException
     {
-        sendMessage( project, null, "Checkout started." );
+        sendMessage( project, null, "Checkout started.", recipients, configuration );
     }
 
-    private void checkoutComplete( ContinuumProject project )
-    throws NotificationException
+    private void checkoutComplete( ContinuumProject project, Set recipients, Map configuration
)
+        throws NotificationException
     {
-        sendMessage( project, null, "Checkout complete." );
+        sendMessage( project, null, "Checkout complete.", recipients, configuration );
     }
 
-    private void runningGoals( ContinuumProject project, ContinuumBuild build )
-    throws NotificationException
+    private void runningGoals( ContinuumProject project, ContinuumBuild build, Set recipients,
Map configuration )
+        throws NotificationException
     {
-        sendMessage( project, build, "Running goals." );
+        sendMessage( project, build, "Running goals.", recipients, configuration );
     }
 
-    private void goalsCompleted( ContinuumProject project, ContinuumBuild build )
-    throws NotificationException
+    private void goalsCompleted( ContinuumProject project, ContinuumBuild build, Set recipients,
Map configuration )
+        throws NotificationException
     {
         if ( build.getError() == null )
         {
-            sendMessage( project, build, "Goals completed. state: " + build.getState() );
+            sendMessage( project, build, "Goals completed. state: " + build.getState(), recipients,
configuration );
         }
         else
         {
-            sendMessage( project, build, "Goals completed." );
+            sendMessage( project, build, "Goals completed.", recipients, configuration );
         }
     }
 
-    private void buildComplete( ContinuumProject project, ContinuumBuild build )
-    throws NotificationException
+    private void buildComplete( ContinuumProject project, ContinuumBuild build, Set recipients,
Map configuration )
+        throws NotificationException
     {
         if ( build.getError() == null )
         {
-            sendMessage( project, build, "Build complete. state: " + build.getState() );
+            sendMessage( project, build, "Build complete. state: " + build.getState(), recipients,
configuration );
         }
         else
         {
-            sendMessage( project, build, "Build complete." );
+            sendMessage( project, build, "Build complete.", recipients, configuration );
         }
     }
 
-    private void sendMessage( ContinuumProject project, ContinuumBuild build, String msg
)
+    private void sendMessage( ContinuumProject project,
+                              ContinuumBuild build,
+                              String msg,
+                              Set recipients,
+                              Map configuration )
         throws NotificationException
     {
         String message = "Build event for project '" + project.getName() + "':" + msg;
 
-        msnClient.setLogin( getUsername() );
+        msnClient.setLogin( getUsername( configuration ) );
 
-        msnClient.setPassword( getPassword() );
+        msnClient.setPassword( getPassword( configuration ) );
 
         try
         {
@@ -226,7 +233,7 @@
         throw new NotificationException( "Not implemented." );
     }
 
-    private String getUsername()
+    private String getUsername( Map configuration )
     {
         if ( configuration.containsKey( "address" ) )
         {
@@ -243,7 +250,7 @@
         return fromAddress;
     }
 
-    private String getPassword()
+    private String getPassword( Map configuration )
     {
         if ( configuration.containsKey( "password" ) )
         {



Mime
View raw message