Class Event

    • Method Detail

      • withConfiguration

        public static Event withConfiguration​(String node,
                                              DataForm configuration)
        Creates a pub-sub event with a configuration form.
        Parameters:
        node - The node (required).
        configuration - The configuration form (required).
        Returns:
        The pub-sub event.
        See Also:
        Example 152
      • withDeletion

        public static Event withDeletion​(String node)
        Creates a pub-sub event with delete information.
        Parameters:
        node - The node (required).
        Returns:
        The pub-sub event.
        See Also:
        (String, URI), Example 160
      • withDeletion

        public static Event withDeletion​(String node,
                                         URI redirectUri)
        Creates a pub-sub event with delete information.
        Parameters:
        node - The node (required).
        redirectUri - The redirect URI (optional).
        Returns:
        The pub-sub event.
        See Also:
        withDeletion(String), Example 160
      • withItem

        public static Event withItem​(String node,
                                     Object payload,
                                     String id,
                                     Jid publisher)
        Creates a pub-sub event with a single item.
        Parameters:
        node - The node (required).
        payload - The item payload.
        id - The item id (optional).
        publisher - The publisher (optional).
        Returns:
        The pub-sub event.
        See Also:
        Example 2
      • withItems

        public static Event withItems​(String node,
                                      List<Item> items)
        Creates a pub-sub event with items.
        Parameters:
        node - The node (required).
        items - The items.
        Returns:
        The pub-sub event.
        See Also:
        Example 2
      • withPurge

        public static Event withPurge​(String node)
        Creates a pub-sub event with purge information.
        Parameters:
        node - The purged node (required).
        Returns:
        The pub-sub event.
        See Also:
        PubSubFeature.PURGE_NODES,
      • getNode

        public final String getNode()
        Gets the 'node' attribute of the child element.
        Returns:
        The node.
      • isConfiguration

        public final boolean isConfiguration()
        Indicates, whether the event is a configuration change event.
        Returns:
        True, if the configuration has changed.
        See Also:
        getConfigurationForm()
      • isDelete

        public final boolean isDelete()
        Indicates, whether the event is a delete event, i.e. if a node has been deleted.
        Returns:
        True, if a node has been deleted.
        See Also:
        getRedirectUri()
      • isPurge

        public final boolean isPurge()
        Indicates, whether the event is purge event.
        Returns:
        True, if a node has been purged.
      • hasItems

        public final boolean hasItems()
        Indicates, whether the has items.
        Returns:
        True, if it has items.
        See Also:
        getItems()
      • isRetract

        public final boolean isRetract()
        Indicates, whether the event is a retract event.
        Returns:
        True, if items have been retracted.
        See Also:
        getRetractedItems()
      • getSubscription

        public final Subscription getSubscription()
        Gets the subscription approval.
        Returns:
        The subscription approval or null, if the event did not include a subscription.
      • getItems

        public final List<Item> getItems()
        Gets the items of the event.
        Returns:
        The items of the event or an empty list, if the event did not include any items.
      • getRetractedItems

        public final List<String> getRetractedItems()
        Gets the retracted (deleted) items.
        Returns:
        The retracted items.
      • getConfigurationForm

        public final DataForm getConfigurationForm()
        Gets the configuration form.
        Returns:
        The configuration form or null, if the configuration form isn't included.
        See Also:
        isConfiguration()
      • getRedirectUri

        public final URI getRedirectUri()
        Gets the redirect URI in case the event is a delete event.
        Returns:
        The redirect URI or null, if a redirect URI isn't included.
        See Also:
        isDelete()