Class ContactExchangeManager

    • Method Detail

      • getTrustedEntities

        public final Collection<Jid> getTrustedEntities()
        Gets a unmodifiable collection of trusted entities for which roster item exchange suggestions are approved automatically (no listeners will be called).
        Returns:
        The trusted entities.
        See Also:
        8.1 Trusted Entities, addTrustedEntity(Jid)
      • addTrustedEntity

        public final boolean addTrustedEntity​(Jid jid)
        Adds a trusted entity for which roster item exchange suggestions are approved automatically (no listeners will be called).
        Parameters:
        jid - The bare JID.
        Returns:
        True, if the entity was added.
        See Also:
        8.1 Trusted Entities, removeTrustedEntity(Jid)
      • removeTrustedEntity

        public final boolean removeTrustedEntity​(Jid jid)
        Removes a trusted entity for which roster item exchange suggestions are approved automatically.
        Parameters:
        jid - The bare JID.
        Returns:
        True, if the entity was removed.
        See Also:
        addTrustedEntity(Jid)
      • suggestContactAddition

        public AsyncResult<Void> suggestContactAddition​(Jid jid,
                                                        Contact... contacts)
        Suggests the addition of one or more contacts to another user.
        Parameters:
        jid - The recipient.
        contacts - The contacts.
        Returns:
        The async result.
      • approve

        public ContactExchange.Item.Action approve​(ContactExchange.Item item)
        Approves a roster exchange item by modifying the roster accordingly.

        If the item is to be added and does not yet exist, it will be added to your roster and you are subscribed to its presence. If it already exists in your roster but in a different group than suggested, it will additionally be added to the suggested group.

        If the item is to be deleted, it will be deleted from your roster, if the suggested group(s) matches the same group(s) in your roster. Otherwise it will be edited, so that it no longer belongs to the suggested groups.

        If the item is to be modified, it will be modified accordingly, if it exists.

        Parameters:
        item - The roster exchange item.
        Returns:
        The action, which was actually performed. This may vary from the specified action, e.g. if you add a contact that already exists, only its groups are updated. If no action was performed, e.g. if you want to delete a contact, that does not exist, null is returned.
      • getNamespace

        public final String getNamespace()
        Description copied from interface: ExtensionProtocol
        The protocol's main namespace. This is used to uniquely identify the extension protocol.
        Specified by:
        getNamespace in interface ExtensionProtocol
        Returns:
        The main namespace.
      • isEnabled

        public final boolean isEnabled()
        Description copied from interface: ExtensionProtocol
        Indicates whether this protocol is enabled.
        Specified by:
        isEnabled in interface ExtensionProtocol
        Returns:
        true, if enabled; false if disabled.