public AgentCommandType getCommandType() {
    if (executionCommand != null) {
      return executionCommand.getCommandType();
    }

    if (null == jsonExecutionCommand) {
      throw new RuntimeException(
          "Invalid ExecutionCommandWrapper, both object and string" + " representations are null");
    }

    return gson.fromJson(jsonExecutionCommand,
        ExecutionCommand.class).getCommandType();
  }
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