class StageUtils {

  public static void useAmbariJdkInCommandParams(Map<String, String> commandParams, Configuration configuration) {
    if (StringUtils.isNotEmpty(configuration.getJavaHome()) && !configuration.getJavaHome().equals(configuration.getStackJavaHome())) {
      commandParams.put(AMBARI_JAVA_HOME, configuration.getJavaHome());
      commandParams.put(AMBARI_JAVA_VERSION, String.valueOf(configuration.getJavaVersion()));
      if (StringUtils.isNotEmpty(configuration.getJDKName())) { // if not custom jdk
        commandParams.put(AMBARI_JDK_NAME, configuration.getJDKName());
      }
      if (StringUtils.isNotEmpty(configuration.getJCEName())) { // if not custom jdk
        commandParams.put(AMBARI_JCE_NAME, configuration.getJCEName());
      }
    }
  }

  @Inject public  StageUtils(StageFactory stageFactory);

}