Class IQEvent

  • All Implemented Interfaces:
    Serializable

    public final class IQEvent
    extends EventObject
    An IQ event is fired whenever an IQ stanza is received or sent.

    This class is immutable.

    See Also:
    Serialized Form
    • Constructor Detail

      • IQEvent

        public IQEvent​(Object source,
                       IQ iq,
                       boolean inbound)
        Constructs an IQ event.
        Parameters:
        source - The object on which the event initially occurred.
        iq - The IQ stanza.
        inbound - True, if the stanza is inbound.
        Throws:
        IllegalArgumentException - if source is null.
    • Method Detail

      • getIQ

        public final IQ getIQ()
        Gets the IQ stanza.
        Returns:
        The IQ stanza.
      • isInbound

        public final boolean isInbound()
        Indicates, whether the stanza has been received (inbound) or is about to being sent (outbound).
        Returns:
        True, if the stanza is inbound; false if it is outbound.
      • consume

        public final void consume()
        Marks this event as consumed. For outbound stanzas, consuming this event cancels sending the stanza.
        See Also:
        isConsumed()
      • isConsumed

        public final boolean isConsumed()
        Indicates, whether this event has been consumed.
        Returns:
        True, if this event has been consumed.
        See Also:
        consume()