Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber
Class ChatRoomMemberJabberImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.jabber.ChatRoomMemberJabberImpl
All Implemented Interfaces:
ChatRoomMember

public class ChatRoomMemberJabberImpl
extends Object
implements ChatRoomMember

A Jabber implementation of the chat room member.

Author:
Emil Ivov

Constructor Summary
ChatRoomMemberJabberImpl(ChatRoomJabberImpl containingChatRoom, String nickName, String jabberID)
          Creates a jabber chat room member with the specified containing chat room parent.
 
Method Summary
 byte[] getAvatar()
          Returns the avatar of this member, that can be used when including it in user interface.
 ChatRoom getChatRoom()
          Returns the chat room that this member is participating in.
 Contact getContact()
          Returns the protocol contact corresponding to this member in our contact list.
 String getContactAddress()
          Returns the contact identifier representing this contact.
(package private)  ChatRoomMemberRole getCurrentRole()
          Returns the current role without trying to query it in the stack.
 String getName()
          Returns the name of this member as it is known in its containing chatroom (aka a nickname).
 ProtocolProviderService getProtocolProvider()
          Returns the protocol provider instance that this member has originated in.
 ChatRoomMemberRole getRole()
          Returns the role of this chat room member in its containing room.
 void setAvatar(byte[] avatar)
          Sets the avatar for this member.
 void setContact(Contact contact)
          Sets the given contact to this member.
protected  void setName(String newNick)
          Update the name of this parcipant
 void setRole(ChatRoomMemberRole role)
          Sets the role of this member.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChatRoomMemberJabberImpl

public ChatRoomMemberJabberImpl(ChatRoomJabberImpl containingChatRoom,
                                String nickName,
                                String jabberID)
Creates a jabber chat room member with the specified containing chat room parent.

Parameters:
containingChatRoom - the room that this ChatRoomMemberJabberImpl is a member of.
nickName - the nick name that the member is using to participate in the chat room
jabberID - the jabber id, if available, of the member or null otherwise.
Method Detail

getChatRoom

public ChatRoom getChatRoom()
Returns the chat room that this member is participating in.

Specified by:
getChatRoom in interface ChatRoomMember
Returns:
the ChatRoom instance that this member belongs to.

getContactAddress

public String getContactAddress()
Returns the contact identifier representing this contact.

Specified by:
getContactAddress in interface ChatRoomMember
Returns:
a String (contact address), uniquely representing the contact over the service the service being used by the associated protocol provider instance/

getName

public String getName()
Returns the name of this member as it is known in its containing chatroom (aka a nickname).

Specified by:
getName in interface ChatRoomMember
Returns:
the name of this member as it is known in the containing chat room (aka a nickname).

setName

protected void setName(String newNick)
Update the name of this parcipant

Parameters:
newNick - the newNick of the participant

getProtocolProvider

public ProtocolProviderService getProtocolProvider()
Returns the protocol provider instance that this member has originated in.

Specified by:
getProtocolProvider in interface ChatRoomMember
Returns:
the ProtocolProviderService instance that created this member and its containing cht room

getRole

public ChatRoomMemberRole getRole()
Returns the role of this chat room member in its containing room.

Specified by:
getRole in interface ChatRoomMember
Returns:
a ChatRoomMemberRole instance indicating the role the this member in its containing chat room.

getCurrentRole

ChatRoomMemberRole getCurrentRole()
Returns the current role without trying to query it in the stack. Mostly used for event creating on member role change.

Returns:
the current role of this member.

setRole

public void setRole(ChatRoomMemberRole role)
Sets the role of this member.

Specified by:
setRole in interface ChatRoomMember
Parameters:
role - the role to set

getAvatar

public byte[] getAvatar()
Returns the avatar of this member, that can be used when including it in user interface.

Specified by:
getAvatar in interface ChatRoomMember
Returns:
an avatar (e.g. user photo) of this member.

setAvatar

public void setAvatar(byte[] avatar)
Sets the avatar for this member.

Parameters:
avatar - the avatar to set.

getContact

public Contact getContact()
Returns the protocol contact corresponding to this member in our contact list. The contact returned here could be used by the user interface to check if this member is contained in our contact list and in function of this to show additional information add additional functionality.

Specified by:
getContact in interface ChatRoomMember
Returns:
the protocol contact corresponding to this member in our contact list.

setContact

public void setContact(Contact contact)
Sets the given contact to this member.

Parameters:
contact - the contact to set.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.