Class BlockingManager

  • All Implemented Interfaces:
    ExtensionProtocol, IQHandler, DiscoverableInfo

    public final class BlockingManager
    extends AbstractIQHandler
    implements ExtensionProtocol, DiscoverableInfo
    This manager allows to block communications with contacts.

    Usage

    Listen for pushes from the server which informs you about changes in the block list:

    
     blockingManager.addBlockingListener(e -> {
         // e.getBlockedContacts();
         // modify the block list accordingly.
     });
     

    After authenticating with a server and before any blocking operation you should retrieve the block list:

    
     blockingManager.getBlockedContacts();
     

    This will also inform the server that you are interested in updates to the list and will trigger pushes to the client.

    This class is thread-safe.