public static int runOpenDSSetup(Map map){
  String[] setupCmd={"--cli","--adminConnectorPort","4444","--baseDN",Constants.DEFAULT_ROOT_SUFFIX,"--rootUserDN","cn=Directory Manager","--ldapPort","50389","--skipPortCheck","--rootUserPassword","xxxxxxx","--jmxPort","1689","--no-prompt","--doNotStart","--hostname","hostname","--noPropertiesFile","--backendType","je"};
  setupCmd[2]=(String)map.get(SetupConstants.CONFIG_VAR_DIRECTORY_ADMIN_SERVER_PORT);
  setupCmd[4]=(String)map.get(SetupConstants.CONFIG_VAR_ROOT_SUFFIX);
  setupCmd[6]=(String)map.get(SetupConstants.CONFIG_VAR_DS_MGR_DN);
  setupCmd[8]=(String)map.get(SetupConstants.CONFIG_VAR_DIRECTORY_SERVER_PORT);
  setupCmd[13]=(String)map.get(SetupConstants.CONFIG_VAR_DIRECTORY_JMX_SERVER_PORT);
  setupCmd[17]=getOpenDJHostName(map);
  setupCmd[20]=SystemProperties.get(SetupConstants.DJ_BACKEND_TYPE_CONFIG_NAME,SetupConstants.DJ_BACKEND_TYPE_DEFAULT);
  Object[] params={concat(setupCmd)};
  SetupProgress.reportStart("emb.setupcommand",params);
  setupCmd[11]=(String)map.get(SetupConstants.CONFIG_VAR_DS_MGR_PWD);
  int ret=InstallDS.mainCLI(setupCmd,SetupProgress.getOutputStream(),SetupProgress.getOutputStream(),TempLogFile.newTempLogFile("opendj-setup-"));
  if (ret == 0) {
    SetupProgress.reportEnd("emb.success",null);
  }
 else {
    SetupProgress.reportEnd("emb.failed",null);
  }
  return ret;
}

public static int runOpenDSSetup ( Map map ) { String [ ] setupCmd = { "--cli" , "--adminConnectorPort" , "4444" , "--baseDN" , Constants . DEFAULT_ROOT_SUFFIX , "--rootUserDN" , "cn=Directory Manager" , "--ldapPort" , "50389" , "--skipPortCheck" , "--rootUserPassword" , "xxxxxxx" , "--jmxPort" , "1689" , "--no-prompt" , "--doNotStart" , "--hostname" , "hostname" , "--noPropertiesFile" , "--backendType" , "je" } ; setupCmd [ 2 ] = ( String ) map . get ( SetupConstants . CONFIG_VAR_DIRECTORY_ADMIN_SERVER_PORT ) ; setupCmd [ 4 ] = ( String ) map . get ( SetupConstants . CONFIG_VAR_ROOT_SUFFIX ) ; setupCmd [ 6 ] = ( String ) map . get ( SetupConstants . CONFIG_VAR_DS_MGR_DN ) ; setupCmd [ 8 ] = ( String ) map . get ( SetupConstants . CONFIG_VAR_DIRECTORY_SERVER_PORT ) ; setupCmd [ 13 ] = ( String ) map . get ( SetupConstants . CONFIG_VAR_DIRECTORY_JMX_SERVER_PORT ) ; setupCmd [ 17 ] = getOpenDJHostName ( map ) ; setupCmd [ 20 ] = SystemProperties . get ( SetupConstants . DJ_BACKEND_TYPE_CONFIG_NAME , SetupConstants . DJ_BACKEND_TYPE_DEFAULT ) ; Object [ ] params = { concat ( setupCmd ) } ; SetupProgress . reportStart ( "emb.setupcommand" , params ) ; setupCmd [ 11 ] = ( String ) map . get ( SetupConstants . CONFIG_VAR_DS_MGR_PWD ) ; int ret = InstallDS . mainCLI ( setupCmd , SetupProgress . getOutputStream ( ) , SetupProgress . getOutputStream ( ) , TempLogFile . newTempLogFile ( "opendj-setup-" ) ) ; if ( ret == 0 ) { SetupProgress . reportEnd ( "emb.success" , null ) ; } else { SetupProgress . reportEnd ( "emb.failed" , null ) ; } return ret ; }
runs the opendj setup command like this : $ . / setup - - cli - - adminconnectorport 4444 - - basedn dc = openam , dc = forgerock , dc = org - - rootuserdn " cn = directory manager " - - donotstart - - ldapport 50389 - - skipportcheck - - rootuserpassword xxxxxxx - - jmxport 1689 - - no - prompt
