buildCommand method

  1. @override
String buildCommand()
override

Build the @ command to be sent to remote secondary for execution.

Implementation

@override
String buildCommand() {
  var command = 'notify:';

  if (operation != null) {
    command += '${getOperationName(operation)}:';
  }
  if (messageType != null) {
    command += 'messageType:${getMessageType(messageType)}:';
  }
  if (priority != null) {
    command += 'priority:${getPriority(priority)}:';
  }
  if (strategy != null) {
    command += 'strategy:${getStrategy(strategy)}:';
  }
  if (latestN != null) {
    command += 'latestN:$latestN:';
  }
  command += 'notifier:$notifier:';
  if (ttl != null) {
    command += 'ttl:$ttl:';
  }
  if (ttb != null) {
    command += 'ttb:$ttb:';
  }
  if (ttr != null) {
    ccd ??= false;
    command += 'ttr:$ttr:ccd:$ccd:';
  }
  if (sharedWith != null) {
    command += '${VerbUtil.formatAtSign(sharedWith)}:';
  }

  if (isPublic) {
    command += 'public:';
  }
  command += atKey!;

  if (sharedBy != null) {
    command += '${VerbUtil.formatAtSign(sharedBy)}';
  }
  if (value != null) {
    command += ':$value';
  }

  return '$command\n';
}