Author: ningjiang
Date: Mon Aug 4 23:37:23 2008
New Revision: 682599
URL: http://svn.apache.org/viewvc?rev=682599&view=rev
Log:
Fixed the CS errors in xmpp
Modified:
activemq/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
activemq/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
Modified:
activemq/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java?rev=682599&r1=682598&r2=682599&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
(original)
+++
activemq/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
Mon Aug 4 23:37:23 2008
@@ -30,7 +30,7 @@
/**
* A [EMAIL PROTECTED] org.apache.camel.Consumer Consumer} which listens to
XMPP packets
- *
+ *
* @version $Revision$
*/
public class XmppConsumer extends DefaultConsumer<XmppExchange> implements
PacketListener {
@@ -47,16 +47,16 @@
@Override
protected void doStart() throws Exception {
if (endpoint.getRoom() == null) {
- privateChat =
endpoint.getConnection().createChat(endpoint.getParticipant());
- privateChat.addMessageListener(this);
- LOG.info("Open chat to " + privateChat.getParticipant());
+ privateChat =
endpoint.getConnection().createChat(endpoint.getParticipant());
+ privateChat.addMessageListener(this);
+ LOG.info("Open chat to " + privateChat.getParticipant());
} else {
- muc = new MultiUserChat(endpoint.getConnection(),
endpoint.resolveRoom());
- muc.addMessageListener(this);
- DiscussionHistory history = new DiscussionHistory();
- history.setMaxChars(0); // we do not want any historical
messages
- muc.join(endpoint.getNickname(), null, history,
SmackConfiguration.getPacketReplyTimeout());
- LOG.info("Joined room: " + muc.getRoom());
+ muc = new MultiUserChat(endpoint.getConnection(),
endpoint.resolveRoom());
+ muc.addMessageListener(this);
+ DiscussionHistory history = new DiscussionHistory();
+ history.setMaxChars(0); // we do not want any historical messages
+ muc.join(endpoint.getNickname(), null, history,
SmackConfiguration.getPacketReplyTimeout());
+ LOG.info("Joined room: " + muc.getRoom());
}
super.doStart();
}
@@ -65,8 +65,8 @@
protected void doStop() throws Exception {
super.doStop();
if (muc != null) {
- muc.leave();
- muc = null;
+ muc.leave();
+ muc = null;
}
}
@@ -81,7 +81,7 @@
try {
getProcessor().process(exchange);
} catch (Exception e) {
- LOG.error("Error while processing message", e);
+ LOG.error("Error while processing message", e);
}
}
Modified:
activemq/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java?rev=682599&r1=682598&r2=682599&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
(original)
+++
activemq/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
Mon Aug 4 23:37:23 2008
@@ -65,7 +65,8 @@
return createGroupChatProducer();
} else {
if (participant == null) {
- throw new IllegalArgumentException("No room or participant
configured on this endpoint: " + this);
+ throw new IllegalArgumentException("No room or participant
configured on this endpoint: "
+ + this);
}
return createPrivateChatProducer(participant);
}
@@ -80,7 +81,7 @@
}
public Consumer<XmppExchange> createConsumer(Processor processor) throws
Exception {
- return new XmppConsumer(this, processor);
+ return new XmppConsumer(this, processor);
}
@Override
@@ -180,11 +181,11 @@
public void setParticipant(String participant) {
this.participant = participant;
}
-
+
public String getNickname() {
return nickname != null ? nickname : getUser();
}
-
+
public void setNickname(String nickname) {
this.nickname = nickname;
}
@@ -234,28 +235,28 @@
}
return connection;
}
-
+
/*
- * If there is no "@" symbol in the room, find the chat service JID and
return fully
- * qualified JID for the room as [EMAIL PROTECTED]
+ * If there is no "@" symbol in the room, find the chat service JID and
+ * return fully qualified JID for the room as [EMAIL PROTECTED]
*/
public String resolveRoom() throws XMPPException, CamelException {
- if (room == null) {
- throw new IllegalArgumentException("room is not specified");
+ if (room == null) {
+ throw new IllegalArgumentException("room is not specified");
}
if (room.indexOf('@', 0) != -1) {
- return room;
+ return room;
}
XMPPConnection conn = getConnection();
- Iterator<String> iterator =
MultiUserChat.getServiceNames(conn).iterator();
- if (!iterator.hasNext()) {
- throw new CamelException("Can not find Multi User Chat
service");
+ Iterator<String> iterator =
MultiUserChat.getServiceNames(conn).iterator();
+ if (!iterator.hasNext()) {
+ throw new CamelException("Can not find Multi User Chat service");
}
String chatServer = iterator.next();
- if (LOG.isInfoEnabled()) {
- LOG.info("Detected chat server: " + chatServer);
+ if (LOG.isInfoEnabled()) {
+ LOG.info("Detected chat server: " + chatServer);
}
return room + "@" + chatServer;