WatchesReport (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

org.apache.zookeeper.server.watch

## Class WatchesReport

- java.lang.Object
- - org.apache.zookeeper.server.watch.WatchesReport

-     public class WatchesReport
      extends Object

  A watch report, essentially a mapping of session ID to paths that the session has set a watch on. This class is immutable.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<String>` | `getPaths(long sessionId)` Gets the paths that the given session has set watches on.
    `boolean` | `hasPaths(long sessionId)` Checks if the given session has watches set.
    `Map<Long,Set<String>>` | `toMap()` Converts this report to a map.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### hasPaths

          public boolean hasPaths(long sessionId)

      Checks if the given session has watches set.
      Parameters:
        `sessionId` - session ID
      Returns:
        true if session has paths with watches set

    - #### getPaths

          public Set<String> getPaths(long sessionId)

      Gets the paths that the given session has set watches on. The returned set is immutable.
      Parameters:
        `sessionId` - session ID
      Returns:
        paths that have watches set by the session, or null if none

    - #### toMap

          public Map<Long,Set<String>> toMap()

      Converts this report to a map. The returned map is mutable, and changes to it do not reflect back into this report.
      Returns:
        map representation of report

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.