class ZookeeperCommandService extends AbstractCommandService {

    @Autowired
    private ZkClientWrapper clientWrapper;
    private ZkClient zkClient;

    @PostConstruct
    void init() {
        zkClient = clientWrapper.getZkClient();
    }

    /**
     * 获取所有指令
     *
     * @return
     */
    @Override
    public List<JSONObject> getAllCommands() {
        List<JSONObject> commands = new ArrayList<JSONObject>();
        List<String> groups = getChildren(MotanConstants.ZOOKEEPER_REGISTRY_NAMESPACE);
        for (String group : groups) {
            JSONObject node = new JSONObject();
            String command = getCommands(group);
            if (command != null) {
                node.put("group", group);
                node.put("command", RpcCommandUtil.stringToCommand(command));
                commands.add(node);
            }
        }
        return commands;
    }

    private List<String> getChildren(String path) {<FILL_FUNCTION_BODY>}

    /**
     * 获取指定group的指令列表
     *
     * @param groupName
     * @return
     */
    @Override
    public String getCommands(String groupName) {
        return zkClient.readData(getCommandPath(groupName), true);
    }

    private String getCommandPath(String groupName) {
        return MotanConstants.ZOOKEEPER_REGISTRY_NAMESPACE + MotanConstants.PATH_SEPARATOR + groupName + MotanConstants.ZOOKEEPER_REGISTRY_COMMAND;
    }

    /**
     * 更新指定group的指令列表
     *
     * @param command
     * @param group
     * @return
     */
    @Override
    public boolean setCommand(String group, RpcCommand command) {
        String path = getCommandPath(group);
        if (!zkClient.exists(path)) {
            zkClient.createPersistent(path, true);
        }
        try {
            zkClient.writeData(path, RpcCommandUtil.commandToString(command));
        } catch (Exception e) {
            return false;
        }
        return true;
    }
}

        List<String> children = new ArrayList<String>();
        if (zkClient.exists(path)) {
            children = zkClient.getChildren(path);
        }
        return children;
    
<methods>public non-sealed void <init>() ,public boolean addCommand(java.lang.String, com.weibo.api.motan.registry.support.command.RpcCommand.ClientCommand) ,public com.weibo.api.motan.registry.support.command.RpcCommand buildCommand(java.lang.String, com.weibo.api.motan.registry.support.command.RpcCommand.ClientCommand) ,public boolean deleteCommand(java.lang.String, int) ,public List<com.weibo.model.OperationRecord> getAllRecord() ,public int getRpcCommandMaxIndex(com.weibo.api.motan.registry.support.command.RpcCommand) ,public List<com.alibaba.fastjson.JSONObject> previewCommand(java.lang.String, com.weibo.api.motan.registry.support.command.RpcCommand.ClientCommand, java.lang.String) ,public boolean updateCommand(java.lang.String, com.weibo.api.motan.registry.support.command.RpcCommand.ClientCommand) <variables>private com.weibo.dao.OperationRecordMapper recordMapper