These changes are separating the current delivery into
an "Install Layout" (the binaries) and an "Instance Layout" (the user data).
| | |
| | | <copy todir="${pdir}/lib"> |
| | | <fileset file="${lib.dir}/*.exe" /> |
| | | </copy> |
| | | |
| | | <copy todir="${pdir}"> |
| | | <fileset file="${resource.dir}/instance.loc" /> |
| | | </copy> |
| | | |
| | | <antcall target="example-plugin" /> |
| | | |
| | |
| | | |
| | | setlocal |
| | | for %%i in (%~sf0) do set DIR_HOME=%%~dPsi.. |
| | | set INSTANCE_ROOT=%DIR_HOME% |
| | | set INSTALL_ROOT=%DIR_HOME% |
| | | |
| | | set INSTANCE_DIR= |
| | | for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do ( |
| | | set INSTANCE_DIR=%%a |
| | | ) |
| | | set CUR_DIR=%~dp0 |
| | | cd %INSTALL_ROOT% |
| | | cd %INSTANCE_DIR% |
| | | set INSTANCE_ROOT=%CD% |
| | | cd %CUR_DIR% |
| | | |
| | | if "%OPENDS_INVOKE_CLASS%" == "" goto noInvokeClass |
| | | goto launchCommand |
| | |
| | | |
| | | :launchCommand |
| | | set SCRIPT_UTIL_CMD=set-full-environment |
| | | call "%INSTANCE_ROOT%\lib\_script-util.bat" |
| | | call "%INSTALL_ROOT%\lib\_script-util.bat" |
| | | if NOT %errorlevel% == 0 exit /B %errorlevel% |
| | | |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDS_INVOKE_CLASS% %* |
| | |
| | | |
| | | |
| | | # Capture the current working directory so that we can change to it later. |
| | | # Then capture the location of this script and the Directory Server instance |
| | | # Then capture the location of this script and the Directory Server install |
| | | # root so that we can use them to create appropriate paths. |
| | | WORKING_DIR=`pwd` |
| | | |
| | |
| | | SCRIPT_DIR=`pwd` |
| | | |
| | | cd .. |
| | | INSTANCE_ROOT=`pwd` |
| | | export INSTANCE_ROOT |
| | | INSTALL_ROOT=`pwd` |
| | | export INSTALL_ROOT |
| | | |
| | | if cat ${INSTALL_ROOT}/instance.loc | grep '^/' > /dev/null |
| | | then |
| | | INSTANCE_ROOT=`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | else |
| | | INSTANCE_ROOT=${INSTALL_ROOT}/`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | fi |
| | | |
| | | cd "${WORKING_DIR}" |
| | | |
| | |
| | | # Set environment variables |
| | | SCRIPT_UTIL_CMD=set-full-environment |
| | | export SCRIPT_UTIL_CMD |
| | | . "${INSTANCE_ROOT}/lib/_script-util.sh" |
| | | . "${INSTALL_ROOT}/lib/_script-util.sh" |
| | | RETURN_CODE=$? |
| | | if test ${RETURN_CODE} -ne 0 |
| | | then |
| | |
| | | |
| | | setlocal |
| | | for %%i in (%~sf0) do set DIR_HOME=%%~dPsi.. |
| | | set INSTANCE_ROOT=%DIR_HOME% |
| | | set INSTALL_ROOT=%DIR_HOME% |
| | | |
| | | set INSTANCE_DIR= |
| | | for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do ( |
| | | set INSTANCE_DIR=%%a |
| | | ) |
| | | set CUR_DIR=%~dp0 |
| | | cd %INSTALL_ROOT% |
| | | cd %INSTANCE_DIR% |
| | | set INSTANCE_ROOT=%CD% |
| | | cd %CUR_DIR% |
| | | |
| | | if "%OPENDS_INVOKE_CLASS%" == "" goto noInvokeClass |
| | | |
| | |
| | | set ORIGINAL_JAVA_BIN=%OPENDS_JAVA_BIN% |
| | | |
| | | set SCRIPT_UTIL_CMD=set-full-environment |
| | | call "%INSTANCE_ROOT%\lib\_script-util.bat" |
| | | call "%INSTALL_ROOT%\lib\_script-util.bat" |
| | | if NOT %errorlevel% == 0 exit /B %errorlevel% |
| | | |
| | | set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=%OLD_SCRIPT_NAME%" |
| | | |
| | | rem Check whether is local or remote |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDS_INVOKE_CLASS% --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" --testIfOffline %* |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDS_INVOKE_CLASS% --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" --testIfOffline %* |
| | | if %errorlevel% == 51 goto launchoffline |
| | | if %errorlevel% == 52 goto launchonline |
| | | exit /B %errorlevel% |
| | |
| | | |
| | | :launchonline |
| | | |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDS_INVOKE_CLASS% --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" %* |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDS_INVOKE_CLASS% --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %* |
| | | |
| | | goto end |
| | | |
| | |
| | | set OPENDS_JAVA_BIN=%ORIGINAL_JAVA_BIN% |
| | | |
| | | set SCRIPT_UTIL_CMD=set-full-environment |
| | | call "%INSTANCE_ROOT%\lib\_script-util.bat" |
| | | call "%INSTALL_ROOT%\lib\_script-util.bat" |
| | | if NOT %errorlevel% == 0 exit /B %errorlevel% |
| | | set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=%OLD_SCRIPT_NAME%" |
| | | |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDS_INVOKE_CLASS% --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" %* |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDS_INVOKE_CLASS% --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %* |
| | | |
| | | goto end |
| | | |
| | |
| | | |
| | | |
| | | # Capture the current working directory so that we can change to it later. |
| | | # Then capture the location of this script and the Directory Server instance |
| | | # root so that we can use them to create appropriate paths. |
| | | # Then capture the location of this script and the Directory Server install |
| | | # and instance root so that we can use them to create appropriate paths. |
| | | WORKING_DIR=`pwd` |
| | | |
| | | cd "`dirname "${0}"`" |
| | | SCRIPT_DIR=`pwd` |
| | | |
| | | cd .. |
| | | INSTANCE_ROOT=`pwd` |
| | | export INSTANCE_ROOT |
| | | INSTALL_ROOT=`pwd` |
| | | export INSTALL_ROOT |
| | | |
| | | if cat ${INSTALL_ROOT}/instance.loc | grep '^/' > /dev/null |
| | | then |
| | | INSTANCE_ROOT=`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | else |
| | | INSTANCE_ROOT=${INSTALL_ROOT}/`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | fi |
| | | |
| | | |
| | | cd "${WORKING_DIR}" |
| | | |
| | |
| | | # Set environment variables |
| | | SCRIPT_UTIL_CMD=set-full-environment |
| | | export SCRIPT_UTIL_CMD |
| | | . "${INSTANCE_ROOT}/lib/_script-util.sh" |
| | | . "${INSTALL_ROOT}/lib/_script-util.sh" |
| | | RETURN_CODE=$? |
| | | if test ${RETURN_CODE} -ne 0 |
| | | then |
| | |
| | | # Set the environment to use the offline properties |
| | | SCRIPT_NAME=${OLD_SCRIPT_NAME}.offline |
| | | export SCRIPT_NAME |
| | | . "${INSTANCE_ROOT}/lib/_script-util.sh" |
| | | . "${INSTALL_ROOT}/lib/_script-util.sh" |
| | | RETURN_CODE=$? |
| | | if test ${RETURN_CODE} -ne 0 |
| | | then |
| | |
| | | |
| | | @echo off |
| | | rem CDDL HEADER START |
| | | rem |
| | |
| | | set SET_ENVIRONMENT_VARS_DONE=false |
| | | set SET_CLASSPATH_DONE=false |
| | | |
| | | if "%INSTANCE_ROOT%" == "" goto setInstanceRoot |
| | | if "%INSTALL_ROOT%" == "" goto setInstanceRoot |
| | | |
| | | :scriptBegin |
| | | if "%SCRIPT_UTIL_CMD%" == "set-full-environment-and-test-java" goto setFullEnvironmentAndTestJava |
| | |
| | | :setInstanceRoot |
| | | setlocal |
| | | for %%i in (%~sf0) do set DIR_HOME=%%~dPsi.. |
| | | set INSTANCE_ROOT=%DIR_HOME% |
| | | set INSTALL_ROOT=%DIR_HOME% |
| | | set INSTANCE_DIR= |
| | | for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do ( |
| | | set INSTANCE_DIR=%%a |
| | | ) |
| | | set CUR_DIR=%~dp0 |
| | | cd %INSTALL_ROOT% |
| | | cd %INSTANCE_DIR% |
| | | set INSTANCE_ROOT=%CD% |
| | | cd %CUR_DIR% |
| | | goto scriptBegin |
| | | |
| | | |
| | | :setClassPath |
| | | if "%SET_CLASSPATH_DONE%" == "true" goto end |
| | | FOR %%x in ("%DIR_HOME%\lib\*.jar") DO call "%DIR_HOME%\lib\setcp.bat" %%x |
| | | set CLASSPATH=%DIR_HOME%\classes;%CLASSPATH% |
| | | FOR %%x in ("%INSTALL_ROOT%\lib\*.jar") DO call "%INSTALL_ROOT%\lib\setcp.bat" %%x |
| | | if "%INSTALL_ROOT%" == "%INSTANCE_ROOT%"goto setClassPathDone |
| | | FOR %%x in ("%INSTANCE_ROOT%\lib\*.jar") DO call "%INSTANCE_ROOT%\lib\setcp.bat" %%x |
| | | set CLASSPATH=%INSTANCE_ROOT%\classes;%CLASSPATH% |
| | | :setClassPathDone |
| | | set SET_CLASSPATH_DONE=true |
| | | goto scriptBegin |
| | | |
| | |
| | | |
| | | :setJavaHomeAndArgs |
| | | if "%SET_JAVA_HOME_AND_ARGS_DONE%" == "true" goto end |
| | | if not exist "%DIR_HOME%\lib\set-java-home.bat" goto checkEnvJavaArgs |
| | | call "%DIR_HOME%\lib\set-java-home.bat" |
| | | if not exist "%INSTANCE_ROOT%\lib\set-java-home.bat" goto checkEnvJavaArgs |
| | | call "%INSTANCE_ROOT%\lib\set-java-home.bat" |
| | | if "%OPENDS_JAVA_BIN%" == "" goto checkEnvJavaArgs |
| | | :endJavaHomeAndArgs |
| | | set SET_JAVA_HOME_AND_ARGS_DONE=true |
| | |
| | | echo 3. Edit the properties file specifying the java binary and the java arguments |
| | | echo for each command line. The java properties file is located in: |
| | | echo %INSTANCE_ROOT%\config\java.properties. |
| | | echo 4. Run the command-line %INSTANCE_ROOT%\bin\dsjavaproperties |
| | | echo 4. Run the command-line %INSTALL_ROOT%\bat\dsjavaproperties.bat |
| | | pause |
| | | exit /B 1 |
| | | |
| | |
| | | echo 3. Edit the properties file specifying the java binary and the java arguments |
| | | echo for each command line. The java properties file is located in: |
| | | echo %INSTANCE_ROOT%\config\java.properties. |
| | | echo 4. Run the command-line %INSTANCE_ROOT%\bin\dsjavaproperties |
| | | echo 4. Run the command-line %INSTALL_ROOT%\bat\dsjavaproperties.bat |
| | | pause |
| | | exit /B 1 |
| | | |
| | |
| | | echo 3. Edit the properties file specifying the java binary and the java arguments |
| | | echo for each command line. The java properties file is located in: |
| | | echo %INSTANCE_ROOT%\config\java.properties. |
| | | echo 4. Run the command-line %INSTANCE_ROOT%\bin\dsjavaproperties |
| | | echo 4. Run the command-line %INSTALL_ROOT%\bat\dsjavaproperties.bat |
| | | pause |
| | | exit /B 1 |
| | | |
| | |
| | | # Configure the appropriate CLASSPATH. |
| | | set_classpath() { |
| | | CLASSPATH=${INSTANCE_ROOT}/classes |
| | | for JAR in "${INSTANCE_ROOT}"/lib/*.jar |
| | | for JAR in ${INSTALL_ROOT}/lib/*.jar |
| | | do |
| | | CLASSPATH=${CLASSPATH}:${JAR} |
| | | done |
| | | if [ "${INSTANCE_ROOT}" != "${INSTANCE_ROOT}" ] |
| | | then |
| | | for JAR in ${INSTANCE_ROOT}/lib/*.jar |
| | | do |
| | | CLASSPATH=${CLASSPATH}:${JAR} |
| | | done |
| | | fi |
| | | export CLASSPATH |
| | | } |
| | | |
| | | if test "${INSTANCE_ROOT}" = "" |
| | | if test "${INSTALL_ROOT}" = "" |
| | | then |
| | | # Capture the current working directory so that we can change to it later. |
| | | # Then capture the location of this script and the Directory Server instance |
| | |
| | | |
| | | cd "`dirname "${0}"`" |
| | | cd .. |
| | | INSTANCE_ROOT=`pwd` |
| | | INSTALL_ROOT=`pwd` |
| | | if cat ${INSTALL_ROOT}/instance.loc | grep '^/' > /dev/null |
| | | then |
| | | INSTANCE_ROOT=`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | else |
| | | INSTANCE_ROOT=${INSTALL_ROOT}/`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | fi |
| | | cd "${WORKING_DIR}" |
| | | fi |
| | | |
| | |
| | | |
| | | setlocal |
| | | for %%i in (%~sf0) do set DIR_HOME=%%~dPsi.. |
| | | set INSTANCE_ROOT=%DIR_HOME% |
| | | set INSTALL_ROOT=%DIR_HOME% |
| | | |
| | | set INSTANCE_DIR= |
| | | for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do ( |
| | | set INSTANCE_DIR=%%a |
| | | ) |
| | | set CUR_DIR=%~dp0 |
| | | cd %INSTALL_ROOT% |
| | | cd %INSTANCE_DIR% |
| | | set INSTANCE_ROOT=%CD% |
| | | cd %CUR_DIR% |
| | | |
| | | if "%OPENDS_INVOKE_CLASS%" == "" goto noInvokeClass |
| | | goto launchCommand |
| | |
| | | |
| | | :launchCommand |
| | | set SCRIPT_UTIL_CMD=set-full-environment |
| | | call "%INSTANCE_ROOT%\lib\_script-util.bat" |
| | | call "%INSTALL_ROOT%\lib\_script-util.bat" |
| | | if NOT %errorlevel% == 0 exit /B %errorlevel% |
| | | |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDS_INVOKE_CLASS% --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" %* |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDS_INVOKE_CLASS% --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %* |
| | | |
| | | :end |
| | | |
| | |
| | | SCRIPT_DIR=`pwd` |
| | | |
| | | cd .. |
| | | INSTANCE_ROOT=`pwd` |
| | | export INSTANCE_ROOT |
| | | INSTALL_ROOT=`pwd` |
| | | export INSTALL_ROOT |
| | | |
| | | if cat ${INSTALL_ROOT}/instance.loc | grep '^/' > /dev/null |
| | | then |
| | | INSTANCE_ROOT=`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | else |
| | | INSTANCE_ROOT=${INSTALL_ROOT}/`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | fi |
| | | |
| | | cd "${WORKING_DIR}" |
| | | |
| | | # Set environment variables |
| | | SCRIPT_UTIL_CMD=set-full-environment |
| | | export SCRIPT_UTIL_CMD |
| | | . "${INSTANCE_ROOT}/lib/_script-util.sh" |
| | | . "${INSTALL_ROOT}/lib/_script-util.sh" |
| | | RETURN_CODE=$? |
| | | if test ${RETURN_CODE} -ne 0 |
| | | then |
| | |
| | | SCRIPT_DIR=`pwd` |
| | | |
| | | cd .. |
| | | INSTANCE_ROOT=`pwd` |
| | | export INSTANCE_ROOT |
| | | INSTALL_ROOT=`pwd` |
| | | export INSTALL_ROOT |
| | | |
| | | if cat ${INSTALL_ROOT}/instance.loc | grep '^/' > /dev/null |
| | | then |
| | | INSTANCE_ROOT=`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | else |
| | | INSTANCE_ROOT=${INSTALL_ROOT}/`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | fi |
| | | |
| | | cd "${WORKING_DIR}" |
| | | |
| | |
| | | # Set environment variables |
| | | SCRIPT_UTIL_CMD=set-full-environment-and-test-java |
| | | export SCRIPT_UTIL_CMD |
| | | . "${INSTANCE_ROOT}/lib/_script-util.sh" |
| | | . "${INSTALL_ROOT}/lib/_script-util.sh" |
| | | RETURN_CODE=$? |
| | | if test ${RETURN_CODE} -ne 0 |
| | | then |
| | |
| | | |
| | | setlocal |
| | | for %%i in (%~sf0) do set DIR_HOME=%%~dPsi.. |
| | | set INSTALL_ROOT=%DIR_HOME% |
| | | |
| | | |
| | | set INSTANCE_ROOT=%DIR_HOME% |
| | | set INSTANCE_DIR= |
| | | for /f "delims=" %%a in (%DIR_HOME%\instance.loc) do ( |
| | | set INSTANCE_DIR=%%a |
| | | ) |
| | | set CUR_DIR=%~dp0 |
| | | cd %INSTALL_ROOT% |
| | | cd %INSTANCE_DIR% |
| | | set INSTANCE_ROOT=%CD% |
| | | cd %CUR_DIR% |
| | | |
| | | set LOG="%INSTANCE_ROOT%\logs\native-windows.out" |
| | | set SCRIPT=start-ds.bat |
| | |
| | | |
| | | rem Set environment variables |
| | | set SCRIPT_UTIL_CMD=set-full-environment-and-test-java |
| | | call "%INSTANCE_ROOT%\lib\_script-util.bat" |
| | | call "%INSTALL_ROOT%\lib\_script-util.bat" |
| | | |
| | | set ERROR_CODE=%errorlevel% |
| | | if NOT %ERROR_CODE% == 0 goto exitErrorCode |
| | |
| | | |
| | | echo %SCRIPT%: PATH=%PATH% >> %LOG% |
| | | |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" --checkStartability %* |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" --checkStartability %* |
| | | |
| | | if %errorlevel% == 98 goto serverAlreadyStarted |
| | | if %errorlevel% == 99 goto runDetach |
| | |
| | | |
| | | :runNoDetach |
| | | echo %SCRIPT%: Run no detach >> %LOG% |
| | | if not exist "%DIR_HOME%\logs\server.out" echo. > "%DIR_HOME%\logs\server.out" |
| | | if not exist "%DIR_HOME%\logs\server.starting" echo. > "%DIR_HOME%\logs\server.starting" |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" %* |
| | | if not exist "%INSTANCE_ROOT%\logs\server.out" echo. > "%INSTANCE_ROOT%\logs\server.out" |
| | | if not exist "%INSTANCE_ROOT%\logs\server.starting" echo. > "%INSTANCE_ROOT%\logs\server.starting" |
| | | if exist "%INSTANCE_ROOT%\lib\set-java-args.bat %SCRIPT%" DO call "%INSTANCE_ROOT%\lib\set-java-args.bat" |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_SERVER_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %* |
| | | set ERROR_CODE=%errorlevel% |
| | | goto exitErrorCode |
| | | |
| | | :runNoDetachQuiet |
| | | echo %SCRIPT%: Run no detach >> %LOG% |
| | | if not exist "%DIR_HOME%\logs\server.out" echo. > "%DIR_HOME%\logs\server.out" |
| | | if not exist "%DIR_HOME%\logs\server.starting" echo. > "%DIR_HOME%\logs\server.starting" |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" %* >> %LOG% |
| | | if not exist "%INSTANCE_ROOT%\logs\server.out" echo. > "%INSTANCE_ROOT%\logs\server.out" |
| | | if not exist "%INSTANCE_ROOT%\logs\server.starting" echo. > "%INSTANCE_ROOT%\logs\server.starting" |
| | | if exist "%INSTANCE_ROOT%\lib\set-java-args.bat %SCRIPT%" DO call "%INSTANCE_ROOT%\lib\set-java-args.bat" |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_SERVER_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %* >> %LOG% |
| | | set ERROR_CODE=%errorlevel% |
| | | goto exitErrorCode |
| | | |
| | | :runDetach |
| | | echo %SCRIPT%: Run detach >> %LOG% |
| | | if not exist "%DIR_HOME%\logs\server.out" echo. > "%DIR_HOME%\logs\server.out" |
| | | if not exist "%DIR_HOME%\logs\server.starting" echo. > "%DIR_HOME%\logs\server.starting" |
| | | "%DIR_HOME%\lib\winlauncher.exe" start "%DIR_HOME%" "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" %* |
| | | echo %SCRIPT%: Waiting for "%DIR_HOME%\logs\server.out" to be deleted >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%DIR_HOME%\logs\server.starting" --logFile "%DIR_HOME%\logs\server.out" |
| | | if not exist "%INSTANCE_ROOT%\logs\server.out" echo. > "%INSTANCE_ROOT%\logs\server.out" |
| | | if not exist "%INSTANCE_ROOT%\logs\server.starting" echo. > "%INSTANCE_ROOT%\logs\server.starting" |
| | | if exist "%INSTANCE_ROOT%\lib\set-java-args.bat" DO call "%INSTANCE_ROOT%\lib\set-java-args.bat" |
| | | "%INSTALL_ROOT%\lib\winlauncher.exe" start "%INSTANCE_ROOT%" "%OPENDS_JAVA_BIN%" %OPENDS_SERVER_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %* |
| | | echo %SCRIPT%: Waiting for "%INSTANCE_ROOT%\logs\server.out" to be deleted >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" |
| | | goto checkStarted |
| | | |
| | | :runDetachQuiet |
| | | echo %SCRIPT%: Run detach >> %LOG% |
| | | if not exist "%DIR_HOME%\logs\server.out" echo. > "%DIR_HOME%\logs\server.out" |
| | | if not exist "%DIR_HOME%\logs\server.starting" echo. > "%DIR_HOME%\logs\server.starting" |
| | | "%DIR_HOME%\lib\winlauncher.exe" start "%DIR_HOME%" "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" %* |
| | | echo %SCRIPT%: Waiting for "%DIR_HOME%\logs\server.out" to be deleted >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%DIR_HOME%\logs\server.starting" --logFile "%DIR_HOME%\logs\server.out" >> %LOG% |
| | | if not exist "%INSTANCE_ROOT%\logs\server.out" echo. > "%INSTANCE_ROOT%\logs\server.out" |
| | | if not exist "%INSTANCE_ROOT%\logs\server.starting" echo. > "%INSTANCE_ROOT%\logs\server.starting" |
| | | if exist "%INSTANCE_ROOT%\lib\set-java-args.bat" DO call "%INSTANCE_ROOT%\lib\set-java-args.bat" |
| | | "%INSTALL_ROOT%\lib\winlauncher.exe" start "%INSTANCE_ROOT%" "%OPENDS_JAVA_BIN%" %OPENDS_SERVER_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %* |
| | | echo %SCRIPT%: Waiting for "%INSTANCE_ROOT%\logs\server.out" to be deleted >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" >> %LOG% |
| | | goto checkStarted |
| | | |
| | | :runDetachCalledByWinService |
| | | rem We write the output of the start command to the winservice.out file. |
| | | echo %SCRIPT%: Run detach called by windows service >> %LOG% |
| | | if not exist "%DIR_HOME%\logs\server.out" echo. > "%DIR_HOME%\logs\server.out" |
| | | if not exist "%DIR_HOME%\logs\server.starting" echo. > "%DIR_HOME%\logs\server.starting" |
| | | echo. > "%DIR_HOME%\logs\server.startingservice" |
| | | echo. > "%DIR_HOME%\logs\winservice.out" |
| | | if exist "%DIR_HOME%\lib\set-java-args.bat" DO call "%DIR_HOME%\lib\set-java-args.bat" |
| | | "%DIR_HOME%\lib\winlauncher.exe" start "%DIR_HOME%" "%OPENDS_JAVA_BIN%" -Xrs %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" %* |
| | | echo %SCRIPT%: Waiting for "%DIR_HOME%\logs\server.out" to be deleted >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%DIR_HOME%\logs\server.starting" --logFile "%DIR_HOME%\logs\server.out" --outputFile "%DIR_HOME%\logs\winservice.out" |
| | | erase "%DIR_HOME%\logs\server.startingservice" |
| | | if not exist "%INSTANCE_ROOT%\logs\server.out" echo. > "%INSTANCE_ROOT%\logs\server.out" |
| | | if not exist "%INSTANCE_ROOT%\logs\server.starting" echo. > "%INSTANCE_ROOT%\logs\server.starting" |
| | | echo. > "%INSTANCE_ROOT%\logs\server.startingservice" |
| | | echo. > "%INSTANCE_ROOT%\logs\winservice.out" |
| | | if exist "%INSTANCE_ROOT%\lib\set-java-args.bat" DO call "%INSTANCE_ROOT%\lib\set-java-args.bat" |
| | | "%INSTALL_ROOT%\lib\winlauncher.exe" start "%INSTANCE_ROOT%" "%OPENDS_JAVA_BIN%" -Xrs %OPENDS_SERVER_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %* |
| | | echo %SCRIPT%: Waiting for "%INSTANCE_ROOT%\logs\server.out" to be deleted >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" --outputFile "%INSTANCE_ROOT%\logs\winservice.out" |
| | | erase "%INSTANCE_ROOT%\logs\server.startingservice" |
| | | goto checkStarted |
| | | |
| | | :runAsService |
| | | echo %SCRIPT%: Run as service >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.StartWindowsService |
| | | echo %SCRIPT%: Waiting for "%DIR_HOME%\logs\server.startingservice" to be deleted >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%DIR_HOME%\logs\server.startingservice" |
| | | echo %SCRIPT%: Waiting for "%INSTANCE_ROOT%\logs\server.startingservice" to be deleted >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.startingservice" |
| | | rem Type the contents the winwervice.out file and delete it. |
| | | if exist "%DIR_HOME%\logs\winservice.out" type "%DIR_HOME%\logs\winservice.out" |
| | | if exist "%DIR_HOME%\logs\winservice.out" erase "%DIR_HOME%\logs\winservice.out" |
| | | if exist "%INSTANCE_ROOT%\logs\winservice.out" type "%INSTANCE_ROOT%\logs\winservice.out" |
| | | if exist "%INSTANCE_ROOT%\logs\winservice.out" erase "%INSTANCE_ROOT%\logs\winservice.out" |
| | | goto end |
| | | |
| | | :checkStarted |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" --checkStartability > NUL 2>&1 |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" --checkStartability > NUL 2>&1 |
| | | if %errorlevel% == 98 goto serverStarted |
| | | goto serverNotStarted |
| | | |
| | |
| | | |
| | | setlocal |
| | | for %%i in (%~sf0) do set DIR_HOME=%%~dPsi.. |
| | | set INSTALL_ROOT=%DIR_HOME% |
| | | |
| | | set INSTANCE_ROOT=%DIR_HOME% |
| | | set INSTANCE_DIR= |
| | | for /f "delims=" %%a in (%DIR_HOME%\instance.loc) do ( |
| | | set INSTANCE_DIR=%%a |
| | | ) |
| | | set CUR_DIR=%~dp0 |
| | | cd %INSTALL_ROOT% |
| | | cd %INSTANCE_DIR% |
| | | set INSTANCE_ROOT=%CD% |
| | | cd %CUR_DIR% |
| | | |
| | | |
| | | set SCRIPT_NAME=status-panel |
| | | |
| | | rem Set environment variables |
| | | set SCRIPT_UTIL_CMD=set-full-environment |
| | | call "%INSTANCE_ROOT%\lib\_script-util.bat" |
| | | call "%INSTALL_ROOT%\lib\_script-util.bat" |
| | | if NOT %errorlevel% == 0 exit /B %errorlevel% |
| | | |
| | | if "%~1" == "" goto callLaunch |
| | | goto callJava |
| | | |
| | | :callLaunch |
| | | "%DIR_HOME%\lib\winlauncher.exe" launch "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.guitools.statuspanel.StatusPanelLauncher |
| | | if exist "%INSTALL_ROOT%\lib\set-java-args.bat" DO call "%INSTALL_ROOT%\lib\set-java-args.bat" |
| | | "%INSTALL_ROOT%\lib\winlauncher.exe" launch "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.guitools.statuspanel.StatusPanelLauncher |
| | | goto end |
| | | |
| | | :callJava |
| | | if exist "%INSTALL_ROOT%\lib\set-java-args.bat" DO call "%INSTALL_ROOT%\lib\set-java-args.bat" |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.guitools.statuspanel.StatusPanelLauncher %* |
| | | |
| | | rem return part |
| | |
| | | SCRIPT_DIR=`pwd` |
| | | |
| | | cd .. |
| | | INSTANCE_ROOT=`pwd` |
| | | export INSTANCE_ROOT |
| | | INSTALL_ROOT=`pwd` |
| | | export INSTALL_ROOT |
| | | |
| | | if cat ${INSTALL_ROOT}/instance.loc | grep '^/' > /dev/null |
| | | then |
| | | INSTANCE_ROOT=`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | else |
| | | INSTANCE_ROOT=${INSTALL_ROOT}/`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | fi |
| | | |
| | | cd "${WORKING_DIR}" |
| | | |
| | |
| | | # Set environment variables |
| | | SCRIPT_UTIL_CMD=set-full-environment-and-test-java |
| | | export SCRIPT_UTIL_CMD |
| | | . "${INSTANCE_ROOT}/lib/_script-util.sh" |
| | | . "${INSTALL_ROOT}/lib/_script-util.sh" |
| | | RETURN_CODE=$? |
| | | if test ${RETURN_CODE} -ne 0 |
| | | then |
| | |
| | | OPENDS_JAVA_BIN=${ORIGINAL_JAVA_BIN} |
| | | if test ${QUIET_MODE} -eq 0 |
| | | then |
| | | "${INSTANCE_ROOT}/bin/start-ds" --quiet |
| | | "${INSTALL_ROOT}/bin/start-ds" --quiet |
| | | EXIT_CODE=${?} |
| | | exit ${EXIT_CODE} |
| | | else |
| | | "${INSTANCE_ROOT}/bin/start-ds" |
| | | "${INSTALL_ROOT}/bin/start-ds" |
| | | EXIT_CODE=${?} |
| | | exit ${EXIT_CODE} |
| | | fi |
| | |
| | | set ORIGINAL_JAVA_HOME=%OPENDS_JAVA_HOME% |
| | | set ORIGINAL_JAVA_BIN=%OPENDS_JAVA_BIN% |
| | | |
| | | set INSTANCE_ROOT=%DIR_HOME% |
| | | set INSTALL_ROOT=%DIR_HOME% |
| | | |
| | | set INSTANCE_DIR= |
| | | for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do ( |
| | | set INSTANCE_DIR=%%a |
| | | ) |
| | | set CUR_DIR=%~dp0 |
| | | cd %INSTALL_ROOT% |
| | | cd %INSTANCE_DIR% |
| | | set INSTANCE_ROOT=%CD% |
| | | cd %CUR_DIR% |
| | | |
| | | set LOG="%INSTANCE_ROOT%\logs\native-windows.out" |
| | | set SCRIPT=stop-ds.bat |
| | |
| | | |
| | | rem Set environment variables |
| | | set SCRIPT_UTIL_CMD=set-full-environment-and-test-java |
| | | call "%INSTANCE_ROOT%\lib\_script-util.bat" |
| | | call "%INSTALL_ROOT%\lib\_script-util.bat" |
| | | if NOT %errorlevel% == 0 exit /B %errorlevel% |
| | | |
| | | echo %SCRIPT%: CLASSPATH=%CLASSPATH% >> %LOG% |
| | |
| | | |
| | | :serverAlreadyStopped |
| | | echo %SCRIPT%: server already stopped >> %LOG% |
| | | if exist "%DIR_HOME%\logs\server.pid" erase "%DIR_HOME%\logs\server.pid" |
| | | if exist "%INSTANCE_ROOT%\logs\server.pid" erase "%INSTANCE_ROOT%\logs\server.pid" |
| | | goto end |
| | | |
| | | :startUsingSystemCall |
| | |
| | | set OPENDS_JAVA_ARGS=%ORIGINAL_JAVA_ARGS% |
| | | set OPENDS_JAVA_HOME=%ORIGINAL_JAVA_HOME% |
| | | set OPENDS_JAVA_BIN=%ORIGINAL_JAVA_BIN% |
| | | "%DIR_HOME%\bat\start-ds.bat" |
| | | "%INSTALL_ROOT%\bat\start-ds.bat" |
| | | goto end |
| | | |
| | | :stopUsingSystemCall |
| | | echo %SCRIPT%: stop using system call >> %LOG% |
| | | "%DIR_HOME%\lib\winlauncher.exe" stop "%DIR_HOME%" |
| | | "%INSTALL_ROOT%\lib\winlauncher.exe" stop "%INSTANCE_ROOT%" |
| | | goto end |
| | | |
| | | :restartUsingSystemCall |
| | | echo %SCRIPT%: restart using system call >> %LOG% |
| | | "%DIR_HOME%\lib\winlauncher.exe" stop "%DIR_HOME%" |
| | | "%INSTALL_ROOT%\lib\winlauncher.exe" stop "%INSTANCE_ROOT%" |
| | | if not %errorlevel% == 0 goto end |
| | | goto startUsingSystemCall |
| | | |
| | | :stopUsingProtocol |
| | | echo %SCRIPT%: stop using protocol >> %LOG% |
| | | call "%DIR_HOME%\lib\_client-script.bat" %* |
| | | call "%INSTALL_ROOT%\lib\_client-script.bat" %* |
| | | goto end |
| | | |
| | | :stopAsWindowsService |
| | |
| | | if not %errorlevel% == 0 goto end |
| | | echo %SCRIPT%: restart as windows service, starting >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.StartWindowsService |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%DIR_HOME%\logs\server.startingservice" |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.startingservice" |
| | | rem Type the contents the winwervice.out file and delete it. |
| | | if exist "%DIR_HOME%\logs\winservice.out" type "%DIR_HOME%\logs\winservice.out" |
| | | if exist "%DIR_HOME%\logs\winservice.out" erase "%DIR_HOME%\logs\winservice.out" |
| | | if exist "%INSTANCE_ROOT%\logs\winservice.out" type "%INSTANCE_ROOT%\logs\winservice.out" |
| | | if exist "%INSTANCE_ROOT%\logs\winservice.out" erase "%INSTANCE_ROOT%\logs\winservice.out" |
| | | goto end |
| | | |
| | | :end |
| | |
| | | cd "`dirname "${0}"`" |
| | | SCRIPT_DIR=`pwd` |
| | | |
| | | INSTANCE_ROOT=${SCRIPT_DIR} |
| | | export INSTANCE_ROOT |
| | | INSTALL_ROOT=${SCRIPT_DIR} |
| | | export INSTALL_ROOT |
| | | |
| | | if cat ${INSTALL_ROOT}/instance.loc | grep '^/' > /dev/null |
| | | then |
| | | INSTANCE_ROOT=`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | else |
| | | INSTANCE_ROOT=${INSTALL_ROOT}/`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | fi |
| | | |
| | | SCRIPT_NAME=setup |
| | | export SCRIPT_NAME |
| | |
| | | # Set environment variables |
| | | SCRIPT_UTIL_CMD=set-full-environment-and-test-java |
| | | export SCRIPT_UTIL_CMD |
| | | . "${INSTANCE_ROOT}/lib/_script-util.sh" |
| | | . "${INSTALL_ROOT}/lib/_script-util.sh" |
| | | RETURN_CODE=$? |
| | | if test ${RETURN_CODE} -ne 0 |
| | | then |
| | |
| | | |
| | | for %%i in (%~sf0) do set DIR_HOME=%%~dPsi. |
| | | |
| | | set INSTANCE_ROOT=%DIR_HOME% |
| | | set INSTALL_ROOT=%DIR_HOME% |
| | | set INSTANCE_DIR= |
| | | for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do ( |
| | | set INSTANCE_DIR=%%a |
| | | ) |
| | | set CUR_DIR=%~dp0 |
| | | cd %INSTALL_ROOT% |
| | | cd %INSTANCE_DIR% |
| | | set INSTANCE_ROOT=%CD% |
| | | cd %CUR_DIR% |
| | | |
| | | set SCRIPT_NAME=setup |
| | | |
| | | rem Set environment variables and test java |
| | | set SCRIPT_UTIL_CMD=set-full-environment-and-test-java |
| | | call "%INSTANCE_ROOT%\lib\_script-util.bat" |
| | | call "%INSTALL_ROOT%\lib\_script-util.bat" |
| | | if NOT %errorlevel% == 0 exit /B %errorlevel% |
| | | |
| | | if "%~1" == "" goto callLaunch |
| | |
| | | goto end |
| | | |
| | | :callLaunch |
| | | "%DIR_HOME%\lib\winlauncher.exe" launch "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.quicksetup.installer.SetupLauncher |
| | | "%INSTALL_ROOT%\lib\winlauncher.exe" launch "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.quicksetup.installer.SetupLauncher |
| | | goto end |
| | | |
| | | :callJava |
| | |
| | | SCRIPT_NAME=uninstall |
| | | export SCRIPT_NAME |
| | | |
| | | INSTANCE_ROOT=${SCRIPT_DIR} |
| | | export INSTANCE_ROOT |
| | | INSTALL_ROOT=${SCRIPT_DIR} |
| | | export INSTALL_ROOT |
| | | |
| | | if cat ${INSTALL_ROOT}/instance.loc | grep '^/' > /dev/null |
| | | then |
| | | INSTANCE_ROOT=`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | else |
| | | INSTANCE_ROOT=${INSTALL_ROOT}/`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | fi |
| | | |
| | | cd "${WORKING_DIR}" |
| | | |
| | | # Set environment variables |
| | | SCRIPT_UTIL_CMD=set-full-environment-and-test-java |
| | | export SCRIPT_UTIL_CMD |
| | | . "${INSTANCE_ROOT}/lib/_script-util.sh" |
| | | . "${INSTALL_ROOT}/lib/_script-util.sh" |
| | | RETURN_CODE=$? |
| | | if test ${RETURN_CODE} -ne 0 |
| | | then |
| | |
| | | setlocal |
| | | for %%i in (%~sf0) do set DIR_HOME=%%~dPsi. |
| | | |
| | | set INSTANCE_ROOT=%DIR_HOME% |
| | | set INSTALL_ROOT=%DIR_HOME% |
| | | set INSTANCE_DIR= |
| | | for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do ( |
| | | set INSTANCE_DIR=%%a |
| | | ) |
| | | set CUR_DIR=%~dp0 |
| | | cd %INSTALL_ROOT% |
| | | cd %INSTANCE_DIR% |
| | | set INSTANCE_ROOT=%CD% |
| | | cd %CUR_DIR% |
| | | |
| | | set SCRIPT_NAME=uninstall |
| | | |
| | | rem Set environment variables |
| | | set SCRIPT_UTIL_CMD=set-full-environment-and-test-java |
| | | call "%INSTANCE_ROOT%\lib\_script-util.bat" |
| | | call "%INSTALL_ROOT%\lib\_script-util.bat" |
| | | if NOT %errorlevel% == 0 exit /B %errorlevel% |
| | | |
| | | if "%~1" == "" goto callLaunch |
| | | goto callJava |
| | | |
| | | :callLaunch |
| | | "%DIR_HOME%\lib\winlauncher.exe" launch "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.guitools.uninstaller.UninstallLauncher |
| | | "%INSTALL_ROOT%\lib\winlauncher.exe" launch "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.guitools.uninstaller.UninstallLauncher |
| | | goto end |
| | | |
| | | :callJava |
| | |
| | | cd "`dirname "${0}"`" |
| | | SCRIPT_DIR=`pwd` |
| | | |
| | | INSTANCE_ROOT=${SCRIPT_DIR} |
| | | export INSTANCE_ROOT |
| | | INSTALL_ROOT=${SCRIPT_DIR} |
| | | export INSTALL_ROOT |
| | | |
| | | if cat ${INSTALL_ROOT}/instance.loc | grep '^/' > /dev/null |
| | | then |
| | | INSTANCE_ROOT=`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | else |
| | | INSTANCE_ROOT=${INSTALL_ROOT}/`cat ${INSTALL_ROOT}/instance.loc` |
| | | export INSTANCE_ROOT |
| | | fi |
| | | |
| | | SCRIPT_NAME=upgrade |
| | | export SCRIPT_NAME |
| | |
| | | # Set java home |
| | | SCRIPT_UTIL_CMD=set-java-home-and-args |
| | | export SCRIPT_UTIL_CMD |
| | | . "${INSTANCE_ROOT}/lib/_script-util.sh" |
| | | . "${INSTALL_ROOT}/lib/_script-util.sh" |
| | | RETURN_CODE=$? |
| | | if test ${RETURN_CODE} -ne 0 |
| | | then |
| | |
| | | # Set environment variables |
| | | SCRIPT_UTIL_CMD=set-environment-vars |
| | | export SCRIPT_UTIL_CMD |
| | | . "${INSTANCE_ROOT}/lib/_script-util.sh" |
| | | . "${INSTALL_ROOT}/lib/_script-util.sh" |
| | | RETURN_CODE=$? |
| | | if test ${RETURN_CODE} -ne 0 |
| | | then |
| | |
| | | CLASSPATH=${CLASSPATH}:${JAR} |
| | | done |
| | | CLASSPATH=${CLASSPATH}:${INSTANCE_ROOT}/classes |
| | | for JAR in ${INSTANCE_ROOT}/lib/*.jar |
| | | for JAR in ${INSTALL_ROOT}/lib/*.jar |
| | | do |
| | | CLASSPATH=${CLASSPATH}:${JAR} |
| | | done |
| | |
| | | # Test the java installation |
| | | SCRIPT_UTIL_CMD=test-java |
| | | export SCRIPT_UTIL_CMD |
| | | . "${INSTANCE_ROOT}/lib/_script-util.sh" |
| | | . "${INSTALL_ROOT}/lib/_script-util.sh" |
| | | RETURN_CODE=$? |
| | | if test ${RETURN_CODE} -ne 0 |
| | | then |
| | |
| | | # BuildExtractor uses the existing install's |
| | | # jars |
| | | CLASSPATH=${INSTANCE_ROOT}/classes |
| | | for JAR in ${INSTANCE_ROOT}/lib/*.jar |
| | | for JAR in ${INSTALL_ROOT}/lib/*.jar |
| | | do |
| | | CLASSPATH=${CLASSPATH}:${JAR} |
| | | done |
| | |
| | | CLASSPATH=${JAR}:${CLASSPATH} |
| | | done |
| | | # Launch the upgrade process. |
| | | "${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} org.opends.quicksetup.upgrader.UpgradeLauncher "${@}" |
| | | "${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} -DINSTALL_ROOT=${INSTALL_ROOT} org.opends.quicksetup.upgrader.UpgradeLauncher "${@}" |
| | | elif test ${RETURN_CODE} -eq 98 |
| | | then |
| | | # Copy jars to a temporary place from which to run the reverter |
| | | # in order to avoid potential file lock issues. |
| | | mkdir -p ${INSTANCE_ROOT}/tmp/revert |
| | | cp -R ${INSTANCE_ROOT}/lib ${INSTANCE_ROOT}/tmp/revert |
| | | cp -R ${INSTALL_ROOT}/lib ${INSTANCE_ROOT}/tmp/revert |
| | | if test ${?} -ne 0 |
| | | then |
| | | echo "ERROR: Failed to initialize reversion." |
| | |
| | | CLASSPATH=${JAR}:${CLASSPATH} |
| | | done |
| | | # Launch the upgrade process. |
| | | "${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} org.opends.quicksetup.upgrader.ReversionLauncher "${@}" |
| | | "${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} -DINSTALL_ROOT=${INSTALL_ROOT} org.opends.quicksetup.upgrader.ReversionLauncher "${@}" |
| | | fi |
| | | elif test ${RETURN_CODE} -eq 50 |
| | | then |
| | |
| | | setlocal |
| | | for %%i in (%~sf0) do set DIR_HOME=%%~dPsi. |
| | | |
| | | set INSTANCE_ROOT=%DIR_HOME% |
| | | set INSTALL_ROOT=%DIR_HOME% |
| | | set INSTANCE_DIR= |
| | | for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do ( |
| | | set INSTANCE_DIR=%%a |
| | | ) |
| | | set CUR_DIR=%~dp0 |
| | | cd %INSTALL_ROOT% |
| | | cd %INSTANCE_DIR% |
| | | set INSTANCE_ROOT=%CD% |
| | | cd %CUR_DIR% |
| | | |
| | | :checkNewVersion |
| | | if exist "upgrade.bat.NEW" goto newVersion |
| | |
| | | |
| | | rem Set environment variables and test java |
| | | set SCRIPT_UTIL_CMD=set-full-environment-and-test-java |
| | | call "%INSTANCE_ROOT%\lib\_script-util.bat" |
| | | call "%INSTALL_ROOT%\lib\_script-util.bat" |
| | | if NOT %errorlevel% == 0 exit /B %errorlevel% |
| | | |
| | | :callExtractor |
| | | if EXIST "%INSTANCE_ROOT%\tmp\upgrade" rd "%INSTANCE_ROOT%\tmp\upgrade" /s /q |
| | | set CLASSPATH="" |
| | | FOR %%x in ("%INSTANCE_ROOT%\lib\*.jar") DO call "%INSTANCE_ROOT%\lib\setcp.bat" %%x |
| | | set CLASSPATH=%DIR_HOME%\classes;%CLASSPATH% |
| | | FOR %%x in ("%INSTALL_ROOT%\lib\*.jar") DO call "%INSTALL_ROOT%\lib\setcp.bat" %%x |
| | | set CLASSPATH=%INSTANCE_ROOT%\classes;%CLASSPATH% |
| | | "%OPENDS_JAVA_BIN%" %SCRIPT_NAME_ARG% org.opends.quicksetup.upgrader.BuildExtractor %* |
| | | if %errorlevel% == 99 goto upgrader |
| | | if %errorlevel% == 98 goto reverter |
| | |
| | | |
| | | :upgrader |
| | | set CLASSPATH="" |
| | | FOR %%x in ("%INSTANCE_ROOT%\tmp\upgrade\lib\*.jar") DO call "%INSTANCE_ROOT%\lib\setcp.bat" %%x |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.quicksetup.upgrader.UpgradeLauncher %* |
| | | FOR %%x in ("%INSTANCE_ROOT%\tmp\upgrade\lib\*.jar") DO call "%INSTALL_ROOT%\lib\setcp.bat" %%x |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% -DINSTALL_ROOT=%INSTALL_ROOT% org.opends.quicksetup.upgrader.UpgradeLauncher %* |
| | | goto end |
| | | |
| | | :reverter |
| | | if EXIST "%INSTANCE_ROOT%\tmp\revert" rd "%INSTANCE_ROOT%\tmp\revert" /s /q |
| | | xcopy "%INSTANCE_ROOT%\lib\*.*" "%INSTANCE_ROOT%\tmp\revert\lib\" /E /Q /Y |
| | | xcopy "%INSTALL_ROOT%\lib\*.*" "%INSTANCE_ROOT%\tmp\revert\lib\" /E /Q /Y |
| | | set CLASSPATH="" |
| | | FOR %%x in ("%INSTANCE_ROOT%\tmp\revert\lib\*.jar") DO call "%INSTANCE_ROOT%\lib\setcp.bat" %%x |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.quicksetup.upgrader.ReversionLauncher %* |
| | | FOR %%x in ("%INSTANCE_ROOT%\tmp\revert\lib\*.jar") DO call "%INSTALL_ROOT%\lib\setcp.bat" %%x |
| | | "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% -DINSTALL_ROOT=%INSTALL_ROOT% org.opends.quicksetup.upgrader.ReversionLauncher %* |
| | | goto end |
| | | |
| | | :version |
| | |
| | | import java.util.Collections; |
| | | import java.util.logging.Level; |
| | | import java.util.logging.Logger; |
| | | import java.io.BufferedReader; |
| | | import java.io.File; |
| | | import java.io.FileReader; |
| | | import java.io.IOException; |
| | | import java.net.URI; |
| | | |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public String getInstancePath() |
| | | { |
| | | String installPath = getInstallationPath(); |
| | | |
| | | // look for <installPath>/lib/resource.loc |
| | | String instancePathFileName = installPath + File.separator + "lib" |
| | | + File.separator + "resource.loc"; |
| | | File f = new File(instancePathFileName); |
| | | |
| | | if (! f.exists()) |
| | | { |
| | | return installPath; |
| | | } |
| | | |
| | | BufferedReader reader; |
| | | try |
| | | { |
| | | reader = new BufferedReader(new FileReader(instancePathFileName)); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return installPath; |
| | | } |
| | | |
| | | |
| | | // Read the first line and close the file. |
| | | String line; |
| | | try |
| | | { |
| | | line = reader.readLine(); |
| | | return new File(line).getAbsolutePath(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return installPath; |
| | | } |
| | | finally |
| | | { |
| | | try |
| | | { |
| | | reader.close(); |
| | | } catch (Exception e) {} |
| | | } |
| | | } |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public ProgressStep getCurrentProgressStep() |
| | | { |
| | | return UninstallProgressStep.NOT_STARTED; |
| | |
| | | import org.opends.quicksetup.util.BackgroundTask; |
| | | import org.opends.quicksetup.util.ServerController; |
| | | import org.opends.quicksetup.util.UIKeyStore; |
| | | import org.opends.quicksetup.util.Utils; |
| | | import org.opends.server.admin.AttributeTypePropertyDefinition; |
| | | import org.opends.server.admin.ClassLoaderProvider; |
| | | import org.opends.server.admin.ClassPropertyDefinition; |
| | |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public String getInstancePath() { |
| | | return getInstancePathFromClasspath(getInstallPathFromClasspath()); |
| | | } |
| | | |
| | | /** |
| | | * Returns the ApplicationException that might occur during installation or |
| | | * <CODE>null</CODE> if no exception occurred. |
| | | * |
| | |
| | | notifyListeners(getFormattedWithPoints( |
| | | INFO_PROGRESS_DELETING_INSTALLATION_FILES_NON_VERBOSE.get())); |
| | | } |
| | | File f = new File(getInstallPathFromClasspath()); |
| | | String installPath = getInstallPathFromClasspath(); |
| | | File installFile = new File(installPath); |
| | | |
| | | String instancePath = |
| | | Utils.getInstancePathFromClasspath(installFile.getAbsolutePath()); |
| | | File instanceFile = new File(instancePath); |
| | | |
| | | InstallationFilesToDeleteFilter filter = |
| | | new InstallationFilesToDeleteFilter(); |
| | | File[] rootFiles = f.listFiles(); |
| | | |
| | | File[] installFiles = installFile.listFiles(); |
| | | File[] instanceFiles = new File(instancePath).listFiles(); |
| | | |
| | | File[] rootFiles = null; |
| | | |
| | | if (installFiles == null) |
| | | { |
| | | rootFiles = new File(instancePath).listFiles(); |
| | | } |
| | | else |
| | | if (instanceFiles == null) |
| | | { |
| | | rootFiles = installFiles; |
| | | } |
| | | else |
| | | { |
| | | // both installFiles and instanceFiles are not null |
| | | rootFiles = new File[installFiles.length + instanceFiles.length]; |
| | | System.arraycopy(installFiles, 0, rootFiles, 0, installFiles.length); |
| | | System.arraycopy(instanceFiles, 0, rootFiles, installFiles.length, |
| | | instanceFiles.length); |
| | | } |
| | | |
| | | if (rootFiles != null) { |
| | | /* The following is done to have a moving progress bar when we delete |
| | | * the installation files. |
| | |
| | | beforeRatio); |
| | | deleteRecursively(rootFiles[i], filter); |
| | | } |
| | | deleteRecursively(instanceFile); |
| | | hmRatio.put(UninstallProgressStep.DELETING_INSTALLATION_FILES, maxRatio); |
| | | } |
| | | if (!isVerbose()) |
| | |
| | | public Installation getInstallation() { |
| | | if (installation == null) { |
| | | String installPath = getInstallationPath(); |
| | | String instancePath = getInstancePath(); |
| | | if (installPath != null) { |
| | | installation = new Installation(installPath); |
| | | if (instancePath == null) |
| | | { |
| | | installation = new Installation(installPath, installPath); |
| | | } |
| | | else |
| | | { |
| | | installation = new Installation(installPath, instancePath); |
| | | } |
| | | } |
| | | } |
| | | return installation; |
| | |
| | | public abstract String getInstallationPath(); |
| | | |
| | | /** |
| | | * Returns the instance path. |
| | | * @return the instance path. |
| | | */ |
| | | public abstract String getInstancePath(); |
| | | |
| | | |
| | | /** |
| | | * Gets the current step. |
| | | * @return ProgressStep representing the current step |
| | | */ |
| | |
| | | if (pathFile.isAbsolute()) { |
| | | fullDbPath = pathFile; |
| | | } else { |
| | | fullDbPath = new File(install.getRootDirectory(), path); |
| | | fullDbPath = new File(install.getInstanceDirectory(), path); |
| | | } |
| | | |
| | | if (!Utils.isDescendant(fullDbPath, install.getRootDirectory())) { |
| | | if (!Utils.isDescendant(fullDbPath, install.getInstanceDirectory())) { |
| | | outsidePaths.add(Utils.getPath(fullDbPath)); |
| | | } |
| | | } |
| | |
| | | CONFIG_PATH_RELATIVE+File.separator+"tools.properties"; |
| | | |
| | | /** |
| | | * The relative path to the instance.loc file. |
| | | */ |
| | | public static final String INSTANCE_LOCATION_PATH_RELATIVE = |
| | | "instance.loc"; |
| | | /** |
| | | * The UNIX setup script file name. |
| | | */ |
| | | public static final String UNIX_SETUP_FILE_NAME = "setup"; |
| | |
| | | |
| | | /** |
| | | * The name of the directory in an upgrade backup directory (child |
| | | * of the 'history' directory) that contains the install files from a |
| | | * previous version. |
| | | */ |
| | | public static final String HISTORY_BACKUP_FILES_DIR_INSTALL = "install"; |
| | | |
| | | /** |
| | | * The name of the directory in an upgrade backup directory (child |
| | | * of the 'history' directory) that contains the instance files from a |
| | | * previous version. |
| | | */ |
| | | |
| | | public static final String HISTORY_BACKUP_FILES_DIR_INSTANCE = "instance"; |
| | | /** |
| | | * The name of the directory in an upgrade backup directory (child |
| | | * of the 'history' directory) that contains the files from a |
| | | * previous version. |
| | | */ |
| | |
| | | // This allows testing of configuration components when the OpenDS.jar |
| | | // in the classpath does not necessarily point to the server's |
| | | String installRoot = System.getProperty("org.opends.quicksetup.Root"); |
| | | String instanceRoot = System |
| | | .getProperty("org.opends.quicksetup.instance"); |
| | | |
| | | if (installRoot == null) { |
| | | installRoot = Utils.getInstallPathFromClasspath(); |
| | | } |
| | | local = new Installation(installRoot); |
| | | if (instanceRoot == null) { |
| | | instanceRoot = Utils.getInstancePathFromClasspath(installRoot); |
| | | } |
| | | local = new Installation(installRoot, instanceRoot); |
| | | } |
| | | return local; |
| | | } |
| | |
| | | |
| | | private File rootDirectory; |
| | | |
| | | private File instanceDirectory; |
| | | |
| | | private Status status; |
| | | |
| | | private Configuration configuration; |
| | |
| | | private BuildInformation buildInformation; |
| | | |
| | | /** |
| | | * Indicates if the install and instance are in the same directory. |
| | | * @return true if the install and instance are in the same directory. |
| | | */ |
| | | public boolean instanceAndInstallInSameDir; |
| | | |
| | | /** |
| | | * Creates a new instance from a root directory specified as a string. |
| | | * |
| | | * @param rootDirectory of this installation |
| | | * @param instanceRootDirectory The instance root directory |
| | | */ |
| | | public Installation(String rootDirectory) { |
| | | this(new File(rootDirectory)); |
| | | public Installation(String rootDirectory, String instanceRootDirectory) { |
| | | this(new File(rootDirectory),new File(instanceRootDirectory)); |
| | | } |
| | | |
| | | /** |
| | | * Creates a new instance from a root directory specified as a File. |
| | | * |
| | | * @param rootDirectory of this installation |
| | | * |
| | | * @param instanceDirectory of the instance |
| | | */ |
| | | public Installation(File rootDirectory) { |
| | | public Installation(File rootDirectory, File instanceDirectory) { |
| | | setRootDirectory(rootDirectory); |
| | | setInstancetDirectory(instanceDirectory); |
| | | if (rootDirectory.getAbsolutePath(). |
| | | equals(instanceDirectory.getAbsolutePath())) |
| | | { |
| | | instanceAndInstallInSameDir = true ; |
| | | } |
| | | else |
| | | { |
| | | instanceAndInstallInSameDir = false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Indicates if the install and instance are in the same directory. |
| | | * @return true if the install and instance are in the same directory. |
| | | */ |
| | | public boolean instanceAndInstallInSameDir() |
| | | { |
| | | return instanceAndInstallInSameDir; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * Gets the top level directory of an OpenDS instance. |
| | | * |
| | | * @return File object representing the top level directory of |
| | | * and OpenDS installation |
| | | */ |
| | | public File getInstanceDirectory() { |
| | | return this.instanceDirectory; |
| | | } |
| | | |
| | | /** |
| | | * Sets the root directory of this installation. |
| | | * |
| | | * @param rootDirectory File of this installation |
| | |
| | | |
| | | // Hold off on doing validation of rootDirectory since |
| | | // some applications (like the Installer) create an Installation |
| | | // before the actual bits have been laid down on the filesyste. |
| | | // before the actual bits have been laid down on the file system. |
| | | this.rootDirectory = rootDirectory; |
| | | |
| | | // Obtaining build information is a fairly time consuming operation. |
| | | // Try to get a head start if possible. |
| | | if (isValid()) { |
| | | if (isValid(rootDirectory)) { |
| | | try { |
| | | BuildInformation bi = getBuildInformation(); |
| | | LOG.log(Level.INFO, "build info for " + rootDirectory.getName() + |
| | |
| | | } |
| | | |
| | | /** |
| | | * Sets the root directory of this instance. |
| | | * |
| | | * @param instanceDirectory File of this instance |
| | | */ |
| | | public void setInstancetDirectory(File instanceDirectory) { |
| | | |
| | | // Hold off on doing validation of rootDirectory since |
| | | // some applications (like the Installer) create an Installation |
| | | // before the actual bits have been laid down on the filesyste. |
| | | this.instanceDirectory = instanceDirectory; |
| | | |
| | | // Obtaining build information is a fairly time consuming operation. |
| | | // Try to get a head start if possible. |
| | | if (isValid(instanceDirectory)) { |
| | | try { |
| | | BuildInformation bi = getBuildInformation(); |
| | | LOG.log(Level.INFO, "build info for " + instanceDirectory.getName() + |
| | | ": " + bi); |
| | | } catch (ApplicationException e) { |
| | | LOG.log(Level.INFO, "error determining build information", e); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Indicates whether or not this installation appears to be an actual |
| | | * OpenDS installation. |
| | | * @param file The root directory |
| | | * @return boolean where true indicates that this does indeed appear to be |
| | | * a valid OpenDS installation; false otherwise |
| | | */ |
| | | public boolean isValid() { |
| | | public boolean isValid(File file) { |
| | | boolean valid = true; |
| | | try { |
| | | validateRootDirectory(rootDirectory); |
| | | validateRootDirectory(file); |
| | | } catch (IllegalArgumentException e) { |
| | | valid = false; |
| | | } |
| | |
| | | * @return the path to the database files under the install path. |
| | | */ |
| | | public File getDatabasesDirectory() { |
| | | return new File(getRootDirectory(), DATABASES_PATH_RELATIVE); |
| | | return new File(getInstanceDirectory(), DATABASES_PATH_RELATIVE); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return the path to the backup files under the install path. |
| | | */ |
| | | public File getBackupDirectory() { |
| | | return new File(getRootDirectory(), BACKUPS_PATH_RELATIVE); |
| | | return new File(getInstanceDirectory(), BACKUPS_PATH_RELATIVE); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return the path to the config files under the install path. |
| | | */ |
| | | public File getConfigurationDirectory() { |
| | | return new File(getRootDirectory(), CONFIG_PATH_RELATIVE); |
| | | return new File(getInstanceDirectory(), CONFIG_PATH_RELATIVE); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return the path to the log files under the install path. |
| | | */ |
| | | public File getLogsDirectory() { |
| | | return new File(getRootDirectory(), LOGS_PATH_RELATIVE); |
| | | return new File(getInstanceDirectory(), LOGS_PATH_RELATIVE); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return the path to the lock files. |
| | | */ |
| | | public File getLocksDirectory() { |
| | | return new File(getRootDirectory(), LOCKS_PATH_RELATIVE); |
| | | return new File(getInstanceDirectory(), LOCKS_PATH_RELATIVE); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return File temporary directory |
| | | */ |
| | | public File getTemporaryDirectory() { |
| | | return new File(getRootDirectory(), TMP_PATH_RELATIVE); |
| | | return new File(getInstanceDirectory(), TMP_PATH_RELATIVE); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return the path to the lock files. |
| | | */ |
| | | public File getHistoryDirectory() { |
| | | return new File(getRootDirectory(), HISTORY_PATH_RELATIVE); |
| | | return new File(getInstanceDirectory(), HISTORY_PATH_RELATIVE); |
| | | } |
| | | |
| | | /** |
| | |
| | | return getDelegateApplication().getInstallationPath(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public String getInstancePath() |
| | | { |
| | | return getDelegateApplication().getInstancePath(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | |
| | | |
| | | if (Utils.isWebStart()) |
| | | { |
| | | setInstallation(new Installation(getUserData().getServerLocation())); |
| | | String installDir = getUserData().getServerLocation(); |
| | | setInstallation(new Installation(installDir, installDir)); |
| | | } |
| | | |
| | | checkAbort(); |
| | |
| | | getFormattedSuccess( |
| | | INFO_SUMMARY_INSTALL_FINISHED_SUCCESSFULLY.get( |
| | | formatter.getFormattedText( |
| | | Message.raw(getInstallationPath())), |
| | | Message.raw(getInstancePath())), |
| | | INFO_GENERAL_SERVER_STOPPED.get(), |
| | | cmd))); |
| | | hmSummary.put(InstallProgressStep.FINISHED_CANCELED, |
| | |
| | | getFormattedSuccess( |
| | | INFO_SUMMARY_INSTALL_FINISHED_SUCCESSFULLY.get( |
| | | formatter.getFormattedText( |
| | | Message.raw(getInstallationPath())), |
| | | Message.raw(getInstancePath())), |
| | | status, |
| | | cmd))); |
| | | hmSummary.put(InstallProgressStep.FINISHED_WITH_ERROR, |
| | |
| | | */ |
| | | protected String getSelfSignedKeystorePath() |
| | | { |
| | | String parentFile = getPath(getInstallationPath(), |
| | | String parentFile = getPath(getInstancePath(), |
| | | Installation.CONFIG_PATH_RELATIVE); |
| | | return (getPath(parentFile, "keystore")); |
| | | } |
| | |
| | | */ |
| | | private String getTrustManagerPath() |
| | | { |
| | | String parentFile = getPath(getInstallationPath(), |
| | | String parentFile = getPath(getInstancePath(), |
| | | Installation.CONFIG_PATH_RELATIVE); |
| | | return (getPath(parentFile, "truststore")); |
| | | } |
| | |
| | | */ |
| | | private String getTemporaryCertificatePath() |
| | | { |
| | | String parentFile = getPath(getInstallationPath(), |
| | | String parentFile = getPath(getInstancePath(), |
| | | Installation.CONFIG_PATH_RELATIVE); |
| | | return (getPath(parentFile, "server-cert.txt")); |
| | | } |
| | |
| | | */ |
| | | private String getKeystorePinPath() |
| | | { |
| | | String parentFile = getPath(getInstallationPath(), |
| | | String parentFile = getPath(getInstancePath(), |
| | | Installation.CONFIG_PATH_RELATIVE); |
| | | return (getPath(parentFile, "keystore.pin")); |
| | | } |
| | |
| | | javaHome = System.getenv(SetupUtils.OPENDS_JAVA_HOME); |
| | | } |
| | | |
| | | String configDir = Utils.getPath(installPath, |
| | | String configDir = Utils.getPath(Utils |
| | | .getInstancePathFromClasspath(installPath), |
| | | Installation.CONFIG_PATH_RELATIVE); |
| | | String propertiesFile = Utils.getPath( |
| | | configDir, Installation.DEFAULT_JAVA_PROPERTIES_FILE); |
| | |
| | | import org.opends.messages.Message; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | |
| | | |
| | | import java.io.PrintStream; |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public String getInstancePath() |
| | | { |
| | | String installPath = Utils.getInstallPathFromClasspath(); |
| | | return Utils.getInstancePathFromClasspath(installPath); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | protected String getOpenDSClassPath() |
| | | { |
| | | return System.getProperty("java.class.path"); |
| | |
| | | { |
| | | return getUserData().getServerLocation(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public String getInstancePath() |
| | | { |
| | | // TODO |
| | | return null; |
| | | } |
| | | } |
| | |
| | | { |
| | | Installation installation; |
| | | if (isWebStart()) { |
| | | String installDir = application.getUserData().getServerLocation(); |
| | | installation = |
| | | new Installation(application.getUserData().getServerLocation()); |
| | | new Installation(installDir, installDir); |
| | | } else { |
| | | installation = Installation.getLocal(); |
| | | } |
| | |
| | | ZipExtractor extractor = new ZipExtractor(buildFile); |
| | | extractor.extract(stageDirectory); |
| | | LOG.log(Level.INFO, "Extraction finished"); |
| | | Installation installation = new Installation(stageDirectory); |
| | | if (!installation.isValid()) { |
| | | Installation installation = new Installation(stageDirectory, |
| | | stageDirectory); |
| | | if (!installation.isValid(stageDirectory)) { |
| | | LOG.log(Level.INFO, "Extraction produed an invalid OpenDS" + |
| | | "installation: " + installation.getInvalidityReason()); |
| | | Message invalidMsg = INFO_BUILD_EXTRACTOR_FILE_INVALID.get( |
| | |
| | | |
| | | private File initStageDirectory() throws ApplicationException { |
| | | File stageDir; |
| | | Installation installation = new Installation(getInstallationPath()); |
| | | Installation installation = new Installation(getInstallationPath(), |
| | | getInstancePath()); |
| | | stageDir = installation.getTemporaryUpgradeDirectory(); |
| | | if (stageDir.exists()) { |
| | | FileManager fm = new FileManager(); |
| | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public String getInstancePath() { |
| | | return Utils.getInstancePathFromClasspath(getInstallationPath()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | * @param launcher |
| | | */ |
| | | public UserData createUserData(Launcher launcher) |
| | |
| | | filesToIgnore.add(new File(root, rootFileNamesToIgnore)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Creates a filter for ignoring in an OpenDS installation at |
| | | * <code>root</code>certain OpenDS files below root. |
| | | * @param root the root of the installation |
| | | * @param forInstallDir true if the filter is for the install directory. |
| | | */ |
| | | public RevertFileFilter(File root,boolean forInstallDir ) { |
| | | super(root, forInstallDir); |
| | | this.filesToIgnore = new HashSet<File>(); |
| | | for (String rootFileNamesToIgnore : |
| | | Upgrader.ROOT_FILES_TO_IGNORE_DURING_BACKUP) { |
| | | filesToIgnore.add(new File(root, rootFileNamesToIgnore)); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | Message buildInfo = INFO_UPGRADE_BUILD_ID_UNKNOWN.get(); |
| | | Message date = INFO_GENERAL_UNKNOWN.get(); |
| | | try { |
| | | File f = appendFilesDirIfNeccessary(raDir); |
| | | Installation i = |
| | | new Installation(appendFilesDirIfNeccessary(raDir)); |
| | | new Installation(f,f); |
| | | BuildInformation bi = i.getBuildInformation(); |
| | | buildInfo = Message.raw(bi.toString()); |
| | | } catch (Exception e) { |
| | |
| | | */ |
| | | public String getInstallationPath() { |
| | | String installationPath = null; |
| | | String path = Utils.getInstallPathFromClasspath(); |
| | | String path = System.getProperty("INSTALL_ROOT"); |
| | | if (path != null) { |
| | | File f = new File(path); |
| | | if (f.getParentFile() != null && |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public String getInstancePath() { |
| | | String installPath = getInstallationPath() ; |
| | | return Utils.getInstancePathFromClasspath(installPath); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public ProgressStep getCurrentProgressStep() { |
| | | return this.currentProgressStep; |
| | | } |
| | |
| | | public Installation getInstallation() { |
| | | if (installation == null) { |
| | | String installPath = getInstallationPath(); |
| | | String instancePath = getInstancePath(); |
| | | if (installPath != null) { |
| | | installation = new Installation(installPath); |
| | | if (instancePath != null) |
| | | { |
| | | installation = new Installation(installPath, instancePath); |
| | | } |
| | | else |
| | | { |
| | | installation = new Installation(installPath, installPath); |
| | | } |
| | | } |
| | | } |
| | | return installation; |
| | |
| | | try { |
| | | Stage stage = getStage(); |
| | | Installation installation = getInstallation(); |
| | | File root = installation.getRootDirectory(); |
| | | stage.move(root, new RevertFileFilter(getReversionFilesDirectory())); |
| | | if (installation.instanceAndInstallInSameDir()) |
| | | { |
| | | File root = installation.getRootDirectory(); |
| | | stage.move(root, new RevertFileFilter(getReversionFilesDirectory())); |
| | | } |
| | | else |
| | | { |
| | | File root = installation.getRootDirectory(); |
| | | File revFileRoot = new File(getReversionFilesDirectory(), |
| | | Installation.HISTORY_BACKUP_FILES_DIR_INSTALL); |
| | | stage.move(root, new RevertFileFilter(revFileRoot,true),true); |
| | | |
| | | root = installation.getInstanceDirectory(); |
| | | revFileRoot = new File(getReversionFilesDirectory(), |
| | | Installation.HISTORY_BACKUP_FILES_DIR_INSTANCE); |
| | | stage.move(root, new RevertFileFilter(revFileRoot,false),false); |
| | | } |
| | | |
| | | // The bits should now be of the new version. Have |
| | | // the installation update the build information so |
| | |
| | | Set<String> cs = new HashSet<String>(Arrays.asList(children)); |
| | | |
| | | // TODO: more testing of file dir |
| | | String installPath = System.getProperty("INSTALL_ROOT"); |
| | | String instancePath = System.getProperty("INSTANCE_ROOT"); |
| | | if (installPath.equals(instancePath)) |
| | | { |
| | | isFilesDir = cs.contains(CONFIG_PATH_RELATIVE) && |
| | | cs.contains(LIBRARIES_PATH_RELATIVE); |
| | | } |
| | | else |
| | | { |
| | | isFilesDir = cs.contains(Installation.HISTORY_BACKUP_FILES_DIR_INSTALL) |
| | | && cs.contains( Installation.HISTORY_BACKUP_FILES_DIR_INSTANCE); |
| | | } |
| | | } |
| | | return isFilesDir; |
| | | } |
| | |
| | | { |
| | | if (archiveInstallation == null) { |
| | | File revFiles = getReversionFilesDirectory(); |
| | | archiveInstallation = new Installation(revFiles); |
| | | String[] children = revFiles.list(); |
| | | Set<String> cs = new HashSet<String>(Arrays.asList(children)); |
| | | if ((cs.contains(Installation.HISTORY_BACKUP_FILES_DIR_INSTALL)) && |
| | | (cs.contains(Installation.HISTORY_BACKUP_FILES_DIR_INSTANCE))) |
| | | { |
| | | File installRevFiles = |
| | | new File (revFiles,Installation.HISTORY_BACKUP_FILES_DIR_INSTALL); |
| | | File instanceRevFiles = |
| | | new File (revFiles,Installation.HISTORY_BACKUP_FILES_DIR_INSTANCE); |
| | | archiveInstallation = |
| | | new Installation(installRevFiles,instanceRevFiles); |
| | | } |
| | | else |
| | | { |
| | | archiveInstallation = new Installation(revFiles,revFiles); |
| | | } |
| | | } |
| | | return archiveInstallation; |
| | | } |
| | |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | import org.opends.messages.Message; |
| | | import org.opends.quicksetup.ApplicationException; |
| | | import org.opends.quicksetup.Installation; |
| | | import org.opends.quicksetup.util.Utils; |
| | | import org.opends.quicksetup.util.FileManager; |
| | | |
| | |
| | | throws ApplicationException { |
| | | for (String fileName : root.list()) { |
| | | File dest = new File(destination, fileName); |
| | | File src = getSourceForCopy(fileName, dest); |
| | | File srctmp = new File(root, fileName); |
| | | File src = getSourceForCopy(srctmp, fileName, dest); |
| | | //fm.copyRecursively(src, destination, fileFilter, /*overwrite=*/true); |
| | | fm.copyRecursively(src, destination, fileFilter, /*overwrite=*/true); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Moves the files in the staging area to a destination directory. |
| | | * |
| | | * @param destination for the staged files |
| | | * @param fileFilter the file filter to be used |
| | | * @param forInstallDir true if the filter is for the install directory. |
| | | * @throws ApplicationException if something goes wrong |
| | | */ |
| | | public void move(File destination, FileFilter fileFilter, |
| | | boolean forInstallDir) |
| | | throws ApplicationException { |
| | | File actualRoot = root ; |
| | | if (forInstallDir) |
| | | { |
| | | actualRoot = |
| | | new File(root, Installation.HISTORY_BACKUP_FILES_DIR_INSTALL); |
| | | } |
| | | else |
| | | { |
| | | actualRoot = |
| | | new File(root, Installation.HISTORY_BACKUP_FILES_DIR_INSTANCE); |
| | | } |
| | | for (String fileName : actualRoot.list()) { |
| | | File dest = new File(destination, fileName); |
| | | File srctmp = new File(actualRoot, fileName); |
| | | File src = getSourceForCopy(srctmp, fileName, dest); |
| | | //fm.copyRecursively(src, destination, fileFilter, /*overwrite=*/true); |
| | | fm.copyRecursively(src, destination, fileFilter, /*overwrite=*/true); |
| | | } |
| | |
| | | return Collections.unmodifiableList(messages); |
| | | } |
| | | |
| | | private File getSourceForCopy(String fileName, File dest) { |
| | | |
| | | File src = new File(root, fileName); |
| | | private File getSourceForCopy(File src, String fileName, File dest) { |
| | | |
| | | // If this is the running script on Windows, see if it is actually |
| | | // different than the new version. If not don't do anything but if |
| | |
| | | package org.opends.quicksetup.upgrader; |
| | | |
| | | import org.opends.quicksetup.util.Utils; |
| | | import org.opends.quicksetup.util.Utils.Dir; |
| | | |
| | | import java.io.FileFilter; |
| | | import java.io.File; |
| | | import java.util.Set; |
| | | import java.util.HashSet; |
| | | |
| | | |
| | | /** |
| | | * Filter defining files we want to manage in the upgrade |
| | | * process. |
| | | */ |
| | | class UpgradeFileFilter implements FileFilter { |
| | | |
| | | /** |
| | | * Private variable that store the filter scope. |
| | | */ |
| | | private Dir dir ; |
| | | |
| | | |
| | | private Set<File> installDirFileList; |
| | | |
| | | Set<File> filesToIgnore; |
| | | |
| | | /** |
| | |
| | | Upgrader.FILES_TO_IGNORE_DURING_BACKUP) { |
| | | filesToIgnore.add(new File(root, rootFileNamesToIgnore)); |
| | | } |
| | | |
| | | dir = Dir.ALL ; |
| | | installDirFileList = null ; |
| | | } |
| | | |
| | | /** |
| | | * Creates a filter for ignoring in an OpenDS installation at |
| | | * <code>root</code>certain OpenDS files below root. |
| | | * @param root the root of the installation |
| | | * @param forInstallDir true if the filter is for the install directory. |
| | | */ |
| | | public UpgradeFileFilter(File root, boolean forInstallDir) { |
| | | this(root); |
| | | if (forInstallDir) |
| | | { |
| | | dir = Dir.INSTALL; |
| | | } |
| | | else |
| | | { |
| | | dir = Dir.INSTANCE; |
| | | } |
| | | |
| | | installDirFileList = new HashSet<File>(); |
| | | for (String rootInstallDirFile : |
| | | Upgrader.ROOT_FILE_FOR_INSTALL_DIR) { |
| | | installDirFileList.add(new File(root, rootInstallDirFile)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if ((!accept) || (dir.compareTo(Dir.ALL) == 0)) |
| | | { |
| | | return accept ; |
| | | } |
| | | |
| | | // If we are here, accept is still set to "true". |
| | | if(dir.compareTo(Dir.INSTALL) == 0) |
| | | { |
| | | accept = false ; |
| | | for (File installDirFile : installDirFileList) { |
| | | if (installDirFile.equals(file) || |
| | | Utils.isParentOf(installDirFile, file)) { |
| | | accept = true ; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | if (dir.compareTo(Dir.INSTANCE) == 0) |
| | | { |
| | | for (File installDirFile : installDirFileList) { |
| | | if (installDirFile.equals(file) || |
| | | Utils.isParentOf(installDirFile, file)) { |
| | | accept = false ; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | // Should never occurs |
| | | accept = false ; |
| | | } |
| | | |
| | | return accept; |
| | | } |
| | | } |
| | |
| | | import org.opends.server.tools.JavaPropertiesTool; |
| | | |
| | | import java.awt.event.WindowEvent; |
| | | import java.io.BufferedReader; |
| | | import java.io.File; |
| | | import java.io.FileFilter; |
| | | import java.io.FileReader; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.net.InetSocketAddress; |
| | |
| | | "org.opends.quicksetup.upgrader.Root"; |
| | | |
| | | /** |
| | | * Passed in from the shell script if the root is known at the time |
| | | * of invocation. |
| | | */ |
| | | static private final String SYS_PROP_INSTANCE_ROOT = |
| | | "org.opends.quicksetup.upgrader.Instance"; |
| | | |
| | | /** |
| | | * If set to true, an error is introduced during the |
| | | * upgrade process for testing. |
| | | */ |
| | |
| | | LOGS_PATH_RELATIVE, // logs |
| | | LOCKS_PATH_RELATIVE, // locks |
| | | HISTORY_PATH_RELATIVE, // history |
| | | TMP_PATH_RELATIVE // tmp |
| | | TMP_PATH_RELATIVE, // tmp |
| | | INSTANCE_LOCATION_PATH_RELATIVE //instance.loc |
| | | }; |
| | | |
| | | // Files that should be located into the install directory |
| | | static final String[] ROOT_FILE_FOR_INSTALL_DIR= { |
| | | "bin", |
| | | "lib", |
| | | "bat", |
| | | "setup", |
| | | "setup.bat", |
| | | "uninstall", |
| | | "uninstall.bat", |
| | | "install.html", |
| | | "install.txt", |
| | | "legal-notices", |
| | | "opends_logo.png", |
| | | "README", |
| | | "upgrade", |
| | | "upgrade.bat", |
| | | "QuickSetup.app", |
| | | "Uninstall.app" |
| | | }; |
| | | |
| | | // Files that will be ignored during backup |
| | |
| | | initLoader(); |
| | | } |
| | | |
| | | final String instanceRootFromSystem = |
| | | final String installRootFromSystem = |
| | | System.getProperty(SYS_PROP_INSTALL_ROOT); |
| | | if (instanceRootFromSystem != null) { |
| | | setInstallation(new Installation(instanceRootFromSystem)); |
| | | final String instanceRootFromSystem = |
| | | System.getProperty(SYS_PROP_INSTANCE_ROOT); |
| | | if (installRootFromSystem != null) |
| | | { |
| | | if (instanceRootFromSystem != null) |
| | | { |
| | | setInstallation(new Installation(installRootFromSystem, |
| | | instanceRootFromSystem)); |
| | | } else |
| | | { |
| | | setInstallation(new Installation(installRootFromSystem, |
| | | installRootFromSystem)); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | public String getInstallationPath() { |
| | | // The upgrader runs from the bits extracted by BuildExtractor |
| | | // in the staging directory. So 'stagePath' below will point |
| | | // to the staging directory [installroot]/tmp/upgrade. However |
| | | // in the staging directory. However |
| | | // we still want the Installation to point at the build being |
| | | // upgraded so the install path reported in [installroot]. |
| | | return System.getProperty("INSTALL_ROOT"); |
| | | } |
| | | |
| | | String installationPath = null; |
| | | String path = Utils.getInstallPathFromClasspath(); |
| | | if (path != null) { |
| | | File f = new File(path); |
| | | if (f.getParentFile() != null && |
| | | f.getParentFile().getParentFile() != null && |
| | | new File(f.getParentFile().getParentFile(), |
| | | Installation.LOCKS_PATH_RELATIVE).exists()) { |
| | | installationPath = Utils.getPath(f.getParentFile().getParentFile()); |
| | | } else { |
| | | installationPath = path; |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public String getInstancePath() |
| | | { |
| | | String installPath = getInstallationPath(); |
| | | if (installPath == null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | String instancePathFileName = installPath + File.separator + "instance.loc"; |
| | | |
| | | // look for <installPath>/instance.loc |
| | | File f = new File(instancePathFileName); |
| | | if (!f.exists()) |
| | | { |
| | | return installPath; |
| | | } |
| | | |
| | | BufferedReader reader; |
| | | try |
| | | { |
| | | reader = new BufferedReader(new FileReader(instancePathFileName)); |
| | | } catch (Exception e) |
| | | { |
| | | return installPath; |
| | | } |
| | | |
| | | // Read the first line and close the file. |
| | | String line; |
| | | try |
| | | { |
| | | line = reader.readLine(); |
| | | File instanceLoc = new File(line); |
| | | if (instanceLoc.isAbsolute()) |
| | | { |
| | | return instanceLoc.getAbsolutePath(); |
| | | } else |
| | | { |
| | | return new File(installPath + File.separator |
| | | + line).getAbsolutePath(); |
| | | } |
| | | } catch (Exception e) |
| | | { |
| | | return installPath; |
| | | } finally |
| | | { |
| | | try |
| | | { |
| | | reader.close(); |
| | | } catch (Exception e) |
| | | { |
| | | } |
| | | } |
| | | return installationPath; |
| | | } |
| | | |
| | | /** |
| | |
| | | "'null'" : |
| | | currentInstallation.getRootDirectory()) + |
| | | " to " + serverLocation); |
| | | Installation installation = new Installation(serverLocation); |
| | | Installation installation = new Installation(serverLocation, |
| | | serverLocation); |
| | | setInstallation(installation); |
| | | } |
| | | |
| | |
| | | File root = getInstallation().getRootDirectory(); |
| | | File backupDirectory; |
| | | try { |
| | | backupDirectory = getFilesBackupDirectory(); |
| | | backupDirectory = getFilesInstallBackupDirectory(); |
| | | FileManager fm = new FileManager(); |
| | | boolean restoreError = false; |
| | | for (String fileName : backupDirectory.list()) { |
| | |
| | | fm.deleteRecursively(backupDirectory); |
| | | } |
| | | |
| | | if (! instanceAndInstallInSameDir()) |
| | | { |
| | | root = getInstallation().getInstanceDirectory(); |
| | | backupDirectory = getFilesInstanceBackupDirectory(); |
| | | fm = new FileManager(); |
| | | for (String fileName : backupDirectory.list()) { |
| | | File f = new File(backupDirectory, fileName); |
| | | |
| | | // Do our best to restore the filesystem like |
| | | // we found it. Just report potential problems |
| | | // to the user. |
| | | try { |
| | | fm.move(f, root, null); |
| | | } catch (Throwable t) { |
| | | restoreError = true; |
| | | notifyListeners(INFO_ERROR_RESTORING_FILE.get(Utils.getPath(f), |
| | | Utils.getPath(root))); |
| | | } |
| | | } |
| | | if (!restoreError) { |
| | | fm.deleteRecursively(backupDirectory); |
| | | } |
| | | } |
| | | |
| | | // Restart the server after putting the files |
| | | // back like we found them. |
| | | ServerController sc = new ServerController(getInstallation()); |
| | |
| | | Stage stage = getStage(); |
| | | Installation installation = getInstallation(); |
| | | File root = installation.getRootDirectory(); |
| | | stage.move(root, new UpgradeFileFilter(getStageDirectory())); |
| | | |
| | | if (instanceAndInstallInSameDir()) |
| | | { |
| | | stage.move(root, new UpgradeFileFilter(getStageDirectory())); |
| | | } |
| | | else |
| | | { |
| | | stage.move(root, new UpgradeFileFilter(getStageDirectory(),true)); |
| | | |
| | | root = installation.getInstanceDirectory(); |
| | | stage.move(root, new UpgradeFileFilter(getStageDirectory(),false)); |
| | | } |
| | | |
| | | // The bits should now be of the new version. Have |
| | | // the installation update the build information so |
| | |
| | | // The config directory may contain files that are needed |
| | | // by the new installation (e.g. SSL config files and tasks) |
| | | File oldConfigDir = |
| | | new File(getFilesBackupDirectory(), |
| | | new File(getFilesInstanceBackupDirectory(), |
| | | Installation.CONFIG_PATH_RELATIVE); |
| | | File newConfigDir = |
| | | getInstallation().getConfigurationDirectory(); |
| | |
| | | |
| | | private void backupFilesystem() throws ApplicationException { |
| | | try { |
| | | File filesBackupDirectory = getFilesBackupDirectory(); |
| | | // Backup first install (potentially everything if install and instance |
| | | // are in the same dir |
| | | File filesBackupDirectory = getFilesInstallBackupDirectory(); |
| | | FileManager fm = new FileManager(); |
| | | File root = getInstallation().getRootDirectory(); |
| | | FileFilter filter = new UpgradeFileFilter(root); |
| | |
| | | |
| | | fm.move(f, filesBackupDirectory, filter); |
| | | } |
| | | if (!instanceAndInstallInSameDir()) |
| | | { |
| | | filesBackupDirectory = getFilesInstanceBackupDirectory(); |
| | | root = getInstallation().getInstanceDirectory(); |
| | | filter = new UpgradeFileFilter(root); |
| | | for (String fileName : root.list()) |
| | | { |
| | | File f = new File(root, fileName); |
| | | |
| | | // Replacing a Windows bat file while it is running with a different |
| | | // version leads to unpredictable behavior so we make a special case |
| | | // here and during the upgrade components step. This file will only |
| | | // be backed up at the end of the process if everything went fine. |
| | | if (Utils.isWindows() |
| | | && fileName.equals(Installation.WINDOWS_UPGRADE_FILE_NAME)) |
| | | { |
| | | continue; |
| | | } |
| | | fm.move(f, filesBackupDirectory, filter); |
| | | } |
| | | } |
| | | } catch (ApplicationException ae) { |
| | | throw ae; |
| | | } catch (Exception e) { |
| | |
| | | { |
| | | if (Utils.isWindows()) |
| | | { |
| | | File filesBackupDirectory = getFilesBackupDirectory(); |
| | | File filesBackupDirectory = getFilesInstallBackupDirectory(); |
| | | FileManager fm = new FileManager(); |
| | | File root = getInstallation().getRootDirectory(); |
| | | File f = new File(root, Installation.WINDOWS_UPGRADE_FILE_NAME); |
| | |
| | | File stageDir = getStageDirectory(); |
| | | try { |
| | | Installation.validateRootDirectory(stageDir); |
| | | stagedInstallation = new Installation(getStageDirectory()); |
| | | stagedInstallation = new Installation(getStageDirectory(), |
| | | getStageDirectory()); |
| | | } catch (IllegalArgumentException e) { |
| | | Message msg = INFO_ERROR_BAD_STAGE_DIRECTORY.get( |
| | | Utils.getPath(getStageDirectory())); |
| | |
| | | return (UpgradeUserData) getUserData(); |
| | | } |
| | | |
| | | private boolean instanceAndInstallInSameDir() |
| | | { |
| | | File installDir = new File(getInstallationPath()) ; |
| | | File instanceDir = new File(getInstancePath()) ; |
| | | return installDir.getAbsolutePath().equals(instanceDir.getAbsolutePath()); |
| | | } |
| | | |
| | | private File getFilesInstanceBackupDirectory() throws IOException |
| | | { |
| | | if (instanceAndInstallInSameDir()) |
| | | { |
| | | return getFilesBackupDirectory(); |
| | | } else |
| | | { |
| | | return new File(getFilesBackupDirectory(), |
| | | Installation.HISTORY_BACKUP_FILES_DIR_INSTANCE); |
| | | } |
| | | } |
| | | |
| | | private File getFilesInstallBackupDirectory() throws IOException |
| | | { |
| | | if (instanceAndInstallInSameDir()) |
| | | { |
| | | return getFilesBackupDirectory(); |
| | | } else |
| | | { |
| | | return new File(getFilesBackupDirectory(), |
| | | Installation.HISTORY_BACKUP_FILES_DIR_INSTALL); |
| | | } |
| | | } |
| | | |
| | | private File getFilesBackupDirectory() throws IOException { |
| | | File files = new File(getUpgradeBackupDirectory(), |
| | | Installation.HISTORY_BACKUP_FILES_DIR_NAME); |
| | |
| | | throw new IOException("error creating files backup directory"); |
| | | } |
| | | } |
| | | |
| | | // Check if instance and instance are in the same dir |
| | | if ( ! instanceAndInstallInSameDir()) |
| | | { |
| | | File install = new File(files, |
| | | Installation.HISTORY_BACKUP_FILES_DIR_INSTALL); |
| | | if (!install.exists()) |
| | | { |
| | | if (!install.mkdirs()) |
| | | { |
| | | throw new IOException("error creating files backup directory"); |
| | | } |
| | | } |
| | | File instance = new File(files, |
| | | Installation.HISTORY_BACKUP_FILES_DIR_INSTANCE); |
| | | if (!instance.exists()) |
| | | { |
| | | if (!instance.mkdirs()) |
| | | { |
| | | throw new IOException("error creating files backup directory"); |
| | | } |
| | | } |
| | | } |
| | | return files; |
| | | } |
| | | |
| | |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.io.FileReader; |
| | | import java.io.FileWriter; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | |
| | | } |
| | | |
| | | /** |
| | | * Enumeration that specify if the operation applies to the install directory |
| | | * only, to the instance directory only, or both. |
| | | */ |
| | | public static enum Dir { |
| | | /** |
| | | * all directories. |
| | | */ |
| | | ALL, |
| | | |
| | | /** |
| | | * The install directory. |
| | | */ |
| | | INSTALL, |
| | | |
| | | /*** |
| | | * The instance directory. |
| | | */ |
| | | INSTANCE; |
| | | } |
| | | |
| | | /** |
| | | * Returns <CODE>true</CODE> if the provided port is free and we can use it, |
| | | * <CODE>false</CODE> otherwise. |
| | | * @param port the port we are analyzing. |
| | |
| | | return ConnectionUtils.getDefaultLDAPTimeout(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns the path of the installation of the directory server. Note that |
| | | * this method assumes that this code is being run locally. |
| | |
| | | */ |
| | | public static String getInstallPathFromClasspath() |
| | | { |
| | | String installPath = null; |
| | | String installPath = System.getProperty("org.opends.quicksetup.Root"); |
| | | if (installPath != null) |
| | | { |
| | | return installPath; |
| | | } |
| | | |
| | | /* Get the install path from the Class Path */ |
| | | String sep = System.getProperty("path.separator"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns the path of the installation of the directory server. Note that |
| | | * this method assumes that this code is being run locally. |
| | | * @param installPath The installation path |
| | | * @return the path of the installation of the directory server. |
| | | */ |
| | | public static String getInstancePathFromClasspath(String installPath) |
| | | { |
| | | String instancePathFileName = installPath + File.separator + "instance.loc"; |
| | | |
| | | // look for <installPath>/instance.loc |
| | | File f = new File(instancePathFileName); |
| | | if (! f.exists()) |
| | | { |
| | | return installPath; |
| | | } |
| | | |
| | | BufferedReader reader; |
| | | try |
| | | { |
| | | reader = new BufferedReader(new FileReader(instancePathFileName)); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return installPath; |
| | | } |
| | | |
| | | |
| | | // Read the first line and close the file. |
| | | String line; |
| | | try |
| | | { |
| | | line = reader.readLine(); |
| | | File instanceLoc = new File (line); |
| | | if (instanceLoc.isAbsolute()) |
| | | { |
| | | return instanceLoc.getAbsolutePath(); |
| | | } |
| | | else |
| | | { |
| | | return new File(installPath + File.separator + instanceLoc.getPath()) |
| | | .getAbsolutePath(); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return installPath; |
| | | } |
| | | finally |
| | | { |
| | | try |
| | | { |
| | | reader.close(); |
| | | } catch (Exception e) {} |
| | | } |
| | | } |
| | | |
| | | /** |
| | | |
| | | * Returns the max size in character of a line to be displayed in the command |
| | | * line. |
| | |
| | | "Class loader provider is disabled."); |
| | | } |
| | | |
| | | File libPath = new File(DirectoryServer.getServerRoot(), LIB_DIR); |
| | | File libPath = new File(DirectoryServer.getInstanceRoot(), LIB_DIR); |
| | | File extensionsPath = new File(libPath, EXTENSIONS_DIR); |
| | | |
| | | ArrayList<File> files = new ArrayList<File>(extensions.length); |
| | |
| | | */ |
| | | private void initializeAllExtensions() |
| | | throws InitializationException { |
| | | File libPath = new File(DirectoryServer.getServerRoot(), LIB_DIR); |
| | | File libPath = new File(DirectoryServer.getInstanceRoot(), LIB_DIR); |
| | | File extensionsPath = new File(libPath, EXTENSIONS_DIR); |
| | | |
| | | try { |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the absolute path of the Directory Server install |
| | | * root. |
| | | * |
| | | * @return The absolute path of the Directory Server install root. |
| | | */ |
| | | public abstract String getServerRoot(); |
| | | |
| | | |
| | | /** |
| | | * Retrieves the absolute path of the Directory Server instance |
| | | * root. |
| | | * |
| | | * @return The absolute path of the Directory Server instance root. |
| | | */ |
| | | public abstract String getServerRoot(); |
| | | |
| | | public abstract String getInstanceRoot(); |
| | | |
| | | |
| | | /** |
| | |
| | | * The name of the environment variable that the Directory Server may check to |
| | | * determine the installation root. |
| | | */ |
| | | public static final String ENV_VAR_INSTANCE_ROOT = "INSTANCE_ROOT"; |
| | | public static final String ENV_VAR_INSTALL_ROOT = "INSTALL_ROOT"; |
| | | |
| | | |
| | | |
| | |
| | | // Determine the location of the compressed schema data file. It should |
| | | // be in the config directory with a name of "schematokens.dat". If that |
| | | // file doesn't exist, then don't do anything. |
| | | String path = DirectoryServer.getServerRoot() + File.separator + |
| | | String path = DirectoryServer.getInstanceRoot() + File.separator + |
| | | CONFIG_DIR_NAME + File.separator + |
| | | COMPRESSED_SCHEMA_FILE_NAME; |
| | | if (! new File(path).exists()) |
| | |
| | | // Determine the location of the "live" compressed schema data file, and |
| | | // then append ".tmp" to get the name of the temporary file that we will |
| | | // use. |
| | | String path = DirectoryServer.getServerRoot() + File.separator + |
| | | String path = DirectoryServer.getInstanceRoot() + File.separator + |
| | | CONFIG_DIR_NAME + File.separator + |
| | | COMPRESSED_SCHEMA_FILE_NAME; |
| | | String tempPath = path + ".tmp"; |
| | |
| | | import org.opends.server.api.plugin.PluginResult; |
| | | import org.opends.server.backends.RootDSEBackend; |
| | | import static org.opends.server.config.ConfigConstants.DN_MONITOR_ROOT; |
| | | import static org.opends.server.config.ConfigConstants.ENV_VAR_INSTANCE_ROOT; |
| | | import static org.opends.server.config.ConfigConstants.ENV_VAR_INSTALL_ROOT; |
| | | import org.opends.server.config.ConfigEntry; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.config.JMXMBean; |
| | |
| | | |
| | | // If a server.starting file exists, then remove it. |
| | | File serverStartingFile = |
| | | new File(configHandler.getServerRoot() + File.separator + |
| | | new File(configHandler.getInstanceRoot() + File.separator + |
| | | "logs" + File.separator + "server.starting"); |
| | | if (serverStartingFile.exists()) |
| | | { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Retrieves the path to the instance directory for this instance of the |
| | | * Directory Server. |
| | | * |
| | | * @return The path to the instance directory for this instance of |
| | | * the Directory Server. |
| | | */ |
| | | public static String getInstanceRoot() |
| | | { |
| | | if (directoryServer.configHandler == null) |
| | | { |
| | | File serverRoot = directoryServer.environmentConfig.getServerRoot(); |
| | | if (serverRoot != null) |
| | | { |
| | | File instanceRoot = |
| | | directoryServer.environmentConfig.getInstanceRootFromServerRoot( |
| | | serverRoot); |
| | | if (instanceRoot != null) |
| | | { |
| | | return instanceRoot.getAbsolutePath(); |
| | | } |
| | | } |
| | | |
| | | // We don't know where the server root is, so we'll have to assume it's |
| | | // the current working directory. |
| | | return System.getProperty("user.dir"); |
| | | } |
| | | else |
| | | { |
| | | return directoryServer.configHandler.getInstanceRoot(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Retrieves the time that the Directory Server was started, in milliseconds |
| | | * since the epoch. |
| | | * |
| | |
| | | { |
| | | String pidFilePath; |
| | | String startingFilePath; |
| | | String serverRoot = System.getenv(ENV_VAR_INSTANCE_ROOT); |
| | | if (serverRoot == null) |
| | | String serverRoot = System.getenv(ENV_VAR_INSTALL_ROOT); |
| | | File instanceRoot = DirectoryEnvironmentConfig |
| | | .getInstanceRootFromServerRoot(new File(serverRoot)); |
| | | if (instanceRoot == null) |
| | | { |
| | | pidFilePath = "logs/server.pid"; |
| | | startingFilePath = "logs/server.starting"; |
| | | } |
| | | else |
| | | { |
| | | pidFilePath = serverRoot + File.separator + "logs" + |
| | | File.separator + "server.pid"; |
| | | startingFilePath = serverRoot + File.separator + "logs" + |
| | | File.separator + "server.starting"; |
| | | pidFilePath = instanceRoot.getAbsolutePath() + File.separator + "logs" |
| | | + File.separator + "server.pid"; |
| | | startingFilePath = instanceRoot.getAbsolutePath() + File.separator |
| | | + "logs" + File.separator + "server.starting"; |
| | | } |
| | | |
| | | File pidFile = new File(pidFilePath); |
| | |
| | | // We need to figure out where to put the file. See if the server root |
| | | // is available as an environment variable and if so then use it. |
| | | // Otherwise, try to figure it out from the location of the config file. |
| | | String serverRoot = System.getenv(ENV_VAR_INSTANCE_ROOT); |
| | | String serverRoot = System.getenv(ENV_VAR_INSTALL_ROOT); |
| | | if (serverRoot == null) |
| | | { |
| | | serverRoot = new File(configFile.getValue()).getParentFile(). |
| | |
| | | } |
| | | else |
| | | { |
| | | File logDir = new File(serverRoot + File.separator + "logs"); |
| | | File instanceRoot = DirectoryEnvironmentConfig |
| | | .getInstanceRootFromServerRoot(new File(serverRoot)); |
| | | File logDir = new File(instanceRoot.getAbsolutePath() + File.separator |
| | | + "logs"); |
| | | if (logDir.exists()) |
| | | { |
| | | FileOutputStream fos = |
| | |
| | | // The path to the configuration file. |
| | | private String configFile; |
| | | |
| | | // The instance root directory for the Directory Server. |
| | | // The install root directory for the Directory Server. |
| | | private String serverRoot; |
| | | |
| | | // The instance root directory for the Directory Server. |
| | | private String instanceRoot; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | if (serverRoot == null) |
| | | { |
| | | Message message = ERR_CONFIG_CANNOT_DETERMINE_SERVER_ROOT.get( |
| | | ENV_VAR_INSTANCE_ROOT); |
| | | ENV_VAR_INSTALL_ROOT); |
| | | throw new InitializationException(message); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | Message message = |
| | | ERR_CONFIG_CANNOT_DETERMINE_SERVER_ROOT.get(ENV_VAR_INSTANCE_ROOT); |
| | | ERR_CONFIG_CANNOT_DETERMINE_SERVER_ROOT.get(ENV_VAR_INSTALL_ROOT); |
| | | throw new InitializationException(message); |
| | | } |
| | | } |
| | |
| | | serverRoot = rootFile.getAbsolutePath(); |
| | | } |
| | | |
| | | // Determine the appropriate server root. If it's not defined in the |
| | | // environment config, then try to figure it out from the location of the |
| | | // configuration file. |
| | | File instanceFile = envConfig.getInstanceRootFromServerRoot(new File( |
| | | serverRoot)); |
| | | if (instanceFile == null) |
| | | { |
| | | Message message = |
| | | ERR_CONFIG_CANNOT_DETERMINE_SERVER_ROOT.get(ENV_VAR_INSTALL_ROOT); |
| | | throw new InitializationException(message); |
| | | } |
| | | else |
| | | { |
| | | instanceRoot = instanceFile.getAbsolutePath(); |
| | | } |
| | | |
| | | |
| | | |
| | | // Register with the Directory Server as an alert generator. |
| | | DirectoryServer.registerAlertGenerator(this); |
| | |
| | | return serverRoot; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public String getInstanceRoot() |
| | | { |
| | | return instanceRoot; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | File f = new File(path); |
| | | if (! f.isAbsolute() ) |
| | | { |
| | | f = new File(DirectoryServer.getServerRoot() + File.separator + |
| | | f = new File(DirectoryServer.getInstanceRoot() + File.separator + |
| | | path); |
| | | } |
| | | if (! f.exists()) |
| | |
| | | |
| | | // If we have a relative path to the instance, get the absolute one. |
| | | if ( ! ldifDirectory.isAbsolute() ) { |
| | | ldifDirectory = new File(DirectoryServer.getServerRoot() + File.separator |
| | | + ldifDirectoryPath); |
| | | ldifDirectory = new File(DirectoryServer.getInstanceRoot() |
| | | + File.separator + ldifDirectoryPath); |
| | | } |
| | | |
| | | if (ldifDirectory.exists()) |
| | |
| | | if (! backupDirectory.isAbsolute()) |
| | | { |
| | | backupDirectory = |
| | | new File(DirectoryServer.getServerRoot(), backupDirectoryPath); |
| | | new File(DirectoryServer.getInstanceRoot(), backupDirectoryPath); |
| | | } |
| | | |
| | | attrList = taskEntry.getAttribute(typeIncrementalBaseID); |
| | |
| | | if (! backupDirectory.isAbsolute()) |
| | | { |
| | | backupDirectory = |
| | | new File(DirectoryServer.getServerRoot(), backupDirectoryPath); |
| | | new File(DirectoryServer.getInstanceRoot(), backupDirectoryPath); |
| | | } |
| | | |
| | | attrList = taskEntry.getAttribute(typebackupID); |
| | |
| | | if (serverRoot == null) |
| | | { |
| | | err.println(ERR_CREATERC_UNABLE_TO_DETERMINE_SERVER_ROOT.get( |
| | | PROPERTY_SERVER_ROOT, ENV_VAR_INSTANCE_ROOT).toString()); |
| | | PROPERTY_SERVER_ROOT, ENV_VAR_INSTALL_ROOT).toString()); |
| | | return 1; |
| | | } |
| | | |
| | |
| | | w.println(); |
| | | |
| | | w.println("# Set the path to the OpenDS instance to manage"); |
| | | w.println("INSTANCE_ROOT=\"" + serverRoot.getAbsolutePath() + "\""); |
| | | w.println("export INSTANCE_ROOT"); |
| | | w.println("INSTALL_ROOT=\"" + serverRoot.getAbsolutePath() + "\""); |
| | | w.println("export INSTALL_ROOT"); |
| | | w.println(); |
| | | |
| | | if (javaHomeDir != null) |
| | |
| | | w.println("# Determine what action should be performed on the server"); |
| | | w.println("case \"${1}\" in"); |
| | | w.println("start)"); |
| | | w.println(" " + suString + "\"${INSTANCE_ROOT}/bin/start-ds\" --quiet"); |
| | | w.println(" " + suString + "\"${INSTALL_ROOT}/bin/start-ds\" --quiet"); |
| | | w.println(" exit ${?}"); |
| | | w.println(" ;;"); |
| | | w.println("stop)"); |
| | | w.println(" " + suString + "\"${INSTANCE_ROOT}/bin/stop-ds\" --quiet"); |
| | | w.println(" " + suString + "\"${INSTALL_ROOT}/bin/stop-ds\" --quiet"); |
| | | w.println(" exit ${?}"); |
| | | w.println(" ;;"); |
| | | w.println("restart)"); |
| | | w.println(" " + suString + "\"${INSTANCE_ROOT}/bin/stop-ds\" " + |
| | | w.println(" " + suString + "\"${INSTALL_ROOT}/bin/stop-ds\" " + |
| | | "--restart --quiet"); |
| | | w.println(" exit ${?}"); |
| | | w.println(" ;;"); |
| | |
| | | random = new Random(); |
| | | } |
| | | |
| | | String resourcePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String resourcePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | PATH_MAKELDIF_RESOURCE_DIR; |
| | | TemplateFile tf = new TemplateFile(resourcePath, random); |
| | | |
| | |
| | | { |
| | | // Use this instead of Installation.getLocal() because making that call |
| | | // starts a new JVM and the command-line becomes less responsive. |
| | | String root = Utils.getInstallPathFromClasspath(); |
| | | String a = Utils.getInstallPathFromClasspath(); |
| | | String root = Utils.getInstancePathFromClasspath(a); |
| | | String configDir = Utils.getPath(root, Installation.CONFIG_PATH_RELATIVE); |
| | | return Utils.getPath(configDir, Installation.CURRENT_CONFIG_FILE_NAME); |
| | | } |
| | |
| | | String value; |
| | | // Use this instead of Installation.getLocal() because making that call |
| | | // starts a new JVM and the command-line becomes less responsive. |
| | | String root = Utils.getInstallPathFromClasspath(); |
| | | String installPath = Utils.getInstallPathFromClasspath(); |
| | | String root = Utils.getInstancePathFromClasspath(installPath); |
| | | if (root != null) |
| | | { |
| | | String libDir = Utils.getPath(root, Installation.LIBRARIES_PATH_RELATIVE); |
| | |
| | | String defaultPropertiesValue; |
| | | // Use this instead of Installation.getLocal() because making that call |
| | | // starts a new JVM and the command-line becomes less responsive. |
| | | String root = Utils.getInstallPathFromClasspath(); |
| | | String installPath = Utils.getInstallPathFromClasspath(); |
| | | String root = Utils.getInstancePathFromClasspath(installPath); |
| | | if (root != null) |
| | | { |
| | | String configDir = Utils.getPath(root, Installation.CONFIG_PATH_RELATIVE); |
| | |
| | | |
| | | |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.File; |
| | | import java.io.FileReader; |
| | | import java.util.Enumeration; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | String serverRootPath = getProperty(PROPERTY_SERVER_ROOT); |
| | | if (serverRootPath == null) |
| | | { |
| | | serverRootPath = System.getenv(ENV_VAR_INSTANCE_ROOT); |
| | | serverRootPath = System.getenv(ENV_VAR_INSTALL_ROOT); |
| | | } |
| | | |
| | | if (serverRootPath == null) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Retrieves the directory that should be considered the instance |
| | | * root. The determination will first be based on the properties |
| | | * defined in this config object. If no value is found there, then |
| | | * the JVM system properties will be checked, followed by an |
| | | * environment variable. |
| | | * |
| | | * @param serverRoot the server Root |
| | | * |
| | | * @return The directory that should be considered the instance |
| | | * root, or {@code null} if it is not defined. |
| | | */ |
| | | public static File getInstanceRootFromServerRoot(File serverRoot) |
| | | { |
| | | String instancePathFileName = serverRoot.getAbsolutePath() + |
| | | File.separator + "instance.loc"; |
| | | |
| | | // look for <installPath>/instance.loc |
| | | File f = new File(instancePathFileName); |
| | | |
| | | if (! f.exists()) |
| | | { |
| | | return serverRoot; |
| | | } |
| | | |
| | | BufferedReader reader; |
| | | try |
| | | { |
| | | reader = new BufferedReader( |
| | | new FileReader(instancePathFileName)); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | // Read the first line and close the file. |
| | | String line; |
| | | try |
| | | { |
| | | line = reader.readLine(); |
| | | File instanceLoc = new File(line); |
| | | if (instanceLoc.isAbsolute()) |
| | | { |
| | | return instanceLoc; |
| | | } |
| | | else |
| | | { |
| | | return new File(serverRoot.getAbsolutePath() + File.separator |
| | | + instanceLoc.getPath()); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return null; |
| | | } |
| | | finally |
| | | { |
| | | try |
| | | { |
| | | reader.close(); |
| | | } catch (Exception e) {} |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Specifies the directory that should be considered the instance |
| | | * root. Any relative path used in the server should be considered |
| | | * relative to the instance root. |
| | | * |
| | | * @param instanceRoot The directory that should be considered the |
| | | * instanceRoot root. |
| | | * |
| | | * @return The previous server root, or {@code null} if there was |
| | | * none. |
| | | * |
| | | * @throws InitializationException If the Directory Server is |
| | | * already running or there is a |
| | | * problem with the provided |
| | | * server root. |
| | | */ |
| | | public File setInstanceRoot(File instanceRoot) |
| | | throws InitializationException |
| | | { |
| | | if (DirectoryServer.isRunning()) |
| | | { |
| | | throw new InitializationException( |
| | | ERR_DIRCFG_SERVER_ALREADY_RUNNING.get()); |
| | | } |
| | | |
| | | if ((! instanceRoot.exists()) || (! instanceRoot.isDirectory())) |
| | | { |
| | | throw new InitializationException( |
| | | ERR_DIRCFG_INVALID_SERVER_ROOT.get( |
| | | instanceRoot.getAbsolutePath())); |
| | | } |
| | | |
| | | String instanceRootPath; |
| | | try |
| | | { |
| | | instanceRootPath = instanceRoot.getCanonicalPath(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | instanceRootPath = instanceRoot.getAbsolutePath(); |
| | | } |
| | | |
| | | String oldInstancePath = setProperty(PROPERTY_INSTANCE_ROOT, |
| | | instanceRootPath); |
| | | if (oldInstancePath == null) |
| | | { |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | return new File(oldInstancePath); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Retrieves the configuration file that should be used to |
| | |
| | | File serverRoot = getServerRoot(); |
| | | if (serverRoot != null) |
| | | { |
| | | File configDir = new File(serverRoot, CONFIG_DIR_NAME); |
| | | File instanceRoot = getInstanceRootFromServerRoot(serverRoot); |
| | | File configDir = new File(instanceRoot, CONFIG_DIR_NAME); |
| | | File configFile = new File(configDir, CONFIG_FILE_NAME); |
| | | if (configFile.exists()) |
| | | { |
| | |
| | | File serverRoot = getServerRoot(); |
| | | if (serverRoot != null) |
| | | { |
| | | File schemaDir = new File(serverRoot.getAbsolutePath() + |
| | | File instanceRoot = getInstanceRootFromServerRoot(serverRoot); |
| | | File schemaDir = new File(instanceRoot.getAbsolutePath() + |
| | | File.separator + PATH_SCHEMA_DIR); |
| | | if (schemaDir.exists() && schemaDir.isDirectory()) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | return new File(serverRoot, LOCKS_DIRECTORY); |
| | | File instanceRoot = getInstanceRootFromServerRoot(serverRoot); |
| | | return new File(instanceRoot, LOCKS_DIRECTORY); |
| | | } |
| | | } |
| | | else |
| | |
| | | public static final String PROPERTY_SERVER_ROOT = |
| | | "org.opends.server.ServerRoot"; |
| | | |
| | | /** |
| | | * The name of the system property that can be used to specify the path to the |
| | | * instance root. |
| | | */ |
| | | public static final String PROPERTY_INSTANCE_ROOT = |
| | | "org.opends.server.InstanceRoot"; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | else |
| | | { |
| | | return new File(DirectoryServer.getServerRoot() + File.separator + path); |
| | | return new File(DirectoryServer.getInstanceRoot() + File.separator + |
| | | path); |
| | | } |
| | | } |
| | | |
| | |
| | | if (propertiesFilePath == null) |
| | | { |
| | | // check "Opends instance"/config directory |
| | | String instanceDir = DirectoryServer.getServerRoot(); |
| | | String instanceDir = DirectoryServer.getInstanceRoot(); |
| | | propertiesFilePath = findPropertiesFile(instanceDir+ File.separator |
| | | + "config"); |
| | | } |
| | |
| | | */ |
| | | @Test(enabled = false) |
| | | public void testIsValid() { |
| | | assertTrue(installation.isValid()); |
| | | assertTrue(installation.isValid(installation.getRootDirectory())); |
| | | assertTrue(installation.isValid(installation.getInstanceDirectory())); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Test(enabled = false) |
| | | public void testIsValid2() { |
| | | assertTrue(installation.isValid()); |
| | | assertTrue(installation.isValid(installation.getRootDirectory())); |
| | | assertTrue(installation.isValid(installation.getInstanceDirectory())); |
| | | File x = new File(installation.getRootDirectory(), "x"); |
| | | for (String reqDirName : Installation.REQUIRED_DIRECTORIES) { |
| | | File reqDir = new File(installation.getRootDirectory(), reqDirName); |
| | | try { |
| | | assertTrue(reqDir.renameTo(x)); |
| | | assertFalse(installation.isValid()); |
| | | assertFalse(installation.isValid(installation.getRootDirectory())); |
| | | assertFalse(installation.isValid(installation.getInstanceDirectory())); |
| | | assertNotNull(installation.getInvalidityReason()); |
| | | } finally { |
| | | x.renameTo(reqDir); |
| | |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.opends.server.types.OperatingSystem; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.File; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.FileWriter; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.InputStreamReader; |
| | | import java.io.PrintStream; |
| | | import java.net.ServerSocket; |
| | | import java.util.List; |
| | | import java.util.ArrayList; |
| | |
| | | } |
| | | |
| | | static public Installation getInstallation() { |
| | | return new Installation(getQuickSetupTestServerRootDir()); |
| | | return new Installation(getQuickSetupTestServerRootDir(),getQuickSetupTestServerRootDir()); |
| | | } |
| | | |
| | | static private void setupServer() throws IOException, InterruptedException { |
| | |
| | | args.add("-O"); |
| | | |
| | | ProcessBuilder pb = new ProcessBuilder(args); |
| | | |
| | | Process p = pb.start(); |
| | | if (p.waitFor() != 0) { |
| | | throw new IllegalStateException("setup server failed"); |
| | |
| | | public static final String PROPERTY_BUILD_ROOT = |
| | | "org.opends.server.BuildRoot"; |
| | | |
| | | /** |
| | | * The name of the system property that specifies an existing OpenDS |
| | | * installation root (inside or outside of the source tree). |
| | | */ |
| | | public static final String PROPERTY_INSTALLED_ROOT = |
| | | "org.opends.server.InstalledRoot"; |
| | | |
| | | /** |
| | | * The name of the system property that specifies an LDIF file |
| | | * with changes compare to the default config.ldif. |
| | | */ |
| | | public static final String PROPERTY_CONFIG_CHANGE_FILE = |
| | | "org.opends.server.ConfigChangeFile"; |
| | | |
| | | /** |
| | | * The name of the system property that specifies the ldap port. |
| | | * Set this prtoperty when running the server if you want to use a given |
| | |
| | | String buildRoot = System.getProperty(PROPERTY_BUILD_ROOT); |
| | | File buildDir = new File(buildRoot, "build"); |
| | | File unitRoot = new File(buildDir, "unit-tests"); |
| | | File testRoot = new File(unitRoot, "package"); |
| | | File testInstallRoot = new File(unitRoot, "package-install"); |
| | | File testInstanceRoot = new File(unitRoot, "package-instance"); |
| | | File testSrcRoot = new File(buildRoot + File.separator + "tests" + |
| | | File.separator + "unit-tests-testng"); |
| | | |
| | | if (testRoot.exists()) |
| | | if (testInstallRoot.exists()) |
| | | { |
| | | deleteDirectory(testRoot); |
| | | deleteDirectory(testInstallRoot); |
| | | } |
| | | testRoot.mkdirs(); |
| | | if (testInstanceRoot.exists()) |
| | | { |
| | | deleteDirectory(testInstanceRoot); |
| | | } |
| | | testInstallRoot.mkdirs(); |
| | | testInstanceRoot.mkdirs(); |
| | | |
| | | // Retrieves the location of a typical installation directory to use as a |
| | | // source to build our test instance. |
| | | String installedRoot = System.getProperty(PROPERTY_INSTALLED_ROOT); |
| | | |
| | | |
| | | //db_verify is second jeb backend used by the jeb verify test cases |
| | | //db_rebuild is the third jeb backend used by the jeb rebuild test cases |
| | | //db_unindexed is the forth backend used by the unindexed search privilege |
| | | //test cases |
| | | String[] subDirectories = { "bak", "bin", "changelogDb", "classes", |
| | | "config", "db", "import-tmp", "db_verify", |
| | | "ldif", "lib", "locks", "logs", "db_rebuild", |
| | | "db_unindexed", "db_index_test", |
| | | "db_import_test"}; |
| | | for (String s : subDirectories) |
| | | String[] installSubDirectories = { "bin", "lib", "bat"}; |
| | | String[] instanceSubDirectories = { "bak", "changelogDb", "classes", |
| | | "config", "db", "import-tmp", "db_verify", |
| | | "ldif", "locks", "logs", "db_rebuild", |
| | | "db_unindexed", "db_index_test", |
| | | "db_import_test"}; |
| | | for (String s : installSubDirectories) |
| | | { |
| | | new File(testRoot, s).mkdir(); |
| | | new File(testInstallRoot, s).mkdir(); |
| | | } |
| | | for (String s : instanceSubDirectories) |
| | | { |
| | | new File(testInstanceRoot, s).mkdir(); |
| | | } |
| | | |
| | | // Copy the configuration, schema, and MakeLDIF resources into the |
| | |
| | | File libDir = new File(buildRoot, "lib"); |
| | | File resourceDir = new File(buildRoot, "resource"); |
| | | File testResourceDir = new File(testSrcRoot, "resource"); |
| | | File testConfigDir = new File(testRoot, "config"); |
| | | File testClassesDir = new File(testRoot, "classes"); |
| | | File testLibDir = new File(testRoot, "lib"); |
| | | File testBinDir = new File(testRoot, "bin"); |
| | | File testConfigDir = new File(testInstanceRoot, "config"); |
| | | File testClassesDir = new File(testInstanceRoot, "classes"); |
| | | File testLibDir = new File(testInstallRoot, "lib"); |
| | | File testBinDir = new File(testInstallRoot, "bin"); |
| | | |
| | | // Snmp resource |
| | | String opendmkJarFileLocation = |
| | |
| | | File testSnmpResourceDir = new File (testConfigDir + File.separator + |
| | | "snmp"); |
| | | |
| | | if (Boolean.getBoolean(PROPERTY_COPY_CLASSES_TO_TEST_PKG)) { |
| | | if (Boolean.getBoolean(PROPERTY_COPY_CLASSES_TO_TEST_PKG)) |
| | | { |
| | | copyDirectory(serverClassesDir, testClassesDir); |
| | | copyDirectory(unitClassesDir, testClassesDir); |
| | | } |
| | | |
| | | copyDirectory(libDir, testLibDir); |
| | | copyDirectory(new File(resourceDir, "bin"), testBinDir); |
| | | copyDirectory(new File(resourceDir, "config"), testConfigDir); |
| | | copyDirectory(new File(resourceDir, "schema"), |
| | | new File(testConfigDir, "schema")); |
| | | copyDirectory(new File(resourceDir, "MakeLDIF"), |
| | | new File(testConfigDir, "MakeLDIF")); |
| | | copyDirectory(new File(snmpResourceDir, "security"), |
| | | new File(testSnmpResourceDir, "security")); |
| | | copyFile(new File(testResourceDir, "server.keystore"), |
| | | new File(testConfigDir, "server.keystore")); |
| | | copyFile(new File(testResourceDir, "server.truststore"), |
| | | new File(testConfigDir, "server.truststore")); |
| | | copyFile(new File(testResourceDir, "client.keystore"), |
| | | new File(testConfigDir, "client.keystore")); |
| | | copyFile(new File(testResourceDir, "client.truststore"), |
| | | new File(testConfigDir, "client.truststore")); |
| | | copyFile(new File(testResourceDir, "server-cert.p12"), |
| | | new File(testConfigDir, "server-cert.p12")); |
| | | copyFile(new File(testResourceDir, "client-cert.p12"), |
| | | new File(testConfigDir, "client-cert.p12")); |
| | | |
| | | if (opendmkJar.exists()) { |
| | | if (installedRoot != null) |
| | | { |
| | | copyDirectory(new File(installedRoot), testInstallRoot); |
| | | |
| | | // Get the instance location |
| | | |
| | | } |
| | | else |
| | | { |
| | | copyDirectory(libDir, testLibDir); |
| | | copyDirectory(new File(resourceDir, "bin"), testBinDir); |
| | | copyDirectory(new File(resourceDir, "config"), testConfigDir); |
| | | copyDirectory(new File(resourceDir, "schema"), |
| | | new File(testConfigDir, "schema")); |
| | | copyDirectory(new File(resourceDir, "MakeLDIF"), |
| | | new File(testConfigDir, "MakeLDIF")); |
| | | copyDirectory(new File(snmpResourceDir, "security"), |
| | | new File(testSnmpResourceDir, "security")); |
| | | copyFile(new File(testResourceDir, "server.keystore"), |
| | | new File(testConfigDir, "server.keystore")); |
| | | copyFile(new File(testResourceDir, "server.truststore"), |
| | | new File(testConfigDir, "server.truststore")); |
| | | copyFile(new File(testResourceDir, "client.keystore"), |
| | | new File(testConfigDir, "client.keystore")); |
| | | copyFile(new File(testResourceDir, "client.truststore"), |
| | | new File(testConfigDir, "client.truststore")); |
| | | copyFile(new File(testResourceDir, "server-cert.p12"), |
| | | new File(testConfigDir, "server-cert.p12")); |
| | | copyFile(new File(testResourceDir, "client-cert.p12"), |
| | | new File(testConfigDir, "client-cert.p12")); |
| | | |
| | | // Update the install.loc file |
| | | File installLoc = new File(testInstallRoot + File.separator |
| | | + "instance.loc"); |
| | | installLoc.deleteOnExit(); |
| | | FileWriter w = new FileWriter(installLoc); |
| | | w.write(testInstanceRoot.getAbsolutePath()); |
| | | w.close(); |
| | | |
| | | if (opendmkJar.exists()) |
| | | { |
| | | appendFile(new File(snmpConfigDir, "config.snmp.ldif"), |
| | | new File(testConfigDir,"config.ldif")); |
| | | } |
| | | new File(testConfigDir, "config.ldif")); |
| | | } |
| | | |
| | | for (File f : testBinDir.listFiles()) |
| | | { |
| | | try |
| | | for (File f : testBinDir.listFiles()) |
| | | { |
| | | FilePermission.setPermissions(f, FilePermission.decodeUNIXMode("755")); |
| | | } catch (Exception e) {} |
| | | } |
| | | |
| | | // Make the shell scripts in the bin directory executable, if possible. |
| | | OperatingSystem os = DirectoryServer.getOperatingSystem(); |
| | | if ((os != null) && OperatingSystem.isUNIXBased(os) && |
| | | FilePermission.canSetPermissions()) |
| | | { |
| | | try |
| | | { |
| | | FilePermission perm = FilePermission.decodeUNIXMode("755"); |
| | | for (File f : testBinDir.listFiles()) |
| | | try |
| | | { |
| | | if (f.getName().endsWith(".sh")) |
| | | { |
| | | FilePermission.setPermissions(f, perm); |
| | | } |
| | | } |
| | | } catch (Exception e) {} |
| | | } |
| | | FilePermission.setPermissions(f, FilePermission.decodeUNIXMode("755")); |
| | | } catch (Exception e) {} |
| | | } |
| | | |
| | | // Make the shell scripts in the bin directory executable, if possible. |
| | | OperatingSystem os = DirectoryServer.getOperatingSystem(); |
| | | if ((os != null) && OperatingSystem.isUNIXBased(os) && |
| | | FilePermission.canSetPermissions()) |
| | | { |
| | | try |
| | | { |
| | | FilePermission perm = FilePermission.decodeUNIXMode("755"); |
| | | for (File f : testBinDir.listFiles()) |
| | | { |
| | | if (f.getName().endsWith(".sh")) |
| | | { |
| | | FilePermission.setPermissions(f, perm); |
| | | } |
| | | } |
| | | } catch (Exception e) {} |
| | | } |
| | | } |
| | | // Find some free ports for the listeners and write them to the |
| | | // config-chamges.ldif file. |
| | | ServerSocket serverLdapSocket = null; |
| | |
| | | serverLdapsSocket = bindFreePort(); |
| | | serverLdapsPort = serverLdapsSocket.getLocalPort(); |
| | | |
| | | String defaultConfigChangeFile = testResourceDir + File.separator |
| | | + "config-changes.ldif"; |
| | | String configChangeFile = System.getProperty( |
| | | PROPERTY_CONFIG_CHANGE_FILE, defaultConfigChangeFile); |
| | | BufferedReader reader = new BufferedReader(new FileReader( |
| | | new File(testResourceDir, |
| | | "config-changes.ldif") |
| | | )); |
| | | new File(configChangeFile))); |
| | | FileOutputStream outFile = new FileOutputStream( |
| | | new File(testConfigDir, "config-changes.ldif")); |
| | | PrintStream writer = new PrintStream(outFile); |
| | |
| | | |
| | | // Create a configuration for the server. |
| | | DirectoryEnvironmentConfig config = new DirectoryEnvironmentConfig(); |
| | | config.setServerRoot(testRoot); |
| | | config.setServerRoot(testInstallRoot); |
| | | config.setInstanceRoot(testInstanceRoot); |
| | | |
| | | config.setForceDaemonThreads(true); |
| | | config.setConfigClass(ConfigFileHandler.class); |
| | | config.setConfigFile(new File(testConfigDir, "config.ldif")); |
| | |
| | | String buildRoot = System.getProperty(PROPERTY_BUILD_ROOT); |
| | | File buildDir = new File(buildRoot, "build"); |
| | | File unitRoot = new File(buildDir, "unit-tests"); |
| | | File testRoot = new File(unitRoot, "package"); |
| | | File testRoot = new File(unitRoot, "package-instance"); |
| | | return new File(testRoot, "config"); |
| | | } |
| | | |
| | |
| | | @Test() |
| | | public void testListGroupsSSLTrustStore() |
| | | { |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | @Test() |
| | | public void testListGroupsStartTLSTrustStore() |
| | | { |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | // Create a temporary test LDIF file. |
| | | File ldifFile = File.createTempFile("import-test", ".ldif"); |
| | | String resourcePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String resourcePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "MakeLDIF"; |
| | | LdifFileWriter.makeLdif(ldifFile.getPath(), resourcePath, templateFilePath); |
| | | |
| | |
| | | |
| | | String buildRoot = System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT); |
| | | String startOKFile = buildRoot + File.separator + "build" + File.separator + |
| | | "unit-tests" + File.separator + "package" + |
| | | "unit-tests" + File.separator + "package-instance" + |
| | | File.separator + "config" + File.separator + |
| | | "config.ldif.startok"; |
| | | |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | |
| | | String[] args = |
| | |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | |
| | | String[] args = |
| | |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | |
| | | KeyStore ks = KeyStore.getInstance("JKS"); |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | |
| | | String[] args = |
| | |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | |
| | | KeyStore ks = KeyStore.getInstance("JKS"); |
| | |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | |
| | | String[] args = |
| | |
| | | { |
| | | TestCaseUtils.startServer(); |
| | | |
| | | FileWriter writer = new FileWriter(DirectoryServer.getServerRoot() + |
| | | FileWriter writer = new FileWriter(DirectoryServer.getInstanceRoot() + |
| | | File.separator + "config" + |
| | | File.separator + "server.pin"); |
| | | writer.write("password" + EOL); |
| | | writer.close(); |
| | | |
| | | writer = new FileWriter(DirectoryServer.getServerRoot() + File.separator + |
| | | writer = new FileWriter(DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "empty"); |
| | | writer.close(); |
| | | |
| | |
| | | { |
| | | TestCaseUtils.startServer(); |
| | | |
| | | FileWriter writer = new FileWriter(DirectoryServer.getServerRoot() + |
| | | FileWriter writer = new FileWriter(DirectoryServer.getInstanceRoot() + |
| | | File.separator + "config" + |
| | | File.separator + "server.pin"); |
| | | writer.write("password" + EOL); |
| | | writer.close(); |
| | | |
| | | writer = new FileWriter(DirectoryServer.getServerRoot() + File.separator + |
| | | writer = new FileWriter(DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "empty"); |
| | | writer.close(); |
| | | |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | @Test() |
| | | public void testStartTLSNoAuthTrustStore() |
| | | { |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | @Test() |
| | | public void testStartTLSSimpleAuthTrustStore() |
| | | { |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | * @return |
| | | */ |
| | | private String getJmxKeystorePath() { |
| | | return DirectoryServer.getServerRoot() + File.separator + "config" |
| | | return DirectoryServer.getInstanceRoot() + File.separator + "config" |
| | | + File.separator + "server.keystore"; |
| | | } |
| | | |
| | |
| | | // Initialization : |
| | | // Load the database with a single entry : |
| | | String buildRoot = System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT); |
| | | String path = buildRoot + File.separator + "build" + |
| | | File.separator + "unit-tests" + File.separator + |
| | | "package"+ File.separator + "addModDelDependencyTest"; |
| | | String path = buildRoot + File.separator + "build" + File.separator |
| | | + "unit-tests" + File.separator + "package-instance" + File.separator |
| | | + "addModDelDependencyTest"; |
| | | OutputStream out = new FileOutputStream(new File(path)); |
| | | out.write(baseentryldif.getBytes()); |
| | | |
| | |
| | | String buildRoot = System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT); |
| | | String path = buildRoot + File.separator + "build" + |
| | | File.separator + "unit-tests" + File.separator + |
| | | "package"+ File.separator + "ReSynchTest"; |
| | | "package-instance"+ File.separator + "ReSynchTest"; |
| | | |
| | | task("dn: ds-task-id=" + UUID.randomUUID() |
| | | + ",cn=Scheduled Tasks,cn=Tasks\n" |
| | |
| | | // open the schema file |
| | | String buildRoot = System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT); |
| | | String path = buildRoot + File.separator + "build" + File.separator + |
| | | "unit-tests" + File.separator + "package" + File.separator + |
| | | "unit-tests" + File.separator + "package-instance" + |
| | | File.separator + |
| | | "config" + File.separator + "schema" + File.separator + |
| | | "99-user.ldif"; |
| | | |
| | |
| | | String buildRoot = System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT); |
| | | String path = buildRoot + File.separator + "build" + |
| | | File.separator + "unit-tests" + File.separator + |
| | | "package"+ File.separator + "addModDelDependencyTest"; |
| | | "package-instance" + File.separator + |
| | | "addModDelDependencyTest"; |
| | | OutputStream out = new FileOutputStream(new File(path)); |
| | | out.write(baseentryldif.getBytes()); |
| | | |
| | |
| | | String buildRoot = System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT); |
| | | String path = buildRoot + File.separator + "build" + |
| | | File.separator + "unit-tests" + File.separator + |
| | | "package"+ File.separator + "exportLDIF.ldif"; |
| | | "package-instance"+ File.separator + "exportLDIF.ldif"; |
| | | return TestCaseUtils.makeEntry( |
| | | "dn: ds-task-id=" + UUID.randomUUID() + ",cn=Scheduled Tasks,cn=Tasks", |
| | | "objectclass: top", |
| | |
| | | String buildRoot = System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT); |
| | | String path = buildRoot + File.separator + "build" + |
| | | File.separator + "unit-tests" + File.separator + |
| | | "package"+ File.separator + "exportLDIF" + root +".ldif"; |
| | | "package-instance"+ File.separator + "exportLDIF" + root +".ldif"; |
| | | return TestCaseUtils.makeEntry( |
| | | "dn: ds-task-id=" + UUID.randomUUID() + ",cn=Scheduled Tasks,cn=Tasks", |
| | | "objectclass: top", |
| | |
| | | |
| | | // Create a temporary test LDIF file. |
| | | ldifFile = File.createTempFile("import-test", ".ldif"); |
| | | String resourcePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String resourcePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "MakeLDIF"; |
| | | LdifFileWriter.makeLdif(ldifFile.getPath(), resourcePath, template); |
| | | |
| | |
| | | { |
| | | TestCaseUtils.startServer(); |
| | | |
| | | configFilePath = DirectoryServer.getServerRoot() + File.separator + |
| | | configFilePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "config.ldif"; |
| | | |
| | | passwordFilePath = TestCaseUtils.createTempFile("password"); |
| | |
| | | DirectoryServer.deregisterSASLMechanismHandler("EXTERNAL"); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | |
| | |
| | | DirectoryServer.deregisterSASLMechanismHandler("EXTERNAL"); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | |
| | |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | addTestUser(); |
| | |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | addTestUser(); |
| | |
| | | @Test() |
| | | public void testSimpleSearchSSLTrustStore() |
| | | { |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | @Test() |
| | | public void testSimpleSearchStartTLSTrustStore() |
| | | { |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | String keyStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String keyStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.keystore"; |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | { |
| | | TestCaseUtils.startServer(); |
| | | |
| | | configFilePath = DirectoryServer.getServerRoot() + File.separator + |
| | | configFilePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "config.ldif"; |
| | | } |
| | | |
| | |
| | | @Test() |
| | | public void testListConnectionHandlersSSLTrustStore() |
| | | { |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | @Test() |
| | | public void testListConnectionHandlersStartTLSTrustStore() |
| | | { |
| | | String trustStorePath = DirectoryServer.getServerRoot() + File.separator + |
| | | String trustStorePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "client.truststore"; |
| | | |
| | | String[] args = |
| | |
| | | // it can provide "getServerRoot()". |
| | | TestCaseUtils.startServer(); |
| | | |
| | | resourcePath = DirectoryServer.getServerRoot() + File.separator + |
| | | resourcePath = DirectoryServer.getInstanceRoot() + File.separator + |
| | | "config" + File.separator + "MakeLDIF"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static final String JKS_KEY_STORE_PATH = |
| | | System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT) + File.separator + |
| | | "build" + File.separator + "unit-tests" + File.separator + "package" + |
| | | "build" + File.separator + "unit-tests" + File.separator + |
| | | "package-instance" + |
| | | File.separator + "config" + File.separator + "server.keystore"; |
| | | |
| | | |
| | |
| | | */ |
| | | public static final String PKCS12_KEY_STORE_PATH = |
| | | System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT) + File.separator + |
| | | "build" + File.separator + "unit-tests" + File.separator + "package" + |
| | | "build" + File.separator + "unit-tests" + File.separator + |
| | | "package-instance" + |
| | | File.separator + "config" + File.separator + "server-cert.p12"; |
| | | |
| | | |
| | |
| | | */ |
| | | public static final String TEST_DIR = |
| | | System.getProperty(TestCaseUtils.PROPERTY_BUILD_ROOT) + File.separator + |
| | | "build" + File.separator + "unit-tests" + File.separator + "package"; |
| | | "build" + File.separator + "unit-tests" + File.separator + |
| | | "package-instance"; |
| | | |
| | | |
| | | |