camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r782681 - /camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
Date Mon, 08 Jun 2009 15:39:48 GMT
Author: davsclaus
Date: Mon Jun  8 15:39:48 2009
New Revision: 782681

URL: http://svn.apache.org/viewvc?rev=782681&view=rev
Log:
CAMEL-1676: participant is optional so default to use user if not provided.

Modified:
    camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java

Modified: camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java?rev=782681&r1=782680&r2=782681&view=diff
==============================================================================
--- camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
(original)
+++ camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
Mon Jun  8 15:39:48 2009
@@ -73,10 +73,10 @@
         if (room != null) {
             return createGroupChatProducer();
         } else {
-            if (participant == null) {
+            if (getParticipant() == null) {
                 throw new IllegalArgumentException("No room or participant configured on
this endpoint: " + this);
             }
-            return createPrivateChatProducer(participant);
+            return createPrivateChatProducer(getParticipant());
         }
     }
 
@@ -103,7 +103,7 @@
 
     @Override
     protected String createEndpointUri() {
-        return "xmpp://" + host + ":" + port + "/" + participant + "?serviceName=" + serviceName;
+        return "xmpp://" + host + ":" + port + "/" + getParticipant() + "?serviceName=" +
serviceName;
     }
 
     public boolean isSingleton() {
@@ -266,7 +266,8 @@
     }
 
     public String getParticipant() {
-        return participant;
+        // participant is optional so use user if not provided
+        return participant != null ? participant : user;
     }
 
     public void setParticipant(String participant) {



Mime
View raw message