public String getJson() {
    if (jsonExecutionCommand != null) {
      return jsonExecutionCommand;
    } else if (executionCommand != null) {
      jsonExecutionCommand = gson.toJson(executionCommand);
      return jsonExecutionCommand;
    } else {
      throw new RuntimeException(
          "Invalid ExecutionCommandWrapper, both object and string"
              + " representations are null");
    }
  }
Gets the type of command by deserializing the JSON and invoking
{@link ExecutionCommand#getCommandType()}.

@return
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java