Class MUCEventDelegate


  • public abstract class MUCEventDelegate
    extends Object
    Gives the implementer the ability to react to, allow, or deny MUC related events. For example: - Event: a user tries to join a room Reaction: the delegate decides to allow or deny the user from joining
    Author:
    Armando Jagucki
    • Constructor Detail

      • MUCEventDelegate

        public MUCEventDelegate()
    • Method Detail

      • joiningRoom

        public abstract boolean joiningRoom​(MUCRoom room,
                                            org.xmpp.packet.JID userjid)
        This event will be triggered when an entity joins an existing room. Returns true if the user is allowed to join the room.
        Parameters:
        room - the MUC room.
        userjid - the JID of the user attempting to join the room.
        Returns:
        true if the user is allowed to join the room.
      • sendingInvitation

        public abstract MUCEventDelegate.InvitationResult sendingInvitation​(MUCRoom room,
                                                                            org.xmpp.packet.JID inviteeJID,
                                                                            org.xmpp.packet.JID inviterJID,
                                                                            String inviteMessage)
        This event will be triggered when an entity attempts to invite someone to a room. Returns a String indicating whether the invitation should be abandoned, handled by the delegate, or handled by openfire.
        Parameters:
        room - the MUC room.
        inviteeJID - the JID of the user the invitation will be sent to.
        inviterJID - the JID of the user that is sending the invitation
        inviteMessage - the (optional) message that is sent explaining the invitation
        Returns:
        true if the user is allowed to join the room.
      • sendingInvitationRejection

        public abstract MUCEventDelegate.InvitationRejectionResult sendingInvitationRejection​(MUCRoom room,
                                                                                              org.xmpp.packet.JID to,
                                                                                              org.xmpp.packet.JID from,
                                                                                              String reason)
        This event will be triggered when an entity reject invite from someone to a room. Returns a String indicating whether the invitation should be abandoned, handled by the delegate, or handled by openfire.
        Parameters:
        room - the MUC room.
        to - the JID of the user the rejecting of invitation will be sent to.
        from - the JID of the user that is sending the rejecting of invitation
        reason - the (optional) message that is sent explaining the rejection invitation
        Returns:
        true if the user is allowed to join the room.
      • getRoomConfig

        public abstract Map<String,​String> getRoomConfig​(String roomName)
        Returns a map containing room configuration variables and values.
        Parameters:
        roomName - the name of the room the configuration map is associated with.
        Returns:
        a map containing room configuration variables and values, or null if roomName was not valid.
      • destroyingRoom

        public abstract boolean destroyingRoom​(String roomName,
                                               org.xmpp.packet.JID userjid)
        This event will be triggered when an entity attempts to destroy a room. Returns true if the user is allowed to destroy the room.
        Parameters:
        roomName - the name of the MUC room being destroyed.
        userjid - the JID of the user attempting to destroy the room.
        Returns:
        true if the user is allowed to destroy the room.
      • shouldRecreate

        public abstract boolean shouldRecreate​(String roomName,
                                               org.xmpp.packet.JID userjid)
        Returns true if the room that is not present in the server should have existed and needs to be recreated.
        Parameters:
        roomName - name of the room.
        userjid - JID Of the user trying to join/create the room.
        Returns:
        true if the room that is not present in the server should have existed and needs to be recreated.
      • loadConfig

        public boolean loadConfig​(MUCRoom room)
        Loads a delegate provided room configuration for the room specified.
        Parameters:
        room - the room to load the configuration for.
        Returns:
        true if the room configuration was received from the delegate and applied to the room.