|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.protocol.irc.ChatRoomIrcImpl
public class ChatRoomIrcImpl
Represents a chat channel/room, where multiple chat users could rally and communicate in a many-to-many fashion.
| Constructor Summary | |
|---|---|
ChatRoomIrcImpl(String chatRoomName,
ProtocolProviderServiceIrcImpl parentProvider)
Creates an instance of ChatRoomIrcImpl, by specifying the room name and the protocol provider. |
|
ChatRoomIrcImpl(String chatRoomName,
ProtocolProviderServiceIrcImpl parentProvider,
boolean isPrivate,
boolean isSystem)
Creates an instance of ChatRoomIrcImpl, by specifying the room name, the protocol provider and the isPrivate property. |
|
| Method Summary | |
|---|---|
protected void |
addChatRoomMember(String memberID,
ChatRoomMember member)
Adds a ChatRoomMember to the list of members of this chat room. |
void |
addLocalUserRoleListener(ChatRoomLocalUserRoleListener listener)
Adds a listener that will be notified of changes in our role in the room such as us being granded operator. |
void |
addMemberPresenceListener(ChatRoomMemberPresenceListener listener)
Adds a listener that will be notified of changes in our status in the room such as us being kicked, banned, or granted admin permissions. |
void |
addMemberPropertyChangeListener(ChatRoomMemberPropertyChangeListener listener)
Adds the given listener to the list of listeners registered to receive events upon modification of chat room member properties such as its nickname being changed for example. |
void |
addMemberRoleListener(ChatRoomMemberRoleListener listener)
Adds a listener that will be notified of changes of a member role in the room such as being granted operator. |
void |
addMessageListener(ChatRoomMessageListener listener)
Registers listener so that it would receive events every time a new message is received on this chat room. |
void |
addPropertyChangeListener(ChatRoomPropertyChangeListener listener)
Adds listener to the list of listeners registered to receive events upon modification of chat room properties such as its subject for example. |
void |
banParticipant(ChatRoomMember chatRoomMember,
String reason)
Bans the given ChatRoomMember. |
protected void |
clearChatRoomMemberList()
Removes all chat room members from the list. |
Message |
createMessage(byte[] content,
String contentType,
String contentEncoding,
String subject)
Create a Message instance for sending arbitrary MIME-encoding content. |
Message |
createMessage(String messageText)
Create a Message instance for sending a simple text messages with default (text/plain) content type and encoding. |
void |
fireMemberPresenceEvent(ChatRoomMember member,
ChatRoomMember actorMember,
String eventID,
String eventReason)
Creates the corresponding ChatRoomMemberPresenceChangeEvent and notifies all ChatRoomMemberPresenceListeners that a ChatRoomMember has joined or left this ChatRoom. |
void |
fireMemberPropertyChangeEvent(ChatRoomMemberPropertyChangeEvent evt)
Delivers the specified event to all registered property change listeners. |
void |
fireMemberRoleEvent(ChatRoomMember member,
ChatRoomMemberRole newRole)
Creates the corresponding ChatRoomMemberRoleChangeEvent and notifies all ChatRoomMemberRoleListeners that a ChatRoomMember has changed his role in this ChatRoom. |
void |
fireMessageReceivedEvent(Message message,
ChatRoomMember fromMember,
long date,
int eventType)
Notifies all interested listeners that a ChatRoomMessageReceivedEvent has been fired. |
void |
firePropertyChangeEvent(PropertyChangeEvent evt)
Delivers the specified event to all registered property change listeners. |
Iterator<ChatRoomMember> |
getBanList()
Returns the list of banned chat room members. |
protected ChatRoomMember |
getChatRoomMember(String memberID)
Returns the ChatRoomMember corresponding to the given member id. |
ChatRoomConfigurationForm |
getConfigurationForm()
Returns the ChatRoomConfigurationForm containing all configuration properties for this chat room. |
String |
getIdentifier()
Returns the identifier of this ChatRoom. |
List<ChatRoomMember> |
getMembers()
Returns a List of ChatRoomMemberss corresponding to all members currently participating in this room. |
int |
getMembersCount()
Returns the number of participants that are currently in this chat room. |
String |
getName()
Returns the name of this ChatRoom. |
ProtocolProviderService |
getParentProvider()
Returns the protocol provider service that created us. |
String |
getSubject()
Returns the last known room subject/theme or null if the user hasn't joined the room or the room does not have a subject yet. |
String |
getUserNickname()
Returns the local user's nickname in the context of this chat room or null if not currently joined. |
ChatRoomMemberRole |
getUserRole()
Returns the local user role. |
void |
grantAdmin(String address)
Grants admin role to the participant given by address. |
void |
grantMembership(String address)
Grants membership role to the participant given by address. |
void |
grantModerator(String address)
Grants moderator role to the participant given by address. |
void |
grantOwnership(String address)
Grants ownership role to the participant given by address. |
void |
grantVoice(String address)
Grants voice to the participant given by address. |
void |
invite(String userAddress,
String reason)
Invites another user to this room. |
boolean |
isJoined()
Returns true if the local user is currently in the multi user chat (after calling one of the join() methods). |
boolean |
isPersistent()
Determines whether this chat room should be stored in the configuration file or not. |
boolean |
isPrivate()
Indicates if this chat room is a private one or not. |
boolean |
isSystem()
Indicates whether or not this chat room is corresponding to a server channel. |
void |
join()
Joins this chat room with the nickname of the local user so that the user would start receiving events and messages for it. |
void |
join(byte[] password)
Joins this chat room so that the user would start receiving events and messages for it. |
void |
joinAs(String nickname)
Joins this chat room with the specified nickname so that the user would start receiving events and messages for it. |
void |
joinAs(String nickname,
byte[] password)
Joins this chat room with the specified nickname and password so that the user would start receiving events and messages for it. |
void |
kickParticipant(ChatRoomMember chatRoomMember,
String reason)
Kicks the given ChatRoomMember. |
void |
leave()
Leave this chat room. |
protected void |
removeChatRoomMember(String memberID)
Removes a ChatRoomMember from the list of members of this chat room. |
void |
removelocalUserRoleListener(ChatRoomLocalUserRoleListener listener)
Removes a listener that was being notified of changes in our role in this chat room such as us being granted operator. |
void |
removeMemberPresenceListener(ChatRoomMemberPresenceListener listener)
Removes a listener that was being notified of changes in the status of other chat room participants such as users being kicked, banned, or granted admin permissions. |
void |
removeMemberPropertyChangeListener(ChatRoomMemberPropertyChangeListener listener)
Removes the given listener from the list of listeners currently registered for chat room member property change events. |
void |
removeMemberRoleListener(ChatRoomMemberRoleListener listener)
Removes a listener that was being notified of changes of a member role in this chat room such as us being granded operator. |
void |
removeMessageListener(ChatRoomMessageListener listener)
Removes listener so that it won't receive any further message events from this room. |
void |
removePropertyChangeListener(ChatRoomPropertyChangeListener listener)
Removes listener from the list of listeners current registered for chat room modification events. |
void |
revokeAdmin(String address)
Revokes the admin role for the participant given by address. |
void |
revokeMembership(String address)
Revokes the membership role for the participant given by address. |
void |
revokeModerator(String address)
Revokes the moderator role for the participant given by address. |
void |
revokeOwnership(String address)
Revokes the ownership role for the participant given by address. |
void |
revokeVoice(String address)
Revokes the voice for the participant given by address. |
void |
sendMessage(Message message)
Sends the message to the destination indicated by the to contact. |
void |
setLocalUserRole(ChatRoomMemberRole role)
Sets the local user role. |
protected void |
setNickName(String nickName)
Sets the nickName for this chat room. |
void |
setSubject(String subject)
Sets the subject of this chat room. |
protected void |
setSubjectFromServer(String subject)
Sets the subject obtained from the server once we're connected. |
protected void |
setSystem(boolean isSystem)
Sets whether or not this chat room is corresponding to a server channel. |
void |
setUserNickname(String nickName)
Changes the the local user's nickname in the context of this chat room. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ChatRoomIrcImpl(String chatRoomName,
ProtocolProviderServiceIrcImpl parentProvider)
chatRoomName - the name of the chat roomparentProvider - the protocol provider
public ChatRoomIrcImpl(String chatRoomName,
ProtocolProviderServiceIrcImpl parentProvider,
boolean isPrivate,
boolean isSystem)
chatRoomName - the name of the chat roomparentProvider - the protocol providerisPrivate - indicates if this chat room is a private oneisSystem - indicates if this chat room is a system room| Method Detail |
|---|
public String getName()
getName in interface ChatRoompublic String getIdentifier()
getIdentifier in interface ChatRoom
public void join()
throws OperationFailedException
join in interface ChatRoomOperationFailedException - with the corresponding code if an error
occurs while joining the room.
public void join(byte[] password)
throws OperationFailedException
join in interface ChatRoompassword - the password to use when authenticating on the chatroom.
OperationFailedException - with the corresponding code if an error
occurs while joining the room.
public void joinAs(String nickname)
throws OperationFailedException
joinAs in interface ChatRoomnickname - the nickname to use.
OperationFailedException - with the corresponding code if an error
occurs while joining the room.
public void joinAs(String nickname,
byte[] password)
throws OperationFailedException
joinAs in interface ChatRoomnickname - the nickname to use.password - a password necessary to authenticate when joining the
room.
OperationFailedException - with the corresponding code if an error
occurs while joining the room.public boolean isJoined()
join() methods).
isJoined in interface ChatRoompublic void leave()
leave in interface ChatRoom
public Iterator<ChatRoomMember> getBanList()
throws OperationFailedException
getBanList in interface ChatRoomOperationFailedException - if we are not joined or we don't have
enough privileges to obtain the ban list.
public void banParticipant(ChatRoomMember chatRoomMember,
String reason)
throws OperationFailedException
banParticipant in interface ChatRoomchatRoomMember - the chat room member to banreason - the reason of the ban
OperationFailedException - if we are not joined or we don't have
enough privileges to ban a participant.
public void kickParticipant(ChatRoomMember chatRoomMember,
String reason)
throws OperationFailedException
kickParticipant in interface ChatRoomchatRoomMember - the chat room member to kickreason - the reason of the kick
OperationFailedException - if we are not joined or we don't have
enough privileges to kick a participant.
public ChatRoomConfigurationForm getConfigurationForm()
throws OperationFailedException
getConfigurationForm in interface ChatRoomOperationFailedException - if the user doesn't have
permissions to see and change chat room configurationpublic void addPropertyChangeListener(ChatRoomPropertyChangeListener listener)
addPropertyChangeListener in interface ChatRoomlistener - ChatRoomChangeListenerpublic void removePropertyChangeListener(ChatRoomPropertyChangeListener listener)
removePropertyChangeListener in interface ChatRoomlistener - the ChatRoomChangeListener to remove.public void addMemberPropertyChangeListener(ChatRoomMemberPropertyChangeListener listener)
addMemberPropertyChangeListener in interface ChatRoomlistener - the ChatRoomMemberPropertyChangeListener
that is to be registered for ChatRoomMemberPropertyChangeEvents.public void removeMemberPropertyChangeListener(ChatRoomMemberPropertyChangeListener listener)
removeMemberPropertyChangeListener in interface ChatRoomlistener - the ChatRoomMemberPropertyChangeListener to
remove.public void addMemberRoleListener(ChatRoomMemberRoleListener listener)
addMemberRoleListener in interface ChatRoomlistener - a member role listener.public void removeMemberRoleListener(ChatRoomMemberRoleListener listener)
removeMemberRoleListener in interface ChatRoomlistener - a member role listener.public void addLocalUserRoleListener(ChatRoomLocalUserRoleListener listener)
addLocalUserRoleListener in interface ChatRoomlistener - a local user role listener.public void removelocalUserRoleListener(ChatRoomLocalUserRoleListener listener)
removelocalUserRoleListener in interface ChatRoomlistener - a local user role listener.public String getSubject()
To be notified every time the room's subject change you should add a ChatRoomPropertyChangelistener to this room.
To change the room's subject use setSubject(String).
getSubject in interface ChatRoom
public void setSubject(String subject)
throws OperationFailedException
setSubject in interface ChatRoomsubject - the new subject that we'd like this room to have
OperationFailedException - thrown if the user is not joined to the
channel or if he/she doesn't have enough privileges to change the
topic or if the topic is null.public String getUserNickname()
getUserNickname in interface ChatRoom
public void setUserNickname(String nickName)
throws OperationFailedException
setUserNickname in interface ChatRoomnickName - the new nickname within the room.
OperationFailedException - if the setting the new nickname changes
for some reason.public void addMemberPresenceListener(ChatRoomMemberPresenceListener listener)
addMemberPresenceListener in interface ChatRoomlistener - a participant status listener.public void removeMemberPresenceListener(ChatRoomMemberPresenceListener listener)
removeMemberPresenceListener in interface ChatRoomlistener - a participant status listener.public void addMessageListener(ChatRoomMessageListener listener)
addMessageListener in interface ChatRoomlistener - a MessageListener that would be notified every
time a new message is received on this chat room.public void removeMessageListener(ChatRoomMessageListener listener)
removeMessageListener in interface ChatRoomlistener - the MessageListener to remove from this room
protected void addChatRoomMember(String memberID,
ChatRoomMember member)
memberID - the identifier of the membermember - the ChatRoomMember to add.protected void removeChatRoomMember(String memberID)
memberID - the name of the ChatRoomMember to remove.protected ChatRoomMember getChatRoomMember(String memberID)
memberID - the identifier of the member
protected void clearChatRoomMemberList()
public void invite(String userAddress,
String reason)
invite in interface ChatRoomuserAddress - the address of the user to invite to the room.(one may
also invite users not on their contact list).reason - a reason, subject, or welcome message that would tell the
the user why they are being invited.public List<ChatRoomMember> getMembers()
getMembers in interface ChatRoompublic int getMembersCount()
getMembersCount in interface ChatRoom
public Message createMessage(byte[] content,
String contentType,
String contentEncoding,
String subject)
createMessage in interface ChatRoomcontent - content valuecontentType - the MIME-type for contentcontentEncoding - encoding used for contentsubject - a String subject or null for now
subject.
public Message createMessage(String messageText)
createMessage in interface ChatRoommessageText - the string content of the message.
public void sendMessage(Message message)
throws OperationFailedException
sendMessage in interface ChatRoommessage - the Message to send.
OperationFailedException - if the underlying stack is not
registered or initialized or if the chat room is not joined.public ProtocolProviderService getParentProvider()
getParentProvider in interface ChatRoom
public void fireMessageReceivedEvent(Message message,
ChatRoomMember fromMember,
long date,
int eventType)
message - the received messagefromMember - the ChatRoomMember, which is the sender of the
messagedate - the time at which the message has been receivedeventType - the type of the received event. One of the
XXX_MESSAGE_RECEIVED constants declared in the
ChatRoomMessageReceivedEvent class.public void firePropertyChangeEvent(PropertyChangeEvent evt)
evt - the PropertyChangeEvent that we'd like delivered to
all registered property change listeners.public void fireMemberPropertyChangeEvent(ChatRoomMemberPropertyChangeEvent evt)
evt - the ChatRoomMemberPropertyChangeEvent that we'd like
deliver to all registered member property change listeners.
public void fireMemberPresenceEvent(ChatRoomMember member,
ChatRoomMember actorMember,
String eventID,
String eventReason)
member - the ChatRoomMember that this event is aboutactorMember - a member that act in the event (for example the kicker
in a member kicked event)eventID - the identifier of the eventeventReason - the reason of the event
public void fireMemberRoleEvent(ChatRoomMember member,
ChatRoomMemberRole newRole)
member - the ChatRoomMember that this event is aboutnewRole - the new role of the given memberpublic boolean isPrivate()
true if this chat room is private and
false otherwise.public boolean isSystem()
isSystem in interface ChatRoomtrue to indicate that this chat room is
corresponding to a server channel, false - otherwise.protected void setSystem(boolean isSystem)
isSystem - true to indicate that this chat room is
corresponding to a server channel, false - otherwise.protected void setNickName(String nickName)
nickName - the nick name to setprotected void setSubjectFromServer(String subject)
subject - the subject to setpublic boolean isPersistent()
isPersistent in interface ChatRoompublic ChatRoomMemberRole getUserRole()
getUserRole in interface ChatRoom
public void setLocalUserRole(ChatRoomMemberRole role)
throws OperationFailedException
setLocalUserRole in interface ChatRoomrole - the role to set
OperationFailedException - if the operation don't succeedpublic void grantAdmin(String address)
grantAdmin in interface ChatRoomaddress - the address of the participant to grant admin role topublic void grantMembership(String address)
grantMembership in interface ChatRoomaddress - the address of the participant to grant membership role topublic void grantModerator(String address)
grantModerator in interface ChatRoomaddress - the address of the participant to grant moderator role topublic void grantOwnership(String address)
grantOwnership in interface ChatRoomaddress - the address of the participant to grant ownership role topublic void grantVoice(String address)
grantVoice in interface ChatRoomaddress - the address of the participant to grant voice topublic void revokeAdmin(String address)
revokeAdmin in interface ChatRoomaddress - the address of the participant to revoke admin role forpublic void revokeMembership(String address)
revokeMembership in interface ChatRoomaddress - the address of the participant to revoke membership role
forpublic void revokeModerator(String address)
revokeModerator in interface ChatRoomaddress - the address of the participant to revoke moderator role
forpublic void revokeOwnership(String address)
revokeOwnership in interface ChatRoomaddress - the address of the participant to revoke ownership role
forpublic void revokeVoice(String address)
revokeVoice in interface ChatRoomaddress - the address of the participant to revoke voice for
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||