Package com.avaya.clientservices.presence

## Interface PresenceAccessControlList

-     public interface PresenceAccessControlList

  The class encapsulates presence access control list related features available to the user.

  Access Control List (ACL) tracks local user's decisions regarding allowing or denying permission to other users who want to track the local user's presence. Remote users are added to the list when local user allows or blocks incoming presence watcher requests in the case of configured `PresenceACLPolicy.CONFIRM` policy. Local user is not able to delete presence watcher from access control list, but it is possible to change rules for remote watchers.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addPresenceAccessControlListener​(PresenceAccessControlListener listener)` | Adds the presence access control information listener.
    `void` | `addPresenceWatcherRequestListener​(PresenceWatcherRequestListener listener)` | Adds the presence watcher request listener.
    `void` | `allowPresenceWatcher​(PresenceWatcher watcher, PresenceCompletionHandler completionHandler)` | Used to allow either a pending or a previously blocked presence tracking request.
    `void` | `blockPresenceWatcher​(PresenceWatcher watcher, PresenceCompletionHandler completionHandler)` | Used to block either a pending or a previously allow presence tracking request.
    `java.util.Set<PresenceWatcher>` | `getAllowedPresenceWatchers()` | List of users allowed to track local user's presence.
    `java.util.Set<PresenceWatcher>` | `getBlockedPresenceWatchers()` | List of users allowed to track local user's presence.
    `PresenceACLPolicy` | `getPresenceACLPolicy()` | Current `PresenceACLPolicy`.
    `void` | `removePresenceAccessControlListener​(PresenceAccessControlListener listener)` | Removes the presence access control information listener.
    `void` | `removePresenceWatcherRequestListener​(PresenceWatcherRequestListener listener)` | Removes the presence watcher request listener.

- - ### Method Detail

    - #### addPresenceWatcherRequestListener

          void addPresenceWatcherRequestListener​(PresenceWatcherRequestListener listener)

      Adds the presence watcher request listener. This listener is used to receive presence tracking requests from other users in the system when `PresenceACLPolicy` is configured to `PresenceACLPolicy.CONFIRM` and remote user requests to track local user's presence.
      Parameters:
        `listener` - Listener instance to be added.

    - #### removePresenceWatcherRequestListener

          void removePresenceWatcherRequestListener​(PresenceWatcherRequestListener listener)

      Removes the presence watcher request listener. This listener is used to receive presence tracking requests from other users in the system when `PresenceACLPolicy` is configured to `PresenceACLPolicy.CONFIRM` and remote user requests to track local user's presence.
      Parameters:
        `listener` - Listener instance to be removed.

    - #### addPresenceAccessControlListener

          void addPresenceAccessControlListener​(PresenceAccessControlListener listener)

      Adds the presence access control information listener. This listener is used to receive the initial state and subsequent updates for the default `PresenceACLPolicy` and the list of users either allowed to track local user's presence, or blocked from tracking local user's presence.
      Parameters:
        `listener` - Listener instance to be added.

    - #### removePresenceAccessControlListener

          void removePresenceAccessControlListener​(PresenceAccessControlListener listener)

      Removes the presence access control information listener. This listener is used to receive the initial state and subsequent updates for the default `PresenceACLPolicy` and the list of users either allowed to track local user's presence, or blocked from tracking local user's presence.
      Parameters:
        `listener` - Listener instance to be removed.

    - #### getAllowedPresenceWatchers

          java.util.Set<PresenceWatcher> getAllowedPresenceWatchers()

      List of users allowed to track local user's presence. null is returned until `PresenceAccessControlListener` listener is assigned. In order to receive a list of allowed presence watchers add `PresenceAccessControlListener` first and wait for events.
      Returns:
        Collection of currently allowed presence watchers.

    - #### getBlockedPresenceWatchers

          java.util.Set<PresenceWatcher> getBlockedPresenceWatchers()

      List of users allowed to track local user's presence. null is returned until `PresenceAccessControlListener` listener is assigned. In order to receive a list of allowed presence watchers add `PresenceAccessControlListener` first and wait for events.
      Returns:
        Collection of currently blocked presence watchers.

    - #### getPresenceACLPolicy

          PresenceACLPolicy getPresenceACLPolicy()

      Current `PresenceACLPolicy`. `PresenceACLPolicy.UNDEFINED` is returned until the information is retrieved from the network. Will return `PresenceACLPolicy.BLOCK` in the case if `PresenceACLPolicy.CONFIRM` is configured with current Presence Server implementation.
      Returns:
        Current presence access control list policy.

    - #### allowPresenceWatcher

          void allowPresenceWatcher​(PresenceWatcher watcher,
                                    PresenceCompletionHandler completionHandler)

      Used to allow either a pending or a previously blocked presence tracking request.
      Parameters:
        `watcher` - Remote user who will be allowed to track local user's presence.
        `completionHandler` - A completion handler that receives the result of the operation.

    - #### blockPresenceWatcher

          void blockPresenceWatcher​(PresenceWatcher watcher,
                                    PresenceCompletionHandler completionHandler)

      Used to block either a pending or a previously allow presence tracking request.
      Parameters:
        `watcher` - Remote user who will not be allowed to track local user's presence.
        `completionHandler` - A completion handler that receives the result of the operation.