code: @Override
    public void process(WatchedEvent event) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Received ZooKeeper Event, " + "type=" + event.getType() + ", " + "state="
            + event.getState() + ", " + "path=" + event.getPath());
      }
  
      switch (event.getType()) {
      case None: {
        processConnection(event);
        break;
      }
      case NodeCreated: {
        processNodeCreated(event.getPath());
        break;
      }
      case NodeDeleted: {
        processNodeDeleted(event.getPath());
        break;
      }
      case NodeDataChanged: {
        processDataChanged(event.getPath());
        break;
      }
      case NodeChildrenChanged: {
        processNodeChildrenChanged(event.getPath());
        break;
      }
      default:
        break;
      }
    }
docs: Override this mothod to deal with events for leader election.
  
  @param event the ZooKeeper event