public abstract class AbstractXmppConversation extends Object implements XmppConversation
Modifier and Type | Field and Description |
---|---|
protected org.jivesoftware.smack.XMPPConnection |
connection |
protected Log |
logger |
protected org.jivesoftware.smack.PacketCollector |
packetCollector |
protected String |
recipient |
Constructor and Description |
---|
AbstractXmppConversation(ImmutableEndpoint endpoint) |
Modifier and Type | Method and Description |
---|---|
void |
addPacketListener(org.jivesoftware.smack.PacketListener listener)
Adds
listener to this conversation's XMPP connection. |
void |
connect()
Connect to the Jabber conversation, e.g.
|
void |
connect(boolean requiresCollector)
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dispatch
protected final Log logger
protected org.jivesoftware.smack.XMPPConnection connection
protected String recipient
protected org.jivesoftware.smack.PacketCollector packetCollector
public AbstractXmppConversation(ImmutableEndpoint endpoint)
public void connect() throws ConnectException
XmppConversation
connect
in interface XmppConversation
ConnectException
public void connect(boolean requiresCollector) throws ConnectException
XmppConversation
connect
in interface XmppConversation
ConnectException
protected void doConnect() throws ConnectException
ConnectException
protected org.jivesoftware.smack.PacketCollector createPacketCollector()
PacketCollector
that can be used to retrieve messages for this
conversation.protected org.jivesoftware.smack.filter.PacketFilter createPacketFilter()
PacketFilter
instance that matches the desired message type and recipient
for this conversation.public void disconnect()
XmppConversation
disconnect
in interface XmppConversation
protected void doDisconnect()
public void addPacketListener(org.jivesoftware.smack.PacketListener listener)
XmppConversation
listener
to this conversation's XMPP connection.addPacketListener
in interface XmppConversation
public void removePacketListener(org.jivesoftware.smack.PacketListener listener)
XmppConversation
listener
from this conversation's XMPP connection.removePacketListener
in interface XmppConversation
public org.jivesoftware.smack.packet.Message receive(long timeout)
XmppConversation
timeout
occurs.receive
in interface XmppConversation
Message
next available message or null
if timeout occurred.public org.jivesoftware.smack.packet.Message receive()
XmppConversation
receive
in interface XmppConversation
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.