public final class BlockingManager extends Manager
This manager allows to block communications with contacts.
Enabling or disabling this manager has no effect, because blocking is done on server side.
This class is thread-safe.Modifier and Type | Method and Description |
---|---|
void |
addBlockingListener(java.util.function.Consumer<BlockingEvent> blockingListener)
Adds a blocking listener, which allows to listen for block and unblock pushes.
|
AsyncResult<IQ> |
blockContact(Jid... jids)
Blocks communications with contacts.
|
AsyncResult<java.util.Set<Jid>> |
getBlockedContacts()
Retrieves the blocked contacts.
|
void |
removeBlockingListener(java.util.function.Consumer<BlockingEvent> blockingListener)
Removes a previously added blocking listener.
|
AsyncResult<IQ> |
unblockContact(Jid... jids)
Unblocks communications with specific contacts or with all contacts.
|
isEnabled, setEnabled
public final void addBlockingListener(java.util.function.Consumer<BlockingEvent> blockingListener)
Adds a blocking listener, which allows to listen for block and unblock pushes.
blockingListener
- The listener.removeBlockingListener(Consumer)
public final void removeBlockingListener(java.util.function.Consumer<BlockingEvent> blockingListener)
Removes a previously added blocking listener.
blockingListener
- The listener.addBlockingListener(Consumer)
public final AsyncResult<java.util.Set<Jid>> getBlockedContacts()
Retrieves the blocked contacts.
public final AsyncResult<IQ> blockContact(Jid... jids)
Blocks communications with contacts.
jids
- The contacts.public final AsyncResult<IQ> unblockContact(Jid... jids)
Unblocks communications with specific contacts or with all contacts. If you want to unblock all communications, pass no arguments to this method.
jids
- The contacts.Copyright © 2014–2019 XMPP.rocks. All rights reserved.