Interface TreeCacheSelector

All Known Implementing Classes:
DefaultTreeCacheSelector

public interface TreeCacheSelector

Controls which nodes a TreeCache processes. When iterating over the children of a parent node, a given node's children are queried only if traverseChildren(String) returns true. When caching the list of nodes for a parent node, a given node is stored only if acceptChild(String) returns true.

E.g. Given:

 root
     n1-a
     n1-b
         n2-a
         n2-b
             n3-a
     n1-c
     n1-d
 
You could have a TreeCache only work with the nodes: n1-a, n1-b, n2-a, n2-b, n1-d by returning false from traverseChildren() for "/root/n1-b/n2-b" and returning false from acceptChild("/root/n1-c").

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    acceptChild(String fullPath)
    Return true if this node should be returned from the cache
    boolean
    Return true if children of this path should be cached.
  • Method Details

    • traverseChildren

      boolean traverseChildren(String fullPath)
      Return true if children of this path should be cached. i.e. if false is returned, this node is not queried to determine if it has children or not
      Parameters:
      fullPath - full path of the ZNode
      Returns:
      true/false
    • acceptChild

      boolean acceptChild(String fullPath)
      Return true if this node should be returned from the cache
      Parameters:
      fullPath - full path of the ZNode
      Returns:
      true/false