hudson.plugins.im
Interface IMChat


public interface IMChat

Abstraction of a chat.

Author:
kutzi

Method Summary
 void addMessageListener(IMMessageListener listener)
          Adds a new IMMessageListener to this chat.
 java.lang.String getIMId(java.lang.String senderId)
          Translates the sender into a unique IM id.
 java.lang.String getNickName(java.lang.String senderId)
          Translates the sender into a nickname which can be used to informally address the sender.
 boolean isMultiUserChat()
          Returns true if the chat is a multi-user chat (a Jabber conference room, an IRC chatroom) as opposed to a single user chat (IRC private message exchange).
 void removeMessageListener(IMMessageListener listener)
          Removes a IMMessageListener from this chat.
 void sendMessage(java.lang.String message)
          Sends a message to the chat.
 

Method Detail

sendMessage

void sendMessage(java.lang.String message)
                 throws IMException
Sends a message to the chat.

Throws:
IMException - If the message couldn't be delivered for any reason.

getNickName

java.lang.String getNickName(java.lang.String senderId)
Translates the sender into a nickname which can be used to informally address the sender.

Parameters:
senderId - the fully qualified IM id of the sender (e.g. for Jabber the user, the server domain and optional resource part)

getIMId

java.lang.String getIMId(java.lang.String senderId)
Translates the sender into a unique IM id. Under certain circumstances the 'sender id' is not unique. E.g. in a Jabber chatroom we will only get the 'nick' registered in the room and not the real Jabber ID.

Parameters:
senderId -
Returns:
the 'real' ID or null if it couldn't be determined (e.g. because the room is anonymous)

isMultiUserChat

boolean isMultiUserChat()
Returns true if the chat is a multi-user chat (a Jabber conference room, an IRC chatroom) as opposed to a single user chat (IRC private message exchange).


addMessageListener

void addMessageListener(IMMessageListener listener)
Adds a new IMMessageListener to this chat. Note that certain protocols/APIs might not support this method - in that case this method should do nothing.


removeMessageListener

void removeMessageListener(IMMessageListener listener)
Removes a IMMessageListener from this chat. Note that certain protocols/APIs might not support this method - in that case this method should do nothing. Note also that Smack Jabber API (2.x) does not support this even if one has added a message listener previously.



Copyright © 2010. All Rights Reserved.