public final class ContactExchangeManager extends Manager
Manages contact exchange between entities.
Modifier and Type | Method and Description |
---|---|
void |
addContactExchangeListener(java.util.function.Consumer<ContactExchangeEvent> contactExchangeListener)
Adds a contact exchange listener.
|
ContactExchange.Item.Action |
approve(ContactExchange.Item item)
Approves a roster exchange item by modifying the roster accordingly.
|
java.util.Collection<Jid> |
getTrustedEntities()
Gets a collection of trusted entities for which roster item exchange suggestions are approved automatically (no listeners will be called).
|
void |
removeContactExchangeListener(java.util.function.Consumer<ContactExchangeEvent> contactExchangeListener)
Removes a previously added contact exchange listener.
|
AsyncResult<java.lang.Void> |
suggestContactAddition(Jid jid,
Contact... contacts)
Suggests the addition of one or more contacts to another user.
|
isEnabled, setEnabled
public final java.util.Collection<Jid> getTrustedEntities()
Gets a collection of trusted entities for which roster item exchange suggestions are approved automatically (no listeners will be called). The JIDs contained in this collection must be bare JIDs.
public AsyncResult<java.lang.Void> suggestContactAddition(Jid jid, Contact... contacts)
Suggests the addition of one or more contacts to another user.
jid
- The recipient.contacts
- The contacts.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.
item
- The roster exchange item.public void addContactExchangeListener(java.util.function.Consumer<ContactExchangeEvent> contactExchangeListener)
Adds a contact exchange listener.
contactExchangeListener
- The listener.removeContactExchangeListener(Consumer)
public void removeContactExchangeListener(java.util.function.Consumer<ContactExchangeEvent> contactExchangeListener)
Removes a previously added contact exchange listener.
contactExchangeListener
- The listener.addContactExchangeListener(Consumer)
Copyright © 2014–2019 XMPP.rocks. All rights reserved.