Package org.jivesoftware.smackx.muclight
Class MultiUserChatLight
- java.lang.Object
-
- org.jivesoftware.smackx.muclight.MultiUserChatLight
-
public class MultiUserChatLight extends java.lang.ObjectMUCLight class.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAFFILIATIONSstatic java.lang.StringBLOCKINGstatic java.lang.StringCONFIGURATIONstatic java.lang.StringCREATEstatic java.lang.StringDESTROYstatic java.lang.StringINFOstatic java.lang.StringNAMESPACE
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanaddMessageListener(org.jivesoftware.smack.MessageListener listener)Adds a stanza listener that will be notified of any new messages in the group chat.org.jivesoftware.smack.packet.MessageBuilderbuildMessage()Constructs a new message builder for messages send to this MUC room.voidchangeAffiliations(java.util.HashMap<org.jxmpp.jid.Jid,MUCLightAffiliation> affiliations)Change the MUC Light affiliations.voidchangeRoomName(java.lang.String roomName)Change the name of the room.voidchangeSubject(java.lang.String subject)Change the subject of the MUC Light.voidcreate(java.lang.String roomName, java.lang.String subject, java.util.HashMap<java.lang.String,java.lang.String> customConfigs, java.util.List<org.jxmpp.jid.Jid> occupants)Create new MUCLight.voidcreate(java.lang.String roomName, java.util.List<org.jxmpp.jid.Jid> occupants)Create new MUCLight.org.jivesoftware.smack.packet.MessagecreateMessage()Deprecated.usebuildMessage()instead.org.jivesoftware.smack.chat.ChatcreatePrivateChat(org.jxmpp.jid.EntityJid occupant, org.jivesoftware.smack.chat.ChatMessageListener listener)Deprecated.voiddestroy()Destroy the MUC Light.java.util.HashMap<org.jxmpp.jid.Jid,MUCLightAffiliation>getAffiliations()Get the MUC Light affiliations.java.util.HashMap<org.jxmpp.jid.Jid,MUCLightAffiliation>getAffiliations(java.lang.String version)Get the MUC Light affiliations.MUCLightRoomConfigurationgetConfiguration()Get the MUC Light configuration.MUCLightRoomConfigurationgetConfiguration(java.lang.String version)Get the MUC Light configuration.MUCLightRoomInfogetFullInfo()Get the MUC Light info.MUCLightRoomInfogetFullInfo(java.lang.String version)Get the MUC Light info.org.jxmpp.jid.EntityJidgetRoom()Returns the JID of the room.voidleave()Leave the MUCLight.org.jivesoftware.smack.packet.MessagenextMessage()Returns the next available message in the chat.org.jivesoftware.smack.packet.MessagenextMessage(long timeout)Returns the next available message in the chat.org.jivesoftware.smack.packet.MessagepollMessage()Polls for and returns the next message.booleanremoveMessageListener(org.jivesoftware.smack.MessageListener listener)Removes a stanza listener that was being notified of any new messages in the MUCLight.voidsendMessage(java.lang.String text)Sends a message to the chat room.voidsendMessage(org.jivesoftware.smack.packet.Message message)Deprecated.usesendMessage(MessageBuilder)instead.voidsendMessage(org.jivesoftware.smack.packet.MessageBuilder messageBuilder)Sends a Message to the chat room.voidsetRoomConfigs(java.lang.String roomName, java.util.HashMap<java.lang.String,java.lang.String> customConfigs)Set the room configurations.voidsetRoomConfigs(java.util.HashMap<java.lang.String,java.lang.String> customConfigs)Set the room configurations.java.lang.StringtoString()
-
-
-
Field Detail
-
NAMESPACE
public static final java.lang.String NAMESPACE
- See Also:
- Constant Field Values
-
AFFILIATIONS
public static final java.lang.String AFFILIATIONS
- See Also:
- Constant Field Values
-
INFO
public static final java.lang.String INFO
- See Also:
- Constant Field Values
-
CONFIGURATION
public static final java.lang.String CONFIGURATION
- See Also:
- Constant Field Values
-
CREATE
public static final java.lang.String CREATE
- See Also:
- Constant Field Values
-
DESTROY
public static final java.lang.String DESTROY
- See Also:
- Constant Field Values
-
BLOCKING
public static final java.lang.String BLOCKING
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRoom
public org.jxmpp.jid.EntityJid getRoom()
Returns the JID of the room.- Returns:
- the MUCLight room JID.
-
sendMessage
public void sendMessage(java.lang.String text) throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedExceptionSends a message to the chat room.- Parameters:
text- TODO javadoc me please the text of the message to send.- Throws:
org.jivesoftware.smack.SmackException.NotConnectedException- if the XMPP connection is not connected.java.lang.InterruptedException- if the calling thread was interrupted.
-
createPrivateChat
@Deprecated public org.jivesoftware.smack.chat.Chat createPrivateChat(org.jxmpp.jid.EntityJid occupant, org.jivesoftware.smack.chat.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 org.jivesoftware.smack.packet.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 org.jivesoftware.smack.packet.MessageBuilder buildMessage()
Constructs a new message builder for messages send to this MUC room.- Returns:
- a new message builder.
-
sendMessage
@Deprecated public void sendMessage(org.jivesoftware.smack.packet.Message message) throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedExceptionDeprecated.usesendMessage(MessageBuilder)instead.Sends a Message to the chat room.- Parameters:
message- TODO javadoc me please the message.- Throws:
org.jivesoftware.smack.SmackException.NotConnectedException- if the XMPP connection is not connected.java.lang.InterruptedException- if the calling thread was interrupted.
-
sendMessage
public void sendMessage(org.jivesoftware.smack.packet.MessageBuilder messageBuilder) throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedExceptionSends a Message to the chat room.- Parameters:
messageBuilder- the message.- Throws:
org.jivesoftware.smack.SmackException.NotConnectedException- if the XMPP connection is not connected.java.lang.InterruptedException- if the calling thread was interrupted.
-
pollMessage
public org.jivesoftware.smack.packet.Message pollMessage()
Polls for and returns the next message.- Returns:
- the next message if one is immediately available
-
nextMessage
public org.jivesoftware.smack.packet.Message nextMessage() throws java.lang.InterruptedExceptionReturns the next available message in the chat. The method call will block (not return) until a message is available.- Returns:
- the next message.
- Throws:
java.lang.InterruptedException- if the calling thread was interrupted.
-
nextMessage
public org.jivesoftware.smack.packet.Message nextMessage(long timeout) throws java.lang.InterruptedExceptionReturns 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:
java.lang.InterruptedException- if the calling thread was interrupted.
-
addMessageListener
public boolean addMessageListener(org.jivesoftware.smack.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(org.jivesoftware.smack.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.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
create
public void create(java.lang.String roomName, java.lang.String subject, java.util.HashMap<java.lang.String,java.lang.String> customConfigs, java.util.List<org.jxmpp.jid.Jid> occupants) throws java.lang.ExceptionCreate new MUCLight.- Parameters:
roomName- TODO javadoc me pleasesubject- TODO javadoc me pleasecustomConfigs- TODO javadoc me pleaseoccupants- TODO javadoc me please- Throws:
java.lang.Exception- TODO javadoc me please
-
create
public void create(java.lang.String roomName, java.util.List<org.jxmpp.jid.Jid> occupants) throws java.lang.ExceptionCreate new MUCLight.- Parameters:
roomName- TODO javadoc me pleaseoccupants- TODO javadoc me please- Throws:
java.lang.Exception- TODO javadoc me please
-
leave
public void leave() throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorExceptionLeave the MUCLight.- Throws:
org.jivesoftware.smack.SmackException.NotConnectedException- if the XMPP connection is not connected.java.lang.InterruptedException- if the calling thread was interrupted.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.
-
getFullInfo
public MUCLightRoomInfo getFullInfo(java.lang.String version) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Get the MUC Light info.- Parameters:
version- TODO javadoc me please- Returns:
- the room info
- Throws:
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.
-
getFullInfo
public MUCLightRoomInfo getFullInfo() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Get the MUC Light info.- Returns:
- the room info
- Throws:
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.
-
getConfiguration
public MUCLightRoomConfiguration getConfiguration(java.lang.String version) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Get the MUC Light configuration.- Parameters:
version- TODO javadoc me please- Returns:
- the room configuration
- Throws:
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.
-
getConfiguration
public MUCLightRoomConfiguration getConfiguration() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Get the MUC Light configuration.- Returns:
- the room configuration
- Throws:
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.
-
getAffiliations
public java.util.HashMap<org.jxmpp.jid.Jid,MUCLightAffiliation> getAffiliations(java.lang.String version) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Get the MUC Light affiliations.- Parameters:
version- TODO javadoc me please- Returns:
- the room affiliations
- Throws:
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.
-
getAffiliations
public java.util.HashMap<org.jxmpp.jid.Jid,MUCLightAffiliation> getAffiliations() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Get the MUC Light affiliations.- Returns:
- the room affiliations
- Throws:
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.
-
changeAffiliations
public void changeAffiliations(java.util.HashMap<org.jxmpp.jid.Jid,MUCLightAffiliation> affiliations) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
Change the MUC Light affiliations.- Parameters:
affiliations- TODO javadoc me please- Throws:
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.
-
destroy
public void destroy() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedExceptionDestroy the MUC Light. Only will work if it is requested by the owner.- Throws:
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.
-
changeSubject
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.InterruptedExceptionChange the subject of the MUC Light.- Parameters:
subject- TODO javadoc me please- Throws:
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.
-
changeRoomName
public void changeRoomName(java.lang.String roomName) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedExceptionChange the name of the room.- Parameters:
roomName- TODO javadoc me please- Throws:
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.
-
setRoomConfigs
public void setRoomConfigs(java.util.HashMap<java.lang.String,java.lang.String> customConfigs) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedExceptionSet the room configurations.- Parameters:
customConfigs- TODO javadoc me please- Throws:
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.
-
setRoomConfigs
public void setRoomConfigs(java.lang.String roomName, java.util.HashMap<java.lang.String,java.lang.String> customConfigs) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedExceptionSet the room configurations.- Parameters:
roomName- TODO javadoc me pleasecustomConfigs- TODO javadoc me please- Throws:
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.
-
-