org.mule.transport.xmpp
Class AbstractXmppConversation

java.lang.Object
  extended by org.mule.transport.xmpp.AbstractXmppConversation
All Implemented Interfaces:
XmppConversation
Direct Known Subclasses:
XmppChatConversation, XmppMessageConversation, XmppMultiUserChatConversation

public abstract class AbstractXmppConversation
extends Object
implements XmppConversation


Field Summary
protected  org.jivesoftware.smack.XMPPConnection connection
           
protected  Log logger
           
protected  org.jivesoftware.smack.PacketCollector packetCollector
           
protected  String recipient
           
 
Constructor Summary
AbstractXmppConversation(ImmutableEndpoint endpoint)
           
 
Method Summary
 void addPacketListener(org.jivesoftware.smack.PacketListener listener)
          Adds listener to this conversation's XMPP connection.
 void connect()
          Connect to the Jabber conversation, e.g.
protected  org.jivesoftware.smack.PacketCollector createPacketCollector()
           
protected  org.jivesoftware.smack.filter.PacketFilter createPacketFilter()
           
 void disconnect()
          Disconnect from the Jabber conversation, e.g.
protected  void doConnect()
          Subclasses can override this method to create their conversation specific connection.
protected  void doDisconnect()
          Subclasses can override this method to perform custom disconnect actions.
 org.jivesoftware.smack.packet.Message receive()
          Wait for a response on this conversation until a message arrives.
 org.jivesoftware.smack.packet.Message receive(long timeout)
          Wait for a response on this conversation until timeout occurs.
 void removePacketListener(org.jivesoftware.smack.PacketListener listener)
          Removes listener from this conversation's XMPP connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mule.transport.xmpp.XmppConversation
dispatch
 

Field Detail

logger

protected final Log logger

connection

protected org.jivesoftware.smack.XMPPConnection connection

recipient

protected String recipient

packetCollector

protected org.jivesoftware.smack.PacketCollector packetCollector
Constructor Detail

AbstractXmppConversation

public AbstractXmppConversation(ImmutableEndpoint endpoint)
Method Detail

connect

public void connect()
             throws ConnectException
Description copied from interface: XmppConversation
Connect to the Jabber conversation, e.g. join a chat.

Specified by:
connect in interface XmppConversation
Throws:
ConnectException

doConnect

protected void doConnect()
                  throws ConnectException
Subclasses can override this method to create their conversation specific connection.

Throws:
ConnectException

createPacketCollector

protected org.jivesoftware.smack.PacketCollector createPacketCollector()
Returns:
a PacketCollector that can be used to retrieve messages for this conversation.

createPacketFilter

protected org.jivesoftware.smack.filter.PacketFilter createPacketFilter()
Returns:
a PacketFilter instance that matches the desired message type and recipient for this conversation.

disconnect

public void disconnect()
Description copied from interface: XmppConversation
Disconnect from the Jabber conversation, e.g. leave a chat.

Specified by:
disconnect in interface XmppConversation

doDisconnect

protected void doDisconnect()
Subclasses can override this method to perform custom disconnect actions.


addPacketListener

public void addPacketListener(org.jivesoftware.smack.PacketListener listener)
Description copied from interface: XmppConversation
Adds listener to this conversation's XMPP connection.

Specified by:
addPacketListener in interface XmppConversation

removePacketListener

public void removePacketListener(org.jivesoftware.smack.PacketListener listener)
Description copied from interface: XmppConversation
Removes listener from this conversation's XMPP connection.

Specified by:
removePacketListener in interface XmppConversation

receive

public org.jivesoftware.smack.packet.Message receive(long timeout)
Description copied from interface: XmppConversation
Wait for a response on this conversation until timeout occurs.

Specified by:
receive in interface XmppConversation
Returns:
Message next available message or null if timeout occurred.

receive

public org.jivesoftware.smack.packet.Message receive()
Description copied from interface: XmppConversation
Wait for a response on this conversation until a message arrives.

Specified by:
receive in interface XmppConversation


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.