@Override
    public void process(WatchedEvent event) {
        if (logger.isDebugEnabled()) {
            logger.debug(prefix("Received ZooKeeper Event, " + "type=" + event.getType() + ", " + "state="
                    + event.getState() + ", " + "path=" + event.getPath()));
        }

        switch (event.getType()) {

            // If event type is NONE, this is a connection status change
            case None: {
                connectionEvent(event);
                break;
            }

            // Otherwise pass along to the listeners

            case NodeCreated: {
                for (ZooKeeperListener listener : listeners) {
                    listener.nodeCreated(event.getPath());
                }
                break;
            }

            case NodeDeleted: {
                for (ZooKeeperListener listener : listeners) {
                    listener.nodeDeleted(event.getPath());
                }
                break;
            }

            case NodeDataChanged: {
                for (ZooKeeperListener listener : listeners) {
                    listener.nodeDataChanged(event.getPath());
                }
                break;
            }

            case NodeChildrenChanged: {
                for (ZooKeeperListener listener : listeners) {
                    listener.nodeChildrenChanged(event.getPath());
                }
                break;
            }
        }
    }
Method called from ZooKeeper for events and connection status.
<p/>
Valid events are passed along to listeners. Connection status changes are dealt with
locally.
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/common/zookeeper/ZooKeeperWatcher.java