Class MultiUserChatLight


  • public class MultiUserChatLight
    extends java.lang.Object
    MUCLight class.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String AFFILIATIONS  
      static java.lang.String BLOCKING  
      static java.lang.String CONFIGURATION  
      static java.lang.String CREATE  
      static java.lang.String DESTROY  
      static java.lang.String INFO  
      static java.lang.String NAMESPACE  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean addMessageListener​(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.MessageBuilder buildMessage()
      Constructs a new message builder for messages send to this MUC room.
      void changeAffiliations​(java.util.HashMap<org.jxmpp.jid.Jid,​MUCLightAffiliation> affiliations)
      Change the MUC Light affiliations.
      void changeRoomName​(java.lang.String roomName)
      Change the name of the room.
      void changeSubject​(java.lang.String subject)
      Change the subject of the MUC Light.
      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)
      Create new MUCLight.
      void create​(java.lang.String roomName, java.util.List<org.jxmpp.jid.Jid> occupants)
      Create new MUCLight.
      org.jivesoftware.smack.packet.Message createMessage()
      Deprecated.
      use buildMessage() instead.
      org.jivesoftware.smack.chat.Chat createPrivateChat​(org.jxmpp.jid.EntityJid occupant, org.jivesoftware.smack.chat.ChatMessageListener listener)
      Deprecated.
      void destroy()
      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.
      MUCLightRoomConfiguration getConfiguration()
      Get the MUC Light configuration.
      MUCLightRoomConfiguration getConfiguration​(java.lang.String version)
      Get the MUC Light configuration.
      MUCLightRoomInfo getFullInfo()
      Get the MUC Light info.
      MUCLightRoomInfo getFullInfo​(java.lang.String version)
      Get the MUC Light info.
      org.jxmpp.jid.EntityJid getRoom()
      Returns the JID of the room.
      void leave()
      Leave the MUCLight.
      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.
      boolean removeMessageListener​(org.jivesoftware.smack.MessageListener listener)
      Removes a stanza listener that was being notified of any new messages in the MUCLight.
      void sendMessage​(java.lang.String text)
      Sends a message to the chat room.
      void sendMessage​(org.jivesoftware.smack.packet.Message message)
      Deprecated.
      void sendMessage​(org.jivesoftware.smack.packet.MessageBuilder messageBuilder)
      Sends a Message to the chat room.
      void setRoomConfigs​(java.lang.String roomName, java.util.HashMap<java.lang.String,​java.lang.String> customConfigs)
      Set the room configurations.
      void setRoomConfigs​(java.util.HashMap<java.lang.String,​java.lang.String> customConfigs)
      Set the room configurations.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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.InterruptedException
        Sends 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.
        use buildMessage() 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.InterruptedException
        Deprecated.
        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.InterruptedException
        Sends 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.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:
        java.lang.InterruptedException - if the calling thread was interrupted.
      • nextMessage

        public org.jivesoftware.smack.packet.Message nextMessage​(long timeout)
                                                          throws java.lang.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:
        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:
        toString in class java.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.Exception
        Create new MUCLight.
        Parameters:
        roomName - TODO javadoc me please
        subject - TODO javadoc me please
        customConfigs - TODO javadoc me please
        occupants - 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.Exception
        Create new MUCLight.
        Parameters:
        roomName - TODO javadoc me please
        occupants - 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.XMPPErrorException
        Leave 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.InterruptedException
        Destroy 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.InterruptedException
        Change 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.InterruptedException
        Change 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.InterruptedException
        Set 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.InterruptedException
        Set the room configurations.
        Parameters:
        roomName - TODO javadoc me please
        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.