BrokerQueryCommand parseDql(String str)

Source

BrokerQueryCommand parseDql(String str) {
  if (str.startsWith('[')) {
    return parseList(DsJson.decode(str));
  }
  // TODO: implement full dql spec
  // this is just a temp quick parser for basic /data node query
  List<String> commands = str.split('|').map((x) => x.trim()).toList();
  if (commands.length == 2 &&
      commands[0].startsWith('list /data') &&
      commands[1].startsWith('subscribe')) {
    String path = commands[0].substring(5);
    BrokerQueryCommand listcommand = new QueryCommandList(path, this);
    listcommand = _getOrAddCommand(listcommand);
    if (listcommand == null) {
      return null;
    }
    BrokerQueryCommand subcommand = new QueryCommandSubscribe(this);
    subcommand.base = listcommand;
    subcommand = _getOrAddCommand(subcommand);
    return subcommand;
  }
  return null;
}