Class IQOwnerHandler

  • public class IQOwnerHandler
    extends Object
    A handler for the IQ packet with namespace This kind of packets are usually sent by room owners. So this handler provides the necessary functionality to support owner requirements such as: room configuration and room destruction.
    Gaston Dombiak
    • Constructor Detail

      • IQOwnerHandler

        public IQOwnerHandler​(MUCRoom chatroom)
    • Method Detail

      • handleIQ

        public void handleIQ​(org.xmpp.packet.IQ packet,
                             MUCRole role)
                      throws ForbiddenException,
        Handles the IQ packet sent by an owner of the room. Possible actions are:
        • Return the list of owners
        • Return the list of admins
        • Change user's affiliation to owner
        • Change user's affiliation to admin
        • Change user's affiliation to member
        • Change user's affiliation to none
        • Destroy the room
        • Return the room configuration within a dataform
        • Update the room configuration based on the sent dataform
        packet - the IQ packet sent by an owner of the room.
        role - the role of the user that sent the packet.
        ForbiddenException - if the user does not have enough permissions (ie. is not an owner).
        ConflictException - If the room was going to lose all of its owners.
        CannotBeInvitedException - never
        NotAcceptableException - if the room requires a password that was not supplied
      • parseFirstValueAsBoolean

        public static boolean parseFirstValueAsBoolean​(org.xmpp.forms.FormField field,
                                                       boolean defaultValue)
        Use FormField#parseFirstValueAsBoolean(String) provided by Tinder version 1.3.1 or newer.
        Returns the first value of the formfield as a boolean.
        field - A form field (cannot be null)
        defaultValue - Returned if first value is null or empty.
        true if the provided input equals '1' or 'true', false if the input equals '0' or 'false'.
        IllegalArgumentException - when the input cannot be parsed as a boolean.