org.eclipse.ecf.presence.im
Interface IChatManager


public interface IChatManager

Chat manager access entry interface. The chat manager supports the sending and receiving of person-to-person messages for a given account.


Method Summary
 void addMessageListener(IIMMessageListener listener)
          Add message listener.
 IChat createChat(ID targetUser, IIMMessageListener messageListener)
          Create chat instance for given target user.
 IChatMessageSender getChatMessageSender()
          Get chat message sender.
 IHistoryManager getHistoryManager()
          Get the history manager for this chat manager.
 IMessageSearchManager getMessageSearchManager()
          Get the message search manager for this chat manager.
 ITypingMessageSender getTypingMessageSender()
          Get typing message sender.
 void removeMessageListener(IIMMessageListener listener)
          Remove message listener.
 

Method Detail

addMessageListener

void addMessageListener(IIMMessageListener listener)
Add message listener.

Parameters:
listener - the listener to add. Must not be null.

removeMessageListener

void removeMessageListener(IIMMessageListener listener)
Remove message listener.

Parameters:
listener - the listener to remove. Must not be null.

getChatMessageSender

IChatMessageSender getChatMessageSender()
Get chat message sender. If sending chat messages not supported by this provider then null will be returned.

Returns:
IChatMessageSender to use for sending chat message. If null, sending chat messages not supported by this provider.

getTypingMessageSender

ITypingMessageSender getTypingMessageSender()
Get typing message sender. If sending typing messages not supported by this provider then null will be returned.

Returns:
ITypingMessageSender to use for sending typing messages (instances of ITypingMessage). If null, sending typing messages not supported by this provider.

getHistoryManager

IHistoryManager getHistoryManager()
Get the history manager for this chat manager.

Returns:
IChatRoomHistoryManager the history manager instance. Will not be null.

getMessageSearchManager

IMessageSearchManager getMessageSearchManager()
Get the message search manager for this chat manager.

Returns:
IMessageSearchManager the message search manager instance. Will be null in case not available.
Since:
2.0

createChat

IChat createChat(ID targetUser,
                 IIMMessageListener messageListener)
                 throws ECFException
Create chat instance for given target user.

Parameters:
targetUser - the targetUser to create chat for. Must not be null. If the user container is offline/disconnected. then an ECFException will be thrown. If this chat manager implementation does not support creating such chats, then null will be returned.
messageListener - the message listener to listen for messages. Must not be null.
Returns:
IChat for given targetUser. Will return null if the underlying implementation does not support threads/specific chat instances.
Throws:
ECFException