@Override
    public void deleteNode(ZVNode node) {
        String path = node.getPath();
        System.out.println("Delete requested on node " + path);
        PathUtils.validatePath(path);
        try {
            // Checks if the node has children
            List<String> childNodes = zk.getChildren(path, false);
            if (childNodes != null && childNodes.size() > 0) {
                // if the node has children, delete them recursively
                for (Iterator<String> iterator = childNodes.iterator(); iterator
                        .hasNext();) {
                    String nodeName = (String) iterator.next();
                    String childPath = path + (path.endsWith("/") ? "" : "/")
                            + nodeName;
                    deleteNode(getNode(childPath));
                }
            }
            // finally, delete the node itself
            Stat stat = zk.exists(path, false);
            System.out.println("Deleting node " + path + "(stat =  " + stat);
            zk.delete(path, -1);
            Stat stat2 = zk.exists(path, false);
            System.out.println("Deleting node " + path + "(stat = " + stat2);
        } catch (KeeperException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }