public static int run(String action, String hostsFile, String servicesFile, String outputFile, String errorFile) {
    LOG.info(String.format("ServiceAdvisor. Received arguments. Action: %s, Hosts File: %s, Services File: %s", action, hostsFile, servicesFile));
    int returnCode = -1;

    try {
      ServiceAdvisorCommandType commandType = ServiceAdvisorCommandType.getEnum(action);

      // TODO, load each Service's Service Advisor at Start Time and call it instead of Python command below.

      ProcessBuilder builder = preparePythonShellCommand(commandType, hostsFile, servicesFile, outputFile, errorFile);
      returnCode = launchProcess(builder);
    } catch (IllegalArgumentException e) {
      List<ServiceAdvisorCommandType> values = EnumUtils.getEnumList(ServiceAdvisorCommandType.class);
      List<String> stringValues = new ArrayList<String>();
      for (ServiceAdvisorCommandType value : values) {
        stringValues.add(value.toString());
      }
      LOG.error("ServiceAdvisor. Illegal Argument. Action must be one of " + StringUtils.join(stringValues.toArray(), ", "));
      return -1;
    }  catch (Exception e) {
      LOG.error("ServiceAdvisor. Failed with " + e.getMessage());
      return -1;
    }
    return returnCode;
  }
Entry point for calling this class through its jar.
@param args
ambari-serviceadvisor/src/main/java/org/apache/ambari/serviceadvisor/ServiceAdvisor.java