|
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.jabber.ChatRoomJabberImpl
public class ChatRoomJabberImpl
Implements chat rooms for jabber. The class encapsulates instances of the jive software MultiUserChat.
| Constructor Summary | |
|---|---|
ChatRoomJabberImpl(org.jivesoftware.smackx.muc.MultiUserChat multiUserChat,
ProtocolProviderServiceJabberImpl provider)
Creates an instance of a chat room that has been. |
|
| Method Summary | |
|---|---|
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 granded 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 a user from the room. |
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. |
ChatRoomMemberJabberImpl |
findMemberForNickName(String jabberID)
Finds the member of this chat room corresponding to the given nick name. |
void |
fireMemberPropertyChangeEvent(ChatRoomMemberPropertyChangeEvent evt)
Delivers the specified event to all registered property change listeners. |
Iterator<ChatRoomMember> |
getBanList()
Returns the list of banned users. |
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 Members corresponding to all members currently participating in this room. |
int |
getMembersCount()
Returns the number of participants that are currently in this chat room. |
(package private) org.jivesoftware.smackx.muc.MultiUserChat |
getMultiUserChat()
Returns the internal stack used chat room instance. |
String |
getName()
Returns the name of this ChatRoom. |
(package private) static String |
getNickName(String participantAddress)
Returns the nickname of the given participant name. |
ProtocolProviderService |
getParentProvider()
Returns a reference to the provider that created this room. |
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 local user role in the context of this chatroom. |
void |
grantAdmin(String jid)
Grants administrator privileges to another user. |
void |
grantMembership(String jid)
Grants membership to a user. |
void |
grantModerator(String nickname)
Grants moderator privileges to a participant or visitor. |
void |
grantOwnership(String jid)
Grants ownership privileges to another user. |
void |
grantVoice(String nickname)
Grants voice to a visitor in the room. |
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 |
isSystem()
The Jabber multi user chat implementation doesn't support system rooms. |
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 member,
String reason)
Kicks a participant from the room. |
void |
leave()
Leave 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 granded 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 listeneres current registered for chat room modification events. |
void |
revokeAdmin(String jid)
Revokes administrator privileges from a user. |
void |
revokeMembership(String jid)
Revokes a user's membership. |
void |
revokeModerator(String nickname)
Revokes moderator privileges from another user. |
void |
revokeOwnership(String jid)
Revokes ownership privileges from another user. |
void |
revokeVoice(String nickname)
Revokes voice from a participant in the room. |
void |
sendMessage(Message message)
Sends the message to the destination indicated by the to contact. |
void |
setLocalUserRole(ChatRoomMemberRole role)
Sets the new rolefor the local user in the context of this chatroom. |
void |
setSubject(String subject)
Sets the subject of this chat room. |
void |
setUserNickname(String nickname)
Changes the local user nickname. |
ChatRoomMemberJabberImpl |
smackParticipantToScMember(String participant)
Returns the ChatRoomMember corresponding to the given smack participant. |
(package private) static ChatRoomMemberRole |
smackRoleToScRole(String smackRole)
Returns that ChatRoomJabberRole instance corresponding to the smackRole string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ChatRoomJabberImpl(org.jivesoftware.smackx.muc.MultiUserChat multiUserChat,
ProtocolProviderServiceJabberImpl provider)
multiUserChat - MultiUserChatprovider - a reference to the currently valid jabber protocol
provider.| Method Detail |
|---|
public void addPropertyChangeListener(ChatRoomPropertyChangeListener listener)
addPropertyChangeListener in interface ChatRoomlistener - the ChatRoomChangeListener that is to be
registered for ChatRoomChangeEvent-s.public 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 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 roompublic 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 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 List<ChatRoomMember> getMembers()
getMembers in interface ChatRoompublic int getMembersCount()
getMembersCount in interface ChatRoompublic String getName()
getName in interface ChatRoompublic String getIdentifier()
getIdentifier in interface ChatRoompublic String getUserNickname()
getUserNickname in interface ChatRoompublic String getSubject()
getSubject in interface ChatRoom
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 boolean isJoined()
join() methods).
isJoined in interface ChatRoom
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 join()
throws OperationFailedException
join in interface ChatRoomOperationFailedException - 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 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.static ChatRoomMemberRole smackRoleToScRole(String smackRole)
smackRole - the smack role as returned by
Occupant.getRole().
public ChatRoomMemberJabberImpl smackParticipantToScMember(String participant)
participant - the full participant name
(e.g. sc-testroom@conference.voipgw.u-strasbg.fr/testuser)
public void leave()
leave in interface ChatRoom
public void sendMessage(Message message)
throws OperationFailedException
sendMessage in interface ChatRoommessage - the Message to send.
OperationFailedException - if sending the message fails for some
reason.
public void setSubject(String subject)
throws OperationFailedException
setSubject in interface ChatRoomsubject - the new subject that we'd like this room to have
OperationFailedExceptionpublic ProtocolProviderService getParentProvider()
getParentProvider in interface ChatRoompublic ChatRoomMemberRole getUserRole()
getUserRole in interface ChatRoompublic void setLocalUserRole(ChatRoomMemberRole role)
setLocalUserRole in interface ChatRoomrole - the new role to be set for the local userpublic 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 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 Iterator<ChatRoomMember> getBanList()
throws OperationFailedException
getBanList in interface ChatRoomOperationFailedException - if we could not obtain the ban list
public void setUserNickname(String nickname)
throws OperationFailedException
setUserNickname in interface ChatRoomnickname - the new nickname within the room.
OperationFailedException - if the new nickname already exist in
this room
public void banParticipant(ChatRoomMember chatRoomMember,
String reason)
throws OperationFailedException
banParticipant in interface ChatRoomchatRoomMember - the ChatRoomMember to be banned.reason - the reason why the user was banned.
OperationFailedException - if an error occurs while banning a user.
In particular, an error can occur if a moderator or a user with an
affiliation of "owner" or "admin" was tried to be banned or if the user
that is banning have not enough permissions to ban.
public void kickParticipant(ChatRoomMember member,
String reason)
throws OperationFailedException
kickParticipant in interface ChatRoommember - the ChatRoomMember to kick from the roomreason - the reason why the participant is being kicked from the
room
OperationFailedException - if an error occurs while kicking the
participant. In particular, an error can occur if a moderator or a user
with an affiliation of "owner" or "admin" was intended to be kicked; or
if the participant that intended to kick another participant does not
have kicking privileges;public void fireMemberPropertyChangeEvent(ChatRoomMemberPropertyChangeEvent evt)
evt - the ChatRoomMemberPropertyChangeEvent that we'd like
deliver to all registered member property change listeners.
public ChatRoomConfigurationForm getConfigurationForm()
throws OperationFailedException
getConfigurationForm in interface ChatRoomOperationFailedException - if the user doesn't have
permissions to see and change chat room configurationpublic boolean isSystem()
isSystem in interface ChatRoompublic boolean isPersistent()
isPersistent in interface ChatRoompublic ChatRoomMemberJabberImpl findMemberForNickName(String jabberID)
jabberID - the nick name to search for.
public void grantAdmin(String jid)
grantAdmin in interface ChatRoomjid - the bare XMPP user ID of the user to grant administrator
privileges (e.g. "user@host.org").public void grantMembership(String jid)
grantMembership in interface ChatRoomjid - the bare XMPP user ID of the user to grant membership
privileges (e.g. "user@host.org").public void grantModerator(String nickname)
grantModerator in interface ChatRoomnickname - the nickname of the occupant to grant moderator
privileges.public void grantOwnership(String jid)
grantOwnership in interface ChatRoomjid - the bare XMPP user ID of the user to grant ownership
privileges (e.g. "user@host.org").public void grantVoice(String nickname)
grantVoice in interface ChatRoomnickname - the nickname of the visitor to grant voice in the room
(e.g. "john").
XMPPException if an error occurs granting voice to a visitor. In
particular, a 403 error can occur if the occupant that intended to grant
voice is not a moderator in this room (i.e. Forbidden error); or a 400
error can occur if the provided nickname is not present in the room.public void revokeAdmin(String jid)
revokeAdmin in interface ChatRoomjid - the bare XMPP user ID of the user to grant administrator
privileges (e.g. "user@host.org").public void revokeMembership(String jid)
revokeMembership in interface ChatRoomjid - the bare XMPP user ID of the user to revoke membership
(e.g. "user@host.org").public void revokeModerator(String nickname)
revokeModerator in interface ChatRoomnickname - the nickname of the occupant to revoke moderator
privileges.public void revokeOwnership(String jid)
revokeOwnership in interface ChatRoomjid - the bare XMPP user ID of the user to revoke ownership
(e.g. "user@host.org").public void revokeVoice(String nickname)
revokeVoice in interface ChatRoomnickname - the nickname of the participant to revoke voice
(e.g. "john").
XMPPException if an error occurs revoking voice from a participant.
In particular, a 405 error can occur if a moderator or a user
with an affiliation of "owner" or "admin" was tried to revoke his voice
(i.e. Not Allowed error); or a 400 error can occur if the provided
nickname is not present in the room.static String getNickName(String participantAddress)
participantAddress - the address of the participant
org.jivesoftware.smackx.muc.MultiUserChat getMultiUserChat()
|
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 | |||||||||