@Override
    public void execute() throws KeeperException, InterruptedException {
        final ClientSignature signature =
                (ClientSignature) zookeeper.getObject(ZookeeperStrings.clientSignaturePath(clientId), false, null);
        if (event == null || event.getType() == EventType.NodeCreated) {
            master.joinClient(signature);
            if (event != null) {
                // We have to register the watcher again.
                if (zookeeper.exists(ZookeeperStrings.clientHeartPath(clientId), this) == null) {
                    master.clientLeft(signature);
                    return;
                }
            }
            final ClientRequestWatcher requestWatcher = new ClientRequestWatcher(master, clientId);
            List<String> children = zookeeper.getChildren(ZookeeperStrings.clientRequestPath(clientId), requestWatcher);
            if (!children.isEmpty()) {
                requestWatcher.execute();
            }
        } else if (event.getType() == EventType.NodeDeleted) {
            master.clientLeft(signature);
        }
    }