continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r574205 - in /maven/continuum/trunk: continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/ continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/ continuum-webapp/src/m...
Date Mon, 10 Sep 2007 11:33:19 GMT
Author: evenisse
Date: Mon Sep 10 04:33:19 2007
New Revision: 574205

URL: http://svn.apache.org/viewvc?rev=574205&view=rev
Log:
Add alternate nick, and username to irc notifier

Modified:
    maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/IrcGroupNotifierEditAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/IrcProjectNotifierEditAction.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/notifier/notifierIrc.jsp

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/viewvc/maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java?rev=574205&r1=574204&r2=574205&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
Mon Sep 10 04:33:19 2007
@@ -96,8 +96,11 @@
         {
             String key = keys.next();
             IRCConnection connection = hostConnections.get( key );
-            connection.doQuit( "Continuum shutting down" );
-            connection.close();
+            if ( connection.isConnected() )
+            {
+                connection.doQuit( "Continuum shutting down" );
+                connection.close();
+            }
         }
 
     }
@@ -105,8 +108,8 @@
     // ----------------------------------------------------------------------
     // Internal connections 
     // ----------------------------------------------------------------------    
-    private IRCConnection getIRConnection( String host, int port, String password, String
nick, String userName,
-                                           String realName, String channel, boolean ssl )
+    private IRCConnection getIRConnection( String host, int port, String password, String
nick, String alternateNick,
+                                           String userName, String realName, String channel,
boolean ssl )
         throws IOException
     {
         String key = host.toUpperCase() + Integer.toString( port ) + nick.toUpperCase();
@@ -269,18 +272,32 @@
         }
         String channel = (String) configuration.get( "channel" );
 
-        String login = (String) configuration.get( "nick" );
+        String nickName = (String) configuration.get( "nick" );
+
+        if ( StringUtils.isEmpty( nickName ) )
+        {
+            nickName = "continuum";
+        }
+
+        String alternateNickName = (String) configuration.get( "alternateNick" );
+
+        if ( StringUtils.isEmpty( alternateNickName ) )
+        {
+            alternateNickName = "continuum_";
+        }
+
+        String userName = (String) configuration.get( "username" );
 
-        if ( StringUtils.isEmpty( login ) )
+        if ( StringUtils.isEmpty( userName ) )
         {
-            login = "continuum";
+            userName = nickName;
         }
 
         String fullName = (String) configuration.get( "fullName" );
 
         if ( StringUtils.isEmpty( fullName ) )
         {
-            fullName = login;
+            fullName = nickName;
         }
 
         String password = (String) configuration.get( "password" );
@@ -289,8 +306,8 @@
 
         try
         {
-            IRCConnection ircConnection =
-                getIRConnection( host, port, password, login, fullName, fullName, channel,
isSsl );
+            IRCConnection ircConnection = getIRConnection( host, port, password, nickName,
alternateNickName, userName,
+                                                           fullName, channel, isSsl );
             ircConnection.doPrivmsg( channel, generateMessage( project, build ) );
         }
         catch ( IOException e )

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/IrcGroupNotifierEditAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/IrcGroupNotifierEditAction.java?rev=574205&r1=574204&r2=574205&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/IrcGroupNotifierEditAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/IrcGroupNotifierEditAction.java
Mon Sep 10 04:33:19 2007
@@ -45,6 +45,10 @@
 
     private String nick;
 
+    private String alternateNick;
+
+    private String username;
+
     private String fullName;
 
     private String password;
@@ -64,6 +68,10 @@
 
         nick = (String) configuration.get( "nick" );
 
+        alternateNick = (String) configuration.get( "alternateNick" );
+
+        username = (String) configuration.get( "username" );
+
         fullName = (String) configuration.get( "fullName" );
 
         password = (String) configuration.get( "password" );
@@ -86,6 +94,10 @@
 
         configuration.put( "nick", nick );
 
+        configuration.put( "alternateNick", alternateNick );
+
+        configuration.put( "username", username );
+
         configuration.put( "fullName", fullName );
 
         configuration.put( "password", password );
@@ -133,6 +145,26 @@
     public void setNick( String nick )
     {
         this.nick = nick;
+    }
+
+    public String getAlternateNick()
+    {
+        return alternateNick;
+    }
+
+    public void setAlternateNick( String alternateNick )
+    {
+        this.alternateNick = alternateNick;
+    }
+
+    public String getUsername()
+    {
+        return username;
+    }
+
+    public void setUsername( String username )
+    {
+        this.username = username;
     }
 
     public String getFullName()

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/IrcProjectNotifierEditAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/IrcProjectNotifierEditAction.java?rev=574205&r1=574204&r2=574205&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/IrcProjectNotifierEditAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/notifier/IrcProjectNotifierEditAction.java
Mon Sep 10 04:33:19 2007
@@ -40,6 +40,10 @@
 
     private String nick;
 
+    private String alternateNick;
+
+    private String username;
+
     private String fullName;
 
     private String password;
@@ -59,6 +63,10 @@
 
         nick = (String) configuration.get( "nick" );
 
+        alternateNick = (String) configuration.get( "alternateNick" );
+
+        username = (String) configuration.get( "username" );
+
         fullName = (String) configuration.get( "fullName" );
 
         password = (String) configuration.get( "password" );
@@ -81,6 +89,10 @@
 
         configuration.put( "nick", nick );
 
+        configuration.put( "alternateNick", alternateNick );
+
+        configuration.put( "username", username );
+
         configuration.put( "fullName", fullName );
 
         configuration.put( "password", password );
@@ -128,6 +140,26 @@
     public void setNick( String nick )
     {
         this.nick = nick;
+    }
+
+    public String getAlternateNick()
+    {
+        return alternateNick;
+    }
+
+    public void setAlternateNick( String alternateNick )
+    {
+        this.alternateNick = alternateNick;
+    }
+
+    public String getUsername()
+    {
+        return username;
+    }
+
+    public void setUsername( String username )
+    {
+        this.username = username;
     }
 
     public String getFullName()

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=574205&r1=574204&r2=574205&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Mon Sep 10 04:33:19 2007
@@ -408,8 +408,10 @@
 notifier.irc.host.label = IRC Host
 notifier.irc.port.label = IRC port
 notifier.irc.channel.label = IRC channel
-notifier.irc.nick.label = Nick Name
-notifier.irc.fullName.label = Full Name
+notifier.irc.nick.label = Nick Name (default value is 'continuum')
+notifier.irc.alternateNick.label = Alternate Nick Name (default value is 'continuum_')
+notifier.irc.username.label = User Name (default value is the nick name)
+notifier.irc.fullName.label = Full Name (default value is the nick name)
 notifier.irc.password.label = Password
 notifier.irc.isSSL.label = SSL
 notifier.jabber.host.label = Jabber Host

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/notifier/notifierIrc.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/notifier/notifierIrc.jsp?rev=574205&r1=574204&r2=574205&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/notifier/notifierIrc.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/notifier/notifierIrc.jsp
Mon Sep 10 04:33:19 2007
@@ -55,6 +55,8 @@
                 <ww:textfield label="%{getText('notifier.irc.port.label')}" name="port"/>
                 <ww:textfield label="%{getText('notifier.irc.channel.label')}" name="channel"
required="true"/>
                 <ww:textfield label="%{getText('notifier.irc.nick.label')}" name="nick"/>
+                <ww:textfield label="%{getText('notifier.irc.alternateNick.label')}" name="alternateNick"/>
+                <ww:textfield label="%{getText('notifier.irc.username.label')}" name="username"/>
                 <ww:textfield label="%{getText('notifier.irc.fullName.label')}" name="fullName"/>
                 <ww:password label="%{getText('notifier.irc.password.label')}" name="password"/>
                 <ww:checkbox label="%{getText('notifier.irc.isSSL.label')}" name="ssl"
value="ssl" fieldValue="true"/>



Mime
View raw message