@@ -0,0 +1,1627 @@
+package org.gbif.crawler.pipelines;%0A%0Aimport org.apache.curator.framework.CuratorFramework;%0Aimport org.apache.curator.framework.CuratorFrameworkFactory;%0Aimport org.apache.curator.framework.recipes.cache.PathChildrenCache;%0Aimport org.apache.curator.framework.recipes.cache.PathChildrenCacheListener;%0Aimport org.apache.curator.retry.ExponentialBackoffRetry;%0Aimport org.apache.curator.utils.ZKPaths;%0A%0Apublic class PathCacheZk %7B%0A%0A  public static void main(String%5B%5D args) throws Exception %7B%0A    CuratorFramework client = CuratorFrameworkFactory.builder()%0A      .connectString(%22c3zk1.gbif-dev.org,c3zk2.gbif-dev.org,c3zk3.gbif-dev.org%22)%0A      .namespace(%22dev_crawler%22)%0A      .retryPolicy(new ExponentialBackoffRetry(100, 10))%0A      .build();%0A    client.start();%0A%0A    PathChildrenCache cache = new PathChildrenCache(client, %22/pipelines%22, true);%0A    cache.start(PathChildrenCache.StartMode.BUILD_INITIAL_CACHE);%0A%0A    PathChildrenCacheListener listener = (client1, event) -%3E %7B%0A%0A      switch ( event.getType() )%0A      %7B%0A        case CHILD_ADDED:%0A        %7B%0A          System.out.println(%22Node added: %22 + ZKPaths.getNodeFromPath(event.getData().getPath()));%0A          break;%0A        %7D%0A%0A        case CHILD_UPDATED:%0A        %7B%0A          System.out.println(%22Node changed: %22 + ZKPaths.getNodeFromPath(event.getData().getPath()));%0A          break;%0A        %7D%0A%0A        case CHILD_REMOVED:%0A        %7B%0A          System.out.println(%22Node removed: %22 + ZKPaths.getNodeFromPath(event.getData().getPath()));%0A          break;%0A        %7D%0A      %7D%0A%0A    %7D;%0A    cache.getListenable().addListener(listener);%0A%0A    boolean close = false;%0A    while (!close) %7B%7D%0A%0A  %7D%0A%7D%0A

test ZK path cache