Class IQOwnerHandler

java.lang.Object
org.jivesoftware.openfire.muc.spi.IQOwnerHandler

public class IQOwnerHandler extends Object
A handler for the IQ packet with namespace http://jabber.org/protocol/muc#owner. 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.
Author:
Gaston Dombiak
  • Constructor Details

    • IQOwnerHandler

      public IQOwnerHandler(MUCRoom chatroom)
  • Method Details

    • handleIQ

      public void handleIQ(@Nonnull org.xmpp.packet.IQ packet, @Nullable MUCOccupant actorOccupant) throws ForbiddenException, ConflictException, CannotBeInvitedException, NotAcceptableException, NotAllowedException
      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
      Parameters:
      packet - the IQ packet sent by an owner of the room.
      actorOccupant - the occupant that sent the packet, if it was sent by an occupant.
      Throws:
      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
      NotAllowedException
    • parseFirstValueAsBoolean

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