public class MultiUserChat
extends java.lang.Object
MultiUserChatManager.getMultiUserChat(EntityBareJid)
.
A MultiUserChat is a conversation that takes place among many users in a virtual room. A room could have many occupants with different affiliation and roles. Possible affiliations are "owner", "admin", "member", and "outcast". Possible roles are "moderator", "participant", and "visitor". Each role and affiliation guarantees different privileges (e.g. Send messages to all occupants, Kick participants and visitors, Grant voice, Edit member list, etc.).
Note: Make sure to leave the MUC (leave()
) when you don't need it anymore or
otherwise you may leak the instance.
Modifier and Type | Class and Description |
---|---|
class |
MultiUserChat.MucCreateConfigFormHandle
A handle used to configure a newly created room.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addInvitationRejectionListener(InvitationRejectionListener listener)
Adds a listener to invitation rejections notifications.
|
boolean |
addMessageListener(org.jivesoftware.smack.MessageListener listener)
Adds a stanza listener that will be notified of any new messages in the
group chat.
|
boolean |
addParticipantListener(org.jivesoftware.smack.PresenceListener listener)
Adds a stanza listener that will be notified of any new Presence packets
sent to the group chat.
|
boolean |
addParticipantStatusListener(ParticipantStatusListener listener)
Adds a listener that will be notified of changes in occupants status in the room
such as the user being kicked, banned, or granted admin permissions.
|
void |
addPresenceInterceptor(org.jivesoftware.smack.PresenceListener presenceInterceptor)
Adds a new
StanzaListener that will be invoked every time a new presence
is going to be sent by this MultiUserChat to the server. |
boolean |
addSubjectUpdatedListener(SubjectUpdatedListener listener)
Adds a listener to subject change notifications.
|
boolean |
addUserStatusListener(UserStatusListener listener)
Adds a listener that will be notified of changes in your status in the room
such as the user being kicked, banned, or granted admin permissions.
|
void |
banUser(org.jxmpp.jid.Jid jid,
java.lang.String reason)
Bans a user from the room.
|
void |
banUsers(java.util.Collection<? extends org.jxmpp.jid.Jid> jids)
Bans users from the room.
|
void |
changeAvailabilityStatus(java.lang.String status,
org.jivesoftware.smack.packet.Presence.Mode mode)
Changes the occupant's availability status within the room.
|
void |
changeNickname(org.jxmpp.jid.parts.Resourcepart nickname)
Changes the occupant's nickname to a new nickname within the room.
|
void |
changeSubject(java.lang.String subject)
Changes the subject within the room.
|
MultiUserChat.MucCreateConfigFormHandle |
create(org.jxmpp.jid.parts.Resourcepart nickname)
Creates the room according to some default configuration, assign the requesting user as the
room owner, and add the owner to the room but not allow anyone else to enter the room
(effectively "locking" the room).
|
org.jivesoftware.smack.packet.Message |
createMessage()
Creates a new Message to send to the chat room.
|
MultiUserChat.MucCreateConfigFormHandle |
createOrJoin(MucEnterConfiguration mucEnterConfiguration)
Like
create(Resourcepart) , but will return a MultiUserChat.MucCreateConfigFormHandle if the room creation was acknowledged by
the service (with an 201 status code). |
MultiUserChat.MucCreateConfigFormHandle |
createOrJoin(org.jxmpp.jid.parts.Resourcepart nickname)
Create or join the MUC room with the given nickname.
|
MultiUserChat.MucCreateConfigFormHandle |
createOrJoinIfNecessary(org.jxmpp.jid.parts.Resourcepart nickname,
java.lang.String password)
Create or join a MUC if it is necessary, i.e.
|
org.jivesoftware.smack.chat.Chat |
createPrivateChat(org.jxmpp.jid.EntityFullJid occupant,
org.jivesoftware.smack.chat.ChatMessageListener listener)
Returns a new Chat for sending private messages to a given room occupant.
|
void |
destroy(java.lang.String reason,
org.jxmpp.jid.EntityBareJid alternateJID)
Sends a request to the server to destroy the room.
|
java.util.List<Affiliate> |
getAdmins()
Returns a list of
Affiliate with the room administrators. |
MucConfigFormManager |
getConfigFormManager()
Get a
MucConfigFormManager to configure this room. |
Form |
getConfigurationForm()
Returns the room's configuration form that the room's owner can use or
null if
no configuration is possible. |
MucEnterConfiguration.Builder |
getEnterConfigurationBuilder(org.jxmpp.jid.parts.Resourcepart nickname)
Get a new MUC enter configuration builder.
|
java.util.List<Affiliate> |
getMembers()
Returns a list of
Affiliate with the room members. |
java.util.List<Occupant> |
getModerators()
Returns a list of
Occupant with the room moderators. |
org.jxmpp.jid.parts.Resourcepart |
getNickname()
Returns the nickname that was used to join the room, or
null if not
currently joined. |
Occupant |
getOccupant(org.jxmpp.jid.EntityFullJid user)
Returns the Occupant information for a particular occupant, or
null if the
user is not in the room. |
org.jivesoftware.smack.packet.Presence |
getOccupantPresence(org.jxmpp.jid.EntityFullJid user)
Returns the presence info for a particular user, or
null if the user
is not in the room. |
java.util.List<org.jxmpp.jid.EntityFullJid> |
getOccupants()
Returns an List for the list of fully qualified occupants
in the group chat.
|
int |
getOccupantsCount()
Returns the number of occupants in the group chat.
|
java.util.List<Affiliate> |
getOutcasts()
Returns a list of
Affiliate with the room outcasts. |
java.util.List<Affiliate> |
getOwners()
Returns a list of
Affiliate with the room owners. |
java.util.List<Occupant> |
getParticipants()
Returns a list of
Occupant with the room participants. |
Form |
getRegistrationForm()
Returns the room's registration form that an unaffiliated user, can use to become a member
of the room or
null if no registration is possible. |
java.lang.String |
getReservedNickname()
Returns the reserved room nickname for the user in the room.
|
org.jxmpp.jid.EntityBareJid |
getRoom()
Returns the name of the room this MultiUserChat object represents.
|
java.lang.String |
getSubject()
Returns the last known room's subject or
null if the user hasn't joined the room
or the room does not have a subject yet. |
org.jivesoftware.smack.XMPPConnection |
getXmppConnection()
Get the XMPP connection associated with this chat instance.
|
void |
grantAdmin(java.util.Collection<? extends org.jxmpp.jid.Jid> jids)
Grants administrator privileges to other users.
|
void |
grantAdmin(org.jxmpp.jid.Jid jid)
Grants administrator privileges to another user.
|
void |
grantMembership(java.util.Collection<? extends org.jxmpp.jid.Jid> jids)
Grants membership to other users.
|
void |
grantMembership(org.jxmpp.jid.Jid jid)
Grants membership to a user.
|
void |
grantModerator(java.util.Collection<org.jxmpp.jid.parts.Resourcepart> nicknames)
Grants moderator privileges to participants or visitors.
|
void |
grantModerator(org.jxmpp.jid.parts.Resourcepart nickname)
Grants moderator privileges to a participant or visitor.
|
void |
grantOwnership(java.util.Collection<? extends org.jxmpp.jid.Jid> jids)
Grants ownership privileges to other users.
|
void |
grantOwnership(org.jxmpp.jid.Jid jid)
Grants ownership privileges to another user.
|
void |
grantVoice(java.util.Collection<org.jxmpp.jid.parts.Resourcepart> nicknames)
Grants voice to visitors in the room.
|
void |
grantVoice(org.jxmpp.jid.parts.Resourcepart nickname)
Grants voice to a visitor in the room.
|
void |
invite(org.jxmpp.jid.EntityBareJid user,
java.lang.String reason)
Invites another user to the room in which one is an occupant.
|
void |
invite(org.jivesoftware.smack.packet.Message message,
org.jxmpp.jid.EntityBareJid user,
java.lang.String reason)
Invites another user to the room in which one is an occupant using a given Message.
|
boolean |
isJoined()
Returns true if currently in the multi user chat (after calling the
join(Resourcepart) method). |
void |
join(MucEnterConfiguration mucEnterConfiguration)
Joins the chat room using the specified nickname and password.
|
void |
join(org.jxmpp.jid.parts.Resourcepart nickname)
Joins the chat room using the specified nickname.
|
void |
join(org.jxmpp.jid.parts.Resourcepart nickname,
java.lang.String password)
Joins the chat room using the specified nickname and password.
|
void |
kickParticipant(org.jxmpp.jid.parts.Resourcepart nickname,
java.lang.String reason)
Kicks a visitor or participant from the room.
|
org.jivesoftware.smack.packet.Presence |
leave()
Leave the chat room.
|
org.jivesoftware.smack.packet.Presence |
leaveSync()
Deprecated.
use
leave() instead. |
org.jivesoftware.smack.packet.Message |
nextMessage()
Returns the next available message in the chat.
|
org.jivesoftware.smack.packet.Message |
nextMessage(long timeout)
Returns the next available message in the chat.
|
org.jivesoftware.smack.packet.Message |
pollMessage()
Polls for and returns the next message, or
null if there isn't
a message immediately available. |
boolean |
removeInvitationRejectionListener(InvitationRejectionListener listener)
Removes a listener from invitation rejections notifications.
|
boolean |
removeMessageListener(org.jivesoftware.smack.MessageListener listener)
Removes a stanza listener that was being notified of any new messages in the
multi user chat.
|
boolean |
removeParticipantListener(org.jivesoftware.smack.PresenceListener listener)
Removes a stanza listener that was being notified of any new Presence packets
sent to the group chat.
|
boolean |
removeParticipantStatusListener(ParticipantStatusListener listener)
Removes a listener that was being notified of changes in occupants status in the room
such as the user being kicked, banned, or granted admin permissions.
|
void |
removePresenceInterceptor(org.jivesoftware.smack.PresenceListener presenceInterceptor)
Removes a
StanzaListener that was being invoked every time a new presence
was being sent by this MultiUserChat to the server. |
boolean |
removeSubjectUpdatedListener(SubjectUpdatedListener listener)
Removes a listener from subject change notifications.
|
boolean |
removeUserStatusListener(UserStatusListener listener)
Removes a listener that was being notified of changes in your status in the room
such as the user being kicked, banned, or granted admin permissions.
|
void |
requestVoice()
Sends a voice request to the MUC.
|
void |
revokeAdmin(java.util.Collection<? extends org.jxmpp.jid.Jid> jids)
Revokes administrator privileges from users.
|
void |
revokeAdmin(org.jxmpp.jid.EntityJid jid)
Revokes administrator privileges from a user.
|
void |
revokeMembership(java.util.Collection<? extends org.jxmpp.jid.Jid> jids)
Revokes users' membership.
|
void |
revokeMembership(org.jxmpp.jid.Jid jid)
Revokes a user's membership.
|
void |
revokeModerator(java.util.Collection<org.jxmpp.jid.parts.Resourcepart> nicknames)
Revokes moderator privileges from other users.
|
void |
revokeModerator(org.jxmpp.jid.parts.Resourcepart nickname)
Revokes moderator privileges from another user.
|
void |
revokeOwnership(java.util.Collection<? extends org.jxmpp.jid.Jid> jids)
Revokes ownership privileges from other users.
|
void |
revokeOwnership(org.jxmpp.jid.Jid jid)
Revokes ownership privileges from another user.
|
void |
revokeVoice(java.util.Collection<org.jxmpp.jid.parts.Resourcepart> nicknames)
Revokes voice from participants in the room.
|
void |
revokeVoice(org.jxmpp.jid.parts.Resourcepart nickname)
Revokes voice from a participant in the room.
|
void |
sendConfigurationForm(Form form)
Sends the completed configuration form to the server.
|
void |
sendMessage(org.jivesoftware.smack.packet.Message message)
Sends a Message to the chat room.
|
void |
sendMessage(java.lang.String text)
Sends a message to the chat room.
|
void |
sendRegistrationForm(Form form)
Sends the completed registration form to the server.
|
java.lang.String |
toString() |
public org.jxmpp.jid.EntityBareJid getRoom()
public MucEnterConfiguration.Builder getEnterConfigurationBuilder(org.jxmpp.jid.parts.Resourcepart nickname)
nickname
- the nickname used when entering the MUC room.public MultiUserChat.MucCreateConfigFormHandle create(org.jxmpp.jid.parts.Resourcepart nickname) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, java.lang.InterruptedException, MultiUserChatException.MucAlreadyJoinedException, org.jivesoftware.smack.SmackException.NotConnectedException, MultiUserChatException.MissingMucCreationAcknowledgeException, MultiUserChatException.NotAMucServiceException
To create an "Instant Room", that means a room with some default configuration that is
available for immediate access, the room's owner should send an empty form after creating the
room. Simply call MultiUserChat.MucCreateConfigFormHandle.makeInstant()
on the returned MultiUserChat.MucCreateConfigFormHandle
.
To create a "Reserved Room", that means a room manually configured by the room creator before
anyone is allowed to enter, the room's owner should complete and send a form after creating
the room. Once the completed configuration form is sent to the server, the server will unlock
the room. You can use the returned MultiUserChat.MucCreateConfigFormHandle
to configure the room.
nickname
- the nickname to use.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if the room couldn't be created for some reason (e.g. 405 error if
the user is not allowed to create the room)org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.java.lang.InterruptedException
- if the calling thread was interrupted.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.MultiUserChatException.MucAlreadyJoinedException
- if already joined the Multi-User Chat.7yMultiUserChatException.MissingMucCreationAcknowledgeException
- if there MUC creation was not acknowledged by the service.MultiUserChatException.NotAMucServiceException
- if the entity is not a MUC serivce.public MultiUserChat.MucCreateConfigFormHandle createOrJoin(org.jxmpp.jid.parts.Resourcepart nickname) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, java.lang.InterruptedException, MultiUserChatException.MucAlreadyJoinedException, org.jivesoftware.smack.SmackException.NotConnectedException, MultiUserChatException.NotAMucServiceException
nickname
- the nickname to use in the MUC room.MultiUserChat.MucCreateConfigFormHandle
if the room was created while joining, or null
if the room was just joined.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the remote entity.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if there was an XMPP error returned.java.lang.InterruptedException
- if the calling thread was interrupted.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.MultiUserChatException.MucAlreadyJoinedException
- if already joined the Multi-User Chat.7yMultiUserChatException.NotAMucServiceException
- if the entity is not a MUC serivce.public MultiUserChat.MucCreateConfigFormHandle createOrJoin(MucEnterConfiguration mucEnterConfiguration) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, java.lang.InterruptedException, MultiUserChatException.MucAlreadyJoinedException, org.jivesoftware.smack.SmackException.NotConnectedException, MultiUserChatException.NotAMucServiceException
create(Resourcepart)
, but will return a MultiUserChat.MucCreateConfigFormHandle
if the room creation was acknowledged by
the service (with an 201 status code). It's up to the caller to decide, based on the return
value, if he needs to continue sending the room configuration. If null
is returned, the room
already existed and the user is able to join right away, without sending a form.mucEnterConfiguration
- the configuration used to enter the MUC.MultiUserChat.MucCreateConfigFormHandle
if the room was created while joining, or null
if the room was just joined.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if the room couldn't be created for some reason (e.g. 405 error if
the user is not allowed to create the room)org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.java.lang.InterruptedException
- if the calling thread was interrupted.MultiUserChatException.MucAlreadyJoinedException
- if the MUC is already joinedorg.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.MultiUserChatException.NotAMucServiceException
- if the entity is not a MUC serivce.public MultiUserChat.MucCreateConfigFormHandle createOrJoinIfNecessary(org.jxmpp.jid.parts.Resourcepart nickname, java.lang.String password) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, MultiUserChatException.NotAMucServiceException
nickname
- the required nickname to use.password
- the optional password required to joinMultiUserChat.MucCreateConfigFormHandle
if the room was created while joining, or null
if the room was just joined.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the remote entity.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if there was an XMPP error returned.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.MultiUserChatException.NotAMucServiceException
- if the entity is not a MUC serivce.public void join(org.jxmpp.jid.parts.Resourcepart nickname) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, MultiUserChatException.NotAMucServiceException
nickname
- the nickname to use.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the remote entity.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs joining the room. In particular, a
401 error can occur if no password was provided and one is required; or a
403 error can occur if the user is banned; or a
404 error can occur if the room does not exist or is locked; or a
407 error can occur if user is not on the member list; or a
409 error can occur if someone is already in the group chat with the same nickname.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.MultiUserChatException.NotAMucServiceException
- if the entity is not a MUC serivce.public void join(org.jxmpp.jid.parts.Resourcepart nickname, java.lang.String password) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, java.lang.InterruptedException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, MultiUserChatException.NotAMucServiceException
A password is required when joining password protected rooms. If the room does not require a password there is no need to provide one.
nickname
- the nickname to use.password
- the password to use.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs joining the room. In particular, a
401 error can occur if no password was provided and one is required; or a
403 error can occur if the user is banned; or a
404 error can occur if the room does not exist or is locked; or a
407 error can occur if user is not on the member list; or a
409 error can occur if someone is already in the group chat with the same nickname.java.lang.InterruptedException
- if the calling thread was interrupted.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.MultiUserChatException.NotAMucServiceException
- if the entity is not a MUC serivce.public void join(MucEnterConfiguration mucEnterConfiguration) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, MultiUserChatException.NotAMucServiceException
To control the amount of history to receive while joining a room you will need to provide a configured DiscussionHistory object.
A password is required when joining password protected rooms. If the room does not require a password there is no need to provide one.
If the room does not already exist when the user seeks to enter it, the server will decide to create a new room or not.
mucEnterConfiguration
- the configuration used to enter the MUC.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs joining the room. In particular, a
401 error can occur if no password was provided and one is required; or a
403 error can occur if the user is banned; or a
404 error can occur if the room does not exist or is locked; or a
407 error can occur if user is not on the member list; or a
409 error can occur if someone is already in the group chat with the same nickname.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.MultiUserChatException.NotAMucServiceException
- if the entity is not a MUC serivce.public boolean isJoined()
join(Resourcepart)
method).@Deprecated public org.jivesoftware.smack.packet.Presence leaveSync() throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, MultiUserChatException.MucNotJoinedException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException
leave()
instead.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if there was an XMPP error returned.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the remote entity.MultiUserChatException.MucNotJoinedException
- if not joined to the Multi-User Chat.public org.jivesoftware.smack.packet.Presence leave() throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, MultiUserChatException.MucNotJoinedException
org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if there was an XMPP error returned.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the remote entity.MultiUserChatException.MucNotJoinedException
- if not joined to the Multi-User Chat.public MucConfigFormManager getConfigFormManager() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
MucConfigFormManager
to configure this room.
Only room owners are able to configure a room.
org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the remote entity.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if there was an XMPP error returned.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public Form getConfigurationForm() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
null
if
no configuration is possible. The configuration form allows to set the room's language,
enable logging, specify room's type, etc..null
if no configuration is possible.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs asking the configuration form for the room.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void sendConfigurationForm(Form form) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
form
- the form with the new settings.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs setting the new rooms' configuration.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public Form getRegistrationForm() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
null
if no registration is possible. Some rooms may restrict the
privilege to register members and allow only room admins to add new members.If the user requesting registration requirements is not allowed to register with the room (e.g. because that privilege has been restricted), the room will return a "Not Allowed" error to the user (error code 405).
null
if no registration is possible.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs asking the registration form for the room or a
405 error if the user is not allowed to register with the room.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void sendRegistrationForm(Form form) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
If the desired room nickname is already reserved for that room, the room will return a "Conflict" error to the user (error code 409). If the room does not support registration, it will return a "Service Unavailable" error to the user (error code 503).
form
- the completed registration form.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs submitting the registration form. In particular, a
409 error can occur if the desired room nickname is already reserved for that room;
or a 503 error can occur if the room does not support registration.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void destroy(java.lang.String reason, org.jxmpp.jid.EntityBareJid alternateJID) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
reason
- the reason for the room destruction.alternateJID
- the JID of an alternate location.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs while trying to destroy the room.
An error can occur which will be wrapped by an XMPPException --
XMPP error code 403. The error code can be used to present more
appropiate error messages to end-users.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void invite(org.jxmpp.jid.EntityBareJid user, java.lang.String reason) throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
If the room is password-protected, the invitee will receive a password to use to join the room. If the room is members-only, the the invitee may be added to the member list.
user
- the user to invite to the room.(e.g. hecate@shakespeare.lit)reason
- the reason why the user is being invited.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void invite(org.jivesoftware.smack.packet.Message message, org.jxmpp.jid.EntityBareJid user, java.lang.String reason) throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
If the room is password-protected, the invitee will receive a password to use to join the room. If the room is members-only, the the invitee may be added to the member list.
message
- the message to use for sending the invitation.user
- the user to invite to the room.(e.g. hecate@shakespeare.lit)reason
- the reason why the user is being invited.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public boolean addInvitationRejectionListener(InvitationRejectionListener listener)
listener
- an invitation rejection listener.public boolean removeInvitationRejectionListener(InvitationRejectionListener listener)
listener
- an invitation rejection listener.public boolean addSubjectUpdatedListener(SubjectUpdatedListener listener)
listener
- a subject updated listener.public boolean removeSubjectUpdatedListener(SubjectUpdatedListener listener)
listener
- a subject updated listener.public void addPresenceInterceptor(org.jivesoftware.smack.PresenceListener presenceInterceptor)
StanzaListener
that will be invoked every time a new presence
is going to be sent by this MultiUserChat to the server. Stanza interceptors may
add new extensions to the presence that is going to be sent to the MUC service.presenceInterceptor
- the new stanza interceptor that will intercept presence packets.public void removePresenceInterceptor(org.jivesoftware.smack.PresenceListener presenceInterceptor)
StanzaListener
that was being invoked every time a new presence
was being sent by this MultiUserChat to the server. Stanza interceptors may
add new extensions to the presence that is going to be sent to the MUC service.presenceInterceptor
- the stanza interceptor to remove.public java.lang.String getSubject()
null
if the user hasn't joined the room
or the room does not have a subject yet. In case the room has a subject, as soon as the
user joins the room a message with the current room's subject will be received.
To be notified every time the room's subject change you should add a listener
to this room. addSubjectUpdatedListener(SubjectUpdatedListener)
To change the room's subject use changeSubject(String)
.
null
if the user hasn't joined the room or the
room does not have a subject yet.public java.lang.String getReservedNickname() throws org.jivesoftware.smack.SmackException, java.lang.InterruptedException
null
if none.org.jivesoftware.smack.SmackException
- if there was no response from the server.java.lang.InterruptedException
- if the calling thread was interrupted.public org.jxmpp.jid.parts.Resourcepart getNickname()
null
if not
currently joined.public void changeNickname(org.jxmpp.jid.parts.Resourcepart nickname) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, MultiUserChatException.MucNotJoinedException
nickname
- the new nickname within the room.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if the new nickname is already in use by another occupant.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.MultiUserChatException.MucNotJoinedException
- if not joined to the Multi-User Chat.public void changeAvailabilityStatus(java.lang.String status, org.jivesoftware.smack.packet.Presence.Mode mode) throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, MultiUserChatException.MucNotJoinedException
status
- a text message describing the presence update.mode
- the mode type for the presence update.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.MultiUserChatException.MucNotJoinedException
- if not joined to the Multi-User Chat.public void kickParticipant(org.jxmpp.jid.parts.Resourcepart nickname, java.lang.String reason) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
nickname
- the nickname of the participant or visitor to kick from the room
(e.g. "john").reason
- the reason why the participant or visitor is being kicked from the room.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs kicking the occupant. In particular, a
405 error can occur if a moderator or a user with an affiliation of "owner" or "admin"
was intended to be kicked (i.e. Not Allowed error); or a
403 error can occur if the occupant that intended to kick another occupant does
not have kicking privileges (i.e. Forbidden error); or a
400 error can occur if the provided nickname is not present in the room.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void requestVoice() throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void grantVoice(java.util.Collection<org.jxmpp.jid.parts.Resourcepart> nicknames) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
nicknames
- the nicknames of the visitors to grant voice in the room (e.g. "john").org.jivesoftware.smack.XMPPException.XMPPErrorException
- 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.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void grantVoice(org.jxmpp.jid.parts.Resourcepart nickname) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
nickname
- the nickname of the visitor to grant voice in the room (e.g. "john").org.jivesoftware.smack.XMPPException.XMPPErrorException
- 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.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void revokeVoice(java.util.Collection<org.jxmpp.jid.parts.Resourcepart> nicknames) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
nicknames
- the nicknames of the participants to revoke voice (e.g. "john").org.jivesoftware.smack.XMPPException.XMPPErrorException
- 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.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void revokeVoice(org.jxmpp.jid.parts.Resourcepart nickname) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
nickname
- the nickname of the participant to revoke voice (e.g. "john").org.jivesoftware.smack.XMPPException.XMPPErrorException
- 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.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void banUsers(java.util.Collection<? extends org.jxmpp.jid.Jid> jids) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
jids
- the bare XMPP user IDs of the users to ban.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs banning a user. In particular, a
405 error can occur if a moderator or a user with an affiliation of "owner" or "admin"
was tried to be banned (i.e. Not Allowed error).org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void banUser(org.jxmpp.jid.Jid jid, java.lang.String reason) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
jid
- the bare XMPP user ID of the user to ban (e.g. "user@host.org").reason
- the optional reason why the user was banned.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs banning a user. In particular, a
405 error can occur if a moderator or a user with an affiliation of "owner" or "admin"
was tried to be banned (i.e. Not Allowed error).org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void grantMembership(java.util.Collection<? extends org.jxmpp.jid.Jid> jids) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
jids
- the XMPP user IDs of the users to grant membership.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs granting membership to a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void grantMembership(org.jxmpp.jid.Jid jid) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
jid
- the XMPP user ID of the user to grant membership (e.g. "user@host.org").org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs granting membership to a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void revokeMembership(java.util.Collection<? extends org.jxmpp.jid.Jid> jids) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
jids
- the bare XMPP user IDs of the users to revoke membership.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs revoking membership to a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void revokeMembership(org.jxmpp.jid.Jid jid) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
jid
- the bare XMPP user ID of the user to revoke membership (e.g. "user@host.org").org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs revoking membership to a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void grantModerator(java.util.Collection<org.jxmpp.jid.parts.Resourcepart> nicknames) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
nicknames
- the nicknames of the occupants to grant moderator privileges.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs granting moderator privileges to a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void grantModerator(org.jxmpp.jid.parts.Resourcepart nickname) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
nickname
- the nickname of the occupant to grant moderator privileges.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs granting moderator privileges to a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void revokeModerator(java.util.Collection<org.jxmpp.jid.parts.Resourcepart> nicknames) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
nicknames
- the nicknames of the occupants to revoke moderator privileges.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs revoking moderator privileges from a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void revokeModerator(org.jxmpp.jid.parts.Resourcepart nickname) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
nickname
- the nickname of the occupant to revoke moderator privileges.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs revoking moderator privileges from a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void grantOwnership(java.util.Collection<? extends org.jxmpp.jid.Jid> jids) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
jids
- the collection of bare XMPP user IDs of the users to grant ownership.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs granting ownership privileges to a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void grantOwnership(org.jxmpp.jid.Jid jid) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
jid
- the bare XMPP user ID of the user to grant ownership (e.g. "user@host.org").org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs granting ownership privileges to a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void revokeOwnership(java.util.Collection<? extends org.jxmpp.jid.Jid> jids) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
jids
- the bare XMPP user IDs of the users to revoke ownership.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs revoking ownership privileges from a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void revokeOwnership(org.jxmpp.jid.Jid jid) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
jid
- the bare XMPP user ID of the user to revoke ownership (e.g. "user@host.org").org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs revoking ownership privileges from a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void grantAdmin(java.util.Collection<? extends org.jxmpp.jid.Jid> jids) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
jids
- the bare XMPP user IDs of the users to grant administrator privileges.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs granting administrator privileges to a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void grantAdmin(org.jxmpp.jid.Jid jid) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
jid
- the bare XMPP user ID of the user to grant administrator privileges
(e.g. "user@host.org").org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs granting administrator privileges to a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void revokeAdmin(java.util.Collection<? extends org.jxmpp.jid.Jid> jids) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
jids
- the bare XMPP user IDs of the user to revoke administrator privileges.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs revoking administrator privileges from a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void revokeAdmin(org.jxmpp.jid.EntityJid jid) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
jid
- the bare XMPP user ID of the user to revoke administrator privileges
(e.g. "user@host.org").org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs revoking administrator privileges from a user.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public int getOccupantsCount()
Note: this value will only be accurate after joining the group chat, and may fluctuate over time. If you query this value directly after joining the group chat it may not be accurate, as it takes a certain amount of time for the server to send all presence packets to this client.
public java.util.List<org.jxmpp.jid.EntityFullJid> getOccupants()
XmppStringUtils.parseResource(String)
method.
Note: this value will only be accurate after joining the group chat, and may
fluctuate over time.public org.jivesoftware.smack.packet.Presence getOccupantPresence(org.jxmpp.jid.EntityFullJid user)
null
if the user
is not in the room.user
- the room occupant to search for his presence. The format of user must
be: roomName@service/nickname (e.g. darkcave@macbeth.shakespeare.lit/thirdwitch).null
if the user is unavailable
or if no presence information is available.public Occupant getOccupant(org.jxmpp.jid.EntityFullJid user)
null
if the
user is not in the room. The Occupant object may include information such as full
JID of the user as well as the role and affiliation of the user in the room.user
- the room occupant to search for his presence. The format of user must
be: roomName@service/nickname (e.g. darkcave@macbeth.shakespeare.lit/thirdwitch).null
if the user is unavailable (i.e. not in the room).public boolean addParticipantListener(org.jivesoftware.smack.PresenceListener listener)
listener
- a stanza listener that will be notified of any presence packets
sent to the group chat.public boolean removeParticipantListener(org.jivesoftware.smack.PresenceListener listener)
listener
- a stanza listener that was being notified of any presence packets
sent to the group chat.public java.util.List<Affiliate> getOwners() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Affiliate
with the room owners.Affiliate
with the room owners.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if you don't have enough privileges to get this information.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public java.util.List<Affiliate> getAdmins() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Affiliate
with the room administrators.Affiliate
with the room administrators.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if you don't have enough privileges to get this information.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public java.util.List<Affiliate> getMembers() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Affiliate
with the room members.Affiliate
with the room members.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if you don't have enough privileges to get this information.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public java.util.List<Affiliate> getOutcasts() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Affiliate
with the room outcasts.Affiliate
with the room outcasts.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if you don't have enough privileges to get this information.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public java.util.List<Occupant> getModerators() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Occupant
with the room moderators.Occupant
with the room moderators.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if you don't have enough privileges to get this information.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public java.util.List<Occupant> getParticipants() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Occupant
with the room participants.Occupant
with the room participants.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if you don't have enough privileges to get this information.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void sendMessage(java.lang.String text) throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
text
- the text of the message to send.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public org.jivesoftware.smack.chat.Chat createPrivateChat(org.jxmpp.jid.EntityFullJid occupant, org.jivesoftware.smack.chat.ChatMessageListener listener)
occupant
- occupant unique room JID (e.g. 'darkcave@macbeth.shakespeare.lit/Paul').listener
- the listener is a message listener that will handle messages for the newly
created chat.public org.jivesoftware.smack.packet.Message createMessage()
public void sendMessage(org.jivesoftware.smack.packet.Message message) throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
message
- the message.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public org.jivesoftware.smack.packet.Message pollMessage() throws MultiUserChatException.MucNotJoinedException
null
if there isn't
a message immediately available. This method provides significantly different
functionalty than the nextMessage()
method since it's non-blocking.
In other words, the method call will always return immediately, whereas the
nextMessage method will return only when a message is available (or after
a specific timeout).null
otherwise.MultiUserChatException.MucNotJoinedException
- if not joined to the Multi-User Chat.public org.jivesoftware.smack.packet.Message nextMessage() throws MultiUserChatException.MucNotJoinedException, java.lang.InterruptedException
MultiUserChatException.MucNotJoinedException
- if not joined to the Multi-User Chat.java.lang.InterruptedException
- if the calling thread was interrupted.public org.jivesoftware.smack.packet.Message nextMessage(long timeout) throws MultiUserChatException.MucNotJoinedException, java.lang.InterruptedException
timeout
has elapased.
If the timeout elapses without a result, null
will be returned.timeout
- the maximum amount of time to wait for the next message.null
if the timeout elapses without a
message becoming available.MultiUserChatException.MucNotJoinedException
- if not joined to the Multi-User Chat.java.lang.InterruptedException
- if the calling thread was interrupted.public boolean addMessageListener(org.jivesoftware.smack.MessageListener listener)
listener
- a stanza listener.public boolean removeMessageListener(org.jivesoftware.smack.MessageListener listener)
listener
- a stanza listener.public void changeSubject(java.lang.String subject) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
subject
- the new room's subject to set.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if someone without appropriate privileges attempts to change the
room subject will throw an error with code 403 (i.e. Forbidden)org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public boolean addUserStatusListener(UserStatusListener listener)
listener
- a user status listener.public boolean removeUserStatusListener(UserStatusListener listener)
listener
- a user status listener.public boolean addParticipantStatusListener(ParticipantStatusListener listener)
listener
- a participant status listener.public boolean removeParticipantStatusListener(ParticipantStatusListener listener)
listener
- a participant status listener.public org.jivesoftware.smack.XMPPConnection getXmppConnection()
public java.lang.String toString()
toString
in class java.lang.Object