public class IMMessageHandlerXMPPImpl extends java.lang.Object implements IMMessageHandler, org.jivesoftware.smack.MessageListener
Constructor and Description |
---|
IMMessageHandlerXMPPImpl(IMSessionXMPPImpl session,
org.jivesoftware.smack.ChatManager chatManager,
IMUser imPartner) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(IMMessageListener messageListener) |
void |
closeConversation()
This method allows the user to close a chat conversation
|
boolean |
isOpened()
Returns true only if the conversation is still opened
|
void |
processMessage(org.jivesoftware.smack.Chat chat,
org.jivesoftware.smack.packet.Message message)
This method is the "messageReceived" listener method
|
void |
removeAllListeners() |
void |
removeListener(IMMessageListener messageListener) |
java.lang.String |
sendMessage(java.lang.String message)
The user account related to the session will be used to send an IM
message to the IM partner related to this object durin its instantiation
|
public IMMessageHandlerXMPPImpl(IMSessionXMPPImpl session, org.jivesoftware.smack.ChatManager chatManager, IMUser imPartner)
public void addListener(IMMessageListener messageListener) throws IMException
addListener
in interface IMMessageHandler
IMException
public void removeListener(IMMessageListener messageListener)
removeListener
in interface IMMessageHandler
public void removeAllListeners()
removeAllListeners
in interface IMMessageHandler
public java.lang.String sendMessage(java.lang.String message) throws IMException
IMMessageHandler
sendMessage
in interface IMMessageHandler
IMException
- if something wrong happens during the message sendingIMSession.createMessageHandler(IMUser)
public void processMessage(org.jivesoftware.smack.Chat chat, org.jivesoftware.smack.packet.Message message)
processMessage
in interface org.jivesoftware.smack.MessageListener
public void closeConversation() throws IMException
IMMessageHandler
closeConversation
in interface IMMessageHandler
IMException
- if the conversation was not openedpublic boolean isOpened()
IMMessageHandler
isOpened
in interface IMMessageHandler