Package org.jivesoftware.smackx.muclight
Class MultiUserChatLight
- java.lang.Object
-
- org.jivesoftware.smackx.muclight.MultiUserChatLight
-
public class MultiUserChatLight extends Object
MUCLight class.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
addMessageListener(MessageListener listener)
Adds a stanza listener that will be notified of any new messages in the group chat.MessageBuilder
buildMessage()
Constructs a new message builder for messages send to this MUC room.void
changeAffiliations(HashMap<Jid,MUCLightAffiliation> affiliations)
Change the MUC Light affiliations.void
changeRoomName(String roomName)
Change the name of the room.void
changeSubject(String subject)
Change the subject of the MUC Light.void
create(String roomName, String subject, HashMap<String,String> customConfigs, List<Jid> occupants)
Create new MUCLight.void
create(String roomName, List<Jid> occupants)
Create new MUCLight.Message
createMessage()
Deprecated.usebuildMessage()
instead.Chat
createPrivateChat(EntityJid occupant, ChatMessageListener listener)
Deprecated.void
destroy()
Destroy the MUC Light.HashMap<Jid,MUCLightAffiliation>
getAffiliations()
Get the MUC Light affiliations.HashMap<Jid,MUCLightAffiliation>
getAffiliations(String version)
Get the MUC Light affiliations.MUCLightRoomConfiguration
getConfiguration()
Get the MUC Light configuration.MUCLightRoomConfiguration
getConfiguration(String version)
Get the MUC Light configuration.MUCLightRoomInfo
getFullInfo()
Get the MUC Light info.MUCLightRoomInfo
getFullInfo(String version)
Get the MUC Light info.EntityJid
getRoom()
Returns the JID of the room.void
leave()
Leave the MUCLight.Message
nextMessage()
Returns the next available message in the chat.Message
nextMessage(long timeout)
Returns the next available message in the chat.Message
pollMessage()
Polls for and returns the next message.boolean
removeMessageListener(MessageListener listener)
Removes a stanza listener that was being notified of any new messages in the MUCLight.void
sendMessage(String text)
Sends a message to the chat room.void
sendMessage(Message message)
Deprecated.usesendMessage(MessageBuilder)
instead.void
sendMessage(MessageBuilder messageBuilder)
Sends a Message to the chat room.void
setRoomConfigs(String roomName, HashMap<String,String> customConfigs)
Set the room configurations.void
setRoomConfigs(HashMap<String,String> customConfigs)
Set the room configurations.String
toString()
-
-
-
Field Detail
-
NAMESPACE
public static final String NAMESPACE
- See Also:
- Constant Field Values
-
AFFILIATIONS
public static final String AFFILIATIONS
- See Also:
- Constant Field Values
-
INFO
public static final String INFO
- See Also:
- Constant Field Values
-
CONFIGURATION
public static final String CONFIGURATION
- See Also:
- Constant Field Values
-
CREATE
public static final String CREATE
- See Also:
- Constant Field Values
-
DESTROY
public static final String DESTROY
- See Also:
- Constant Field Values
-
BLOCKING
public static final String BLOCKING
- See Also:
- Constant Field Values
-
-
Method Detail
-
sendMessage
public void sendMessage(String text) throws SmackException.NotConnectedException, InterruptedException
Sends a message to the chat room.- Parameters:
text
- TODO javadoc me please the text of the message to send.- Throws:
SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
createPrivateChat
@Deprecated public Chat createPrivateChat(EntityJid occupant, ChatMessageListener listener)
Deprecated.Returns a new Chat for sending private messages to a given room occupant. The Chat's occupant address is the room's JID (i.e. roomName@service/nick). The server service will change the 'from' address to the sender's room JID and delivering the message to the intended recipient's full JID.- Parameters:
occupant
- TODO javadoc me please occupant unique room JID (e.g. 'darkcave@macbeth.shakespeare.lit/Paul').listener
- TODO javadoc me please the listener is a message listener that will handle messages for the newly created chat.- Returns:
- new Chat for sending private messages to a given room occupant.
-
createMessage
@Deprecated public Message createMessage()
Deprecated.usebuildMessage()
instead.Creates a new Message to send to the chat room.- Returns:
- a new Message addressed to the chat room.
-
buildMessage
public MessageBuilder buildMessage()
Constructs a new message builder for messages send to this MUC room.- Returns:
- a new message builder.
-
sendMessage
@Deprecated public void sendMessage(Message message) throws SmackException.NotConnectedException, InterruptedException
Deprecated.usesendMessage(MessageBuilder)
instead.Sends a Message to the chat room.- Parameters:
message
- TODO javadoc me please the message.- Throws:
SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
sendMessage
public void sendMessage(MessageBuilder messageBuilder) throws SmackException.NotConnectedException, InterruptedException
Sends a Message to the chat room.- Parameters:
messageBuilder
- the message.- Throws:
SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
pollMessage
public Message pollMessage()
Polls for and returns the next message.- Returns:
- the next message if one is immediately available
-
nextMessage
public Message nextMessage() throws InterruptedException
Returns the next available message in the chat. The method call will block (not return) until a message is available.- Returns:
- the next message.
- Throws:
InterruptedException
- if the calling thread was interrupted.
-
nextMessage
public Message nextMessage(long timeout) throws InterruptedException
Returns the next available message in the chat.- Parameters:
timeout
- TODO javadoc me please the maximum amount of time to wait for the next message.- Returns:
- the next message, or null if the timeout elapses without a message becoming available.
- Throws:
InterruptedException
- if the calling thread was interrupted.
-
addMessageListener
public boolean addMessageListener(MessageListener listener)
Adds a stanza listener that will be notified of any new messages in the group chat. Only "group chat" messages addressed to this group chat will be delivered to the listener.- Parameters:
listener
- TODO javadoc me please a stanza listener.- Returns:
- true if the listener was not already added.
-
removeMessageListener
public boolean removeMessageListener(MessageListener listener)
Removes a stanza listener that was being notified of any new messages in the MUCLight. Only "group chat" messages addressed to this MUCLight were being delivered to the listener.- Parameters:
listener
- TODO javadoc me please a stanza listener.- Returns:
- true if the listener was removed, otherwise the listener was not added previously.
-
create
public void create(String roomName, String subject, HashMap<String,String> customConfigs, List<Jid> occupants) throws Exception
Create new MUCLight.- Parameters:
roomName
- TODO javadoc me pleasesubject
- TODO javadoc me pleasecustomConfigs
- TODO javadoc me pleaseoccupants
- TODO javadoc me please- Throws:
Exception
- TODO javadoc me please
-
create
public void create(String roomName, List<Jid> occupants) throws Exception
Create new MUCLight.- Parameters:
roomName
- TODO javadoc me pleaseoccupants
- TODO javadoc me please- Throws:
Exception
- TODO javadoc me please
-
leave
public void leave() throws SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException, XMPPException.XMPPErrorException
Leave the MUCLight.- Throws:
SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.
-
getFullInfo
public MUCLightRoomInfo getFullInfo(String version) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Get the MUC Light info.- Parameters:
version
- TODO javadoc me please- Returns:
- the room info
- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
getFullInfo
public MUCLightRoomInfo getFullInfo() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Get the MUC Light info.- Returns:
- the room info
- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
getConfiguration
public MUCLightRoomConfiguration getConfiguration(String version) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Get the MUC Light configuration.- Parameters:
version
- TODO javadoc me please- Returns:
- the room configuration
- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
getConfiguration
public MUCLightRoomConfiguration getConfiguration() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Get the MUC Light configuration.- Returns:
- the room configuration
- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
getAffiliations
public HashMap<Jid,MUCLightAffiliation> getAffiliations(String version) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Get the MUC Light affiliations.- Parameters:
version
- TODO javadoc me please- Returns:
- the room affiliations
- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
getAffiliations
public HashMap<Jid,MUCLightAffiliation> getAffiliations() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Get the MUC Light affiliations.- Returns:
- the room affiliations
- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
changeAffiliations
public void changeAffiliations(HashMap<Jid,MUCLightAffiliation> affiliations) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Change the MUC Light affiliations.- Parameters:
affiliations
- TODO javadoc me please- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
destroy
public void destroy() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Destroy the MUC Light. Only will work if it is requested by the owner.- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
changeSubject
public void changeSubject(String subject) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Change the subject of the MUC Light.- Parameters:
subject
- TODO javadoc me please- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
changeRoomName
public void changeRoomName(String roomName) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Change the name of the room.- Parameters:
roomName
- TODO javadoc me please- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
setRoomConfigs
public void setRoomConfigs(HashMap<String,String> customConfigs) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Set the room configurations.- Parameters:
customConfigs
- TODO javadoc me please- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
setRoomConfigs
public void setRoomConfigs(String roomName, HashMap<String,String> customConfigs) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Set the room configurations.- Parameters:
roomName
- TODO javadoc me pleasecustomConfigs
- TODO javadoc me please- Throws:
SmackException.NoResponseException
- if there was no response from the remote entity.XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
-