Checkpoint commit for OPENDJ-1288 :
Migrate I18n and logging support to i18n framework and SLF4J
* Choose between 2 loggers implementation for launch scripts
** server scripts (start-ds, stop-ds) : use opendj-slf4j-adapter
** other scripts (tools) : use slf4j-jdk14 (java.util.logging)
** some tools won't output logs because they don't configure
handlers for java.util.logging
** build.xml generate two jars : bootstrap.jar and bootstrap-client.jar
to allow to choose logger implementation
* Add JDkLoggingFormatter class to format messages logged with
java.util.logging, used by tools
* Fix wrong level when logging in several classes
* Fix logging behavior for Tasks
* Fix OPENDJ-1315 Tools output should not be displayed with
severity "SEVERE_ERROR"
* Fix OPENDJ-1329 Some messages in start-ds output should not be
displayed with FATAL_ERROR severity
* Fix OPENDJ-1327 ${TMPDIR}/opendj-*.log files don't contain any logs/traces
1 files added
60 files modified
| | |
| | | |
| | | <antcall target="package-snmp" /> |
| | | |
| | | <!-- Build the bootstrap jar that avoids getting the error message "The input line is too long" on Windows --> |
| | | <!-- |
| | | Build the bootstrap jar that avoids getting the error message "The input line is too long" on Windows. |
| | | This is intended for the server, logging is implemented by the opendj-slf4j-adapter module. |
| | | --> |
| | | |
| | | <manifestclasspath property="manifest.classpath" |
| | | jarfile="${pdir}/lib/bootstrap.jar"> |
| | | <classpath> |
| | | <fileset dir="${pdir}/lib"> |
| | | <include name="*.jar" /> |
| | | <exclude name="slf4j-jdk14.jar" /> |
| | | </fileset> |
| | | </classpath> |
| | | </manifestclasspath> |
| | |
| | | </manifest> |
| | | </jar> |
| | | |
| | | <!-- |
| | | Build the bootstrap-client jar. |
| | | This is intended for client tools, logging is implemented through the slf4j-jdk14 library. |
| | | --> |
| | | <manifestclasspath property="manifest_client.classpath" |
| | | jarfile="${pdir}/lib/bootstrap-client.jar"> |
| | | <classpath> |
| | | <fileset dir="${pdir}/lib" includes="*.jar" excludes="bootstrap.jar opendj-slf4j-adapter.jar" > |
| | | </fileset> |
| | | </classpath> |
| | | </manifestclasspath> |
| | | <jar jarfile="${pdir}/lib/bootstrap-client.jar"> |
| | | <manifest> |
| | | <attribute name="Built-By" value="${user.name}" /> |
| | | <attribute name="Class-Path" value="${manifest_client.classpath}" /> |
| | | </manifest> |
| | | </jar> |
| | | |
| | | <!-- Create buildinfo files --> |
| | | <echo message="${MAJOR_VERSION}.${MINOR_VERSION}.${POINT_VERSION}.${REVISION_NUMBER}" |
| | | file="${pdir}/template/config/buildinfo" /> |
| | |
| | | --> |
| | | |
| | | <exclude org="javax.activation" artifact="activation" /> |
| | | <exclude module="slf4j-jdk14"/> |
| | | <!-- This is already the OpenDJ server module :) --> |
| | | <exclude module="opendj-server"/> |
| | | <exclude module="opendj3-server-dev"/> |
| | |
| | | rem |
| | | rem |
| | | rem Copyright 2008-2010 Sun Microsystems, Inc. |
| | | rem Portions Copyright 2011-2013 ForgeRock AS |
| | | rem Portions Copyright 2011-2014 ForgeRock AS |
| | | |
| | | set SET_JAVA_HOME_AND_ARGS_DONE=false |
| | | set SET_ENVIRONMENT_VARS_DONE=false |
| | |
| | | |
| | | :scriptBegin |
| | | if "%SCRIPT_UTIL_CMD%" == "set-full-environment-and-test-java" goto setFullEnvironmentAndTestJava |
| | | if "%SCRIPT_UTIL_CMD%" == "set-full-server-environment-and-test-java" goto setFullServerEnvironmentAndTestJava |
| | | if "%SCRIPT_UTIL_CMD%" == "set-full-environment" goto setFullEnvironment |
| | | if "%SCRIPT_UTIL_CMD%" == "set-java-home-and-args" goto setJavaHomeAndArgs |
| | | if "%SCRIPT_UTIL_CMD%" == "set_environment_vars" goto setEnvironmentVars |
| | |
| | | set SET_CLASSPATH_DONE=true |
| | | goto scriptBegin |
| | | |
| | | :setClassPathWithOpenDJLogger |
| | | if "%SET_CLASSPATH_DONE%" == "true" goto end |
| | | rem get the absolute paths before building the classpath |
| | | rem it also helps comparing the two paths |
| | | FOR /F %%i IN ("%INSTALL_ROOT%") DO set INSTALL_ROOT=%%~dpnxi |
| | | FOR /F %%i IN ("%INSTANCE_ROOT%") DO set INSTANCE_ROOT=%%~dpnxi |
| | | call "%INSTALL_ROOT%\lib\setcp.bat" %INSTALL_ROOT%\lib\bootstrap-client.jar |
| | | FOR %%x in ("%INSTALL_ROOT%\resources\*.jar") DO call "%INSTALL_ROOT%\lib\setcp.bat" %%x |
| | | set CLASSPATH=%INSTANCE_ROOT%\classes;%CLASSPATH% |
| | | if "%INSTALL_ROOT%" == "%INSTANCE_ROOT%" goto setClassPathWithOpenDJLoggerDone |
| | | FOR %%x in ("%INSTANCE_ROOT%\lib\*.jar") DO call "%INSTANCE_ROOT%\lib\setcp.bat" %%x |
| | | :setClassPathWithOpenDJLoggerDone |
| | | set SET_CLASSPATH_DONE=true |
| | | goto scriptBegin |
| | | |
| | | :setFullEnvironment |
| | | if "%SET_JAVA_HOME_AND_ARGS_DONE%" == "false" goto setJavaHomeAndArgs |
| | | if "%SET_CLASSPATH_DONE%" == "false" goto setClassPath |
| | |
| | | if "%SET_ENVIRONMENT_VARS_DONE%" == "false" goto setEnvironmentVars |
| | | goto testJava |
| | | |
| | | :setFullServerEnvironmentAndTestJava |
| | | if "%SET_JAVA_HOME_AND_ARGS_DONE%" == "false" goto setJavaHomeAndArgs |
| | | if "%SET_CLASSPATH_DONE%" == "false" goto setClassPathWithOpenDJLogger |
| | | if "%SET_ENVIRONMENT_VARS_DONE%" == "false" goto setEnvironmentVars |
| | | |
| | | :setJavaHomeAndArgs |
| | | if "%SET_JAVA_HOME_AND_ARGS_DONE%" == "true" goto end |
| | |
| | | set OPENDJ_JAVA_BIN=%OPENDS_JAVA_BIN% |
| | | goto endJavaHomeAndArgs |
| | | |
| | | |
| | | :checkOpenDJJavaHome |
| | | if "%OPENDJ_JAVA_HOME%" == "" goto checkLegacyOpenDSJavaHome |
| | | if not exist "%OPENDJ_JAVA_HOME%\bin\java.exe" goto checkLegacyOpenDSJavaHome |
| | |
| | | # |
| | | # |
| | | # Copyright 2008-2010 Sun Microsystems, Inc. |
| | | # Portions Copyright 2010-2013 ForgeRock AS |
| | | # Portions Copyright 2010-2014 ForgeRock AS |
| | | |
| | | # |
| | | # Display an error message |
| | |
| | | export SCRIPT_NAME_ARG |
| | | } |
| | | |
| | | # Configure the appropriate CLASSPATH. |
| | | set_classpath() { |
| | | # Configure the appropriate CLASSPATH for server, using Opend DJ logger. |
| | | set_opendj_logger_classpath() { |
| | | CLASSPATH="${INSTANCE_ROOT}/classes" |
| | | for JAR in "${INSTALL_ROOT}/resources/"*.jar |
| | | do |
| | |
| | | export CLASSPATH |
| | | } |
| | | |
| | | # Configure the appropriate CLASSPATH for client, using java.util.logging logger. |
| | | set_classpath() { |
| | | CLASSPATH="${INSTANCE_ROOT}/classes" |
| | | for JAR in "${INSTALL_ROOT}/resources/"*.jar |
| | | do |
| | | CLASSPATH=${CLASSPATH}:${JAR} |
| | | done |
| | | CLASSPATH="${CLASSPATH}:${INSTALL_ROOT}/lib/bootstrap-client.jar" |
| | | if [ "${INSTALL_ROOT}" != "${INSTANCE_ROOT}" ] |
| | | then |
| | | for JAR in "${INSTANCE_ROOT}/lib/"*.jar |
| | | do |
| | | CLASSPATH=${CLASSPATH}:${JAR} |
| | | done |
| | | fi |
| | | export CLASSPATH |
| | | } |
| | | |
| | | isVersionOrHelp() { |
| | | for opt in `echo $*` |
| | | do |
| | |
| | | set_classpath |
| | | test_java_args |
| | | test_java |
| | | elif test "${SCRIPT_UTIL_CMD}" = "set-full-server-environment-and-test-java" |
| | | then |
| | | set_java_home_and_args |
| | | set_environment_vars |
| | | set_opendj_logger_classpath |
| | | test_java_args |
| | | test_java |
| | | elif test "${SCRIPT_UTIL_CMD}" = "set-full-environment" |
| | | then |
| | | set_java_home_and_args |
| | |
| | | # |
| | | # |
| | | # Copyright 2006-2009 Sun Microsystems, Inc. |
| | | # Portions Copyright 2011-2013 ForgeRock AS |
| | | # Portions Copyright 2011-2014 ForgeRock AS |
| | | |
| | | |
| | | # Capture the current working directory so that we can change to it later. |
| | |
| | | fi |
| | | |
| | | # Set environment variables |
| | | SCRIPT_UTIL_CMD=set-full-environment-and-test-java |
| | | SCRIPT_UTIL_CMD=set-full-server-environment-and-test-java |
| | | export SCRIPT_UTIL_CMD |
| | | . "${INSTALL_ROOT}/lib/_script-util.sh" |
| | | RETURN_CODE=$? |
| | |
| | | rem |
| | | rem |
| | | rem Copyright 2006-2010 Sun Microsystems, Inc. |
| | | rem Portions Copyright 2011-2013 ForgeRock AS |
| | | rem Portions Copyright 2011-2014 ForgeRock AS |
| | | |
| | | setlocal |
| | | for %%i in (%~sf0) do set DIR_HOME=%%~dPsi.. |
| | |
| | | set SCRIPT_NAME=start-ds |
| | | |
| | | rem Set environment variables |
| | | set SCRIPT_UTIL_CMD=set-full-environment-and-test-java |
| | | set SCRIPT_UTIL_CMD=set-full-server-environment-and-test-java |
| | | call "%INSTALL_ROOT%\lib\_script-util.bat" %* |
| | | |
| | | set ERROR_CODE=%errorlevel% |
| | |
| | | # |
| | | # |
| | | # Copyright 2006-2009 Sun Microsystems, Inc. |
| | | # Portions Copyright 2011 ForgeRock AS |
| | | # Portions Copyright 2011-2014 ForgeRock AS |
| | | |
| | | |
| | | # This script may be used to request that the Directory Server shut down. |
| | |
| | | fi |
| | | |
| | | # Set environment variables |
| | | SCRIPT_UTIL_CMD=set-full-environment-and-test-java |
| | | SCRIPT_UTIL_CMD=set-full-server-environment-and-test-java |
| | | export SCRIPT_UTIL_CMD |
| | | . "${INSTALL_ROOT}/lib/_script-util.sh" |
| | | RETURN_CODE=$? |
| | |
| | | echo %SCRIPT%: invoked >> %LOG% |
| | | |
| | | rem Set environment variables |
| | | set SCRIPT_UTIL_CMD=set-full-environment-and-test-java |
| | | set SCRIPT_UTIL_CMD=set-full-server-environment-and-test-java |
| | | call "%INSTALL_ROOT%\lib\_script-util.bat" %* |
| | | if NOT %errorlevel% == 0 exit /B %errorlevel% |
| | | |
| | |
| | | ServerDescriptor descriptor = loader.getServerDescriptor(); |
| | | for (ReplicaDescriptor replica : descriptor.getReplicas()) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Handling replica with dn: " |
| | | logger.info(LocalizableMessage.raw("Handling replica with dn: " |
| | | + replica.getSuffix().getDN())); |
| | | |
| | | boolean suffixFound = false; |
| | |
| | | } |
| | | catch (InterruptedException ie) |
| | | { |
| | | logger.debug(LocalizableMessage.raw(ie + " caught and ignored", ie)); |
| | | logger.info(LocalizableMessage.raw(ie + " caught and ignored", ie)); |
| | | } |
| | | if (t.isAlive()) |
| | | { |
| | |
| | | } |
| | | Date endDate = new Date(); |
| | | long workingTime = endDate.getTime() - startDate.getTime(); |
| | | logger.debug(LocalizableMessage.raw("Loading ended at " + workingTime + " ms")); |
| | | logger.info(LocalizableMessage.raw("Loading ended at " + workingTime + " ms")); |
| | | } |
| | | |
| | | /** |
| | |
| | | private Integer calculateId(final Category category, |
| | | final Severity severity, final Integer ordinal) |
| | | { |
| | | return new Integer(ordinal | category.getMask() | severity.getMask()); |
| | | // Id is equivalent to ordinal with OpenDJ3 |
| | | return new Integer(ordinal); |
| | | } |
| | | |
| | | /** |
| | |
| | | { |
| | | try |
| | | { |
| | | logger.debug(LocalizableMessage.raw("going to call createAndDisplayGUI.")); |
| | | logger.info(LocalizableMessage.raw("going to call createAndDisplayGUI.")); |
| | | controlPanel.createAndDisplayGUI(); |
| | | logger.debug(LocalizableMessage.raw("called createAndDisplayGUI.")); |
| | | logger.info(LocalizableMessage.raw("called createAndDisplayGUI.")); |
| | | } catch (Throwable t) |
| | | { |
| | | logger.error(LocalizableMessage.raw("Error displaying GUI: "+t, t)); |
| | |
| | | ApplicationTrustManager.Cause cause = |
| | | getInfo().getTrustManager().getLastRefusedCause(); |
| | | |
| | | logger.debug(LocalizableMessage.raw("Certificate exception cause: "+cause)); |
| | | logger.info(LocalizableMessage.raw("Certificate exception cause: "+cause)); |
| | | UserDataCertificateException.Type excType = null; |
| | | if (cause == ApplicationTrustManager.Cause.NOT_TRUSTED) |
| | | { |
| | |
| | | |
| | | if ((chain != null) && (authType != null) && (host != null)) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Accepting certificate presented by host "+host)); |
| | | logger.info(LocalizableMessage.raw("Accepting certificate presented by host "+host)); |
| | | getInfo().getTrustManager().acceptCertificate(chain, authType, host); |
| | | createdUserDataCtx = createUserDataDirContext(bindDN, bindPassword); |
| | | } |
| | |
| | | |
| | | if (throwable != null) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Error connecting: " + throwable, throwable)); |
| | | logger.info(LocalizableMessage.raw("Error connecting: " + throwable, throwable)); |
| | | |
| | | if (isVersionException(throwable)) |
| | | { |
| | |
| | | ApplicationTrustManager.Cause cause = |
| | | getInfo().getTrustManager().getLastRefusedCause(); |
| | | |
| | | logger.debug(LocalizableMessage.raw("Certificate exception cause: "+cause)); |
| | | logger.info(LocalizableMessage.raw("Certificate exception cause: "+cause)); |
| | | UserDataCertificateException.Type excType = null; |
| | | if (cause == ApplicationTrustManager.Cause.NOT_TRUSTED) |
| | | { |
| | |
| | | |
| | | if ((chain != null) && (authType != null) && (host != null)) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Accepting certificate presented by host "+host)); |
| | | logger.info(LocalizableMessage.raw("Accepting certificate presented by host "+host)); |
| | | getInfo().getTrustManager().acceptCertificate(chain, authType, host); |
| | | /* Simulate a click on the OK by calling in the okClicked method. */ |
| | | SwingUtilities.invokeLater(new Runnable() |
| | |
| | | boolean handleCertificateException = false; |
| | | if (throwable != null) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Error connecting: " + throwable, throwable)); |
| | | logger.info(LocalizableMessage.raw("Error connecting: " + throwable, throwable)); |
| | | |
| | | if (Utils.isCertificateException(throwable)) |
| | | { |
| | | ApplicationTrustManager.Cause cause = |
| | | getInfo().getTrustManager().getLastRefusedCause(); |
| | | |
| | | logger.debug(LocalizableMessage.raw("Certificate exception cause: "+cause)); |
| | | logger.info(LocalizableMessage.raw("Certificate exception cause: "+cause)); |
| | | UserDataCertificateException.Type excType = null; |
| | | if (cause == ApplicationTrustManager.Cause.NOT_TRUSTED) |
| | | { |
| | |
| | | |
| | | if ((chain != null) && (authType != null) && (host != null)) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Accepting certificate presented by host "+host)); |
| | | logger.info(LocalizableMessage.raw("Accepting certificate presented by host "+host)); |
| | | getInfo().getTrustManager().acceptCertificate(chain, authType, host); |
| | | /* Simulate a click on the OK by calling in the okClicked method. */ |
| | | SwingUtilities.invokeLater(new Runnable() |
| | |
| | | public void println(String msg) |
| | | { |
| | | notifyListenersNewLine(msg); |
| | | logger.debug(LocalizableMessage.raw(msg)); |
| | | logger.info(LocalizableMessage.raw(msg)); |
| | | } |
| | | |
| | | /** |
| | |
| | | environmentSettingException = new OfflineUpdateException( |
| | | ERR_CTRL_PANEL_SETTING_ENVIRONMENT.get(t.getMessage()), t); |
| | | } |
| | | logger.debug(LocalizableMessage.raw("Environment initialized.")); |
| | | logger.info(LocalizableMessage.raw("Environment initialized.")); |
| | | } |
| | | |
| | | /** |
| | |
| | | import java.io.IOException; |
| | | import java.util.logging.FileHandler; |
| | | import java.util.logging.Logger; |
| | | import java.util.logging.SimpleFormatter; |
| | | |
| | | import java.util.Date; |
| | | import java.text.DateFormat; |
| | | |
| | | import org.opends.server.loggers.JdkLoggingFormater; |
| | | |
| | | /** |
| | | * Utilities for setting up Control Panel application log. |
| | | */ |
| | |
| | | { |
| | | logFile = file; |
| | | fileHandler = new FileHandler(logFile.getCanonicalPath()); |
| | | fileHandler.setFormatter(new SimpleFormatter()); |
| | | fileHandler.setFormatter(new JdkLoggingFormater()); |
| | | for (String packageName : packages) |
| | | { |
| | | Logger logger = Logger.getLogger(packageName); |
| | |
| | | outsideDbs = config.getOutsideDbs(); |
| | | } catch (IOException ioe) { |
| | | outsideDbs = Collections.emptySet(); |
| | | logger.debug(LocalizableMessage.raw("error determining outside databases", ioe)); |
| | | logger.info(LocalizableMessage.raw("error determining outside databases", ioe)); |
| | | } |
| | | |
| | | try { |
| | | outsideLogs = config.getOutsideLogs(); |
| | | } catch (IOException ioe) { |
| | | outsideLogs = Collections.emptySet(); |
| | | logger.debug(LocalizableMessage.raw("error determining outside logs", ioe)); |
| | | logger.info(LocalizableMessage.raw("error determining outside logs", ioe)); |
| | | } |
| | | |
| | | boolean somethingSpecifiedToDelete = |
| | |
| | | |
| | | if (isCanceled && !userData.isForceOnError()) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("User cancelled uninstall.")); |
| | | logger.info(LocalizableMessage.raw("User cancelled uninstall.")); |
| | | userData = null; |
| | | } |
| | | |
| | |
| | | throw new IllegalStateException("Unexpected error: "+t, t); |
| | | } |
| | | } |
| | | logger.debug(LocalizableMessage.raw("Successfully created user data")); |
| | | logger.info(LocalizableMessage.raw("Successfully created user data")); |
| | | return userData; |
| | | } |
| | | |
| | |
| | | throw new UserDataException(Step.CONFIRM_UNINSTALL, |
| | | Utils.getThrowableMsg(INFO_BUG_MSG.get(), t)); |
| | | } |
| | | logger.debug(LocalizableMessage.raw("interactive: "+interactive)); |
| | | logger.debug(LocalizableMessage.raw("forceOnError: "+forceOnError)); |
| | | logger.debug(LocalizableMessage.raw("conf.isADS(): "+conf.isADS())); |
| | | logger.debug(LocalizableMessage.raw("conf.isReplicationServer(): "+ |
| | | logger.info(LocalizableMessage.raw("interactive: "+interactive)); |
| | | logger.info(LocalizableMessage.raw("forceOnError: "+forceOnError)); |
| | | logger.info(LocalizableMessage.raw("conf.isADS(): "+conf.isADS())); |
| | | logger.info(LocalizableMessage.raw("conf.isReplicationServer(): "+ |
| | | conf.isReplicationServer())); |
| | | logger.debug(LocalizableMessage.raw("conf.isServerRunning(): "+conf.isServerRunning())); |
| | | logger.info(LocalizableMessage.raw("conf.isServerRunning(): "+conf.isServerRunning())); |
| | | if (conf.isADS() && conf.isReplicationServer()) |
| | | { |
| | | if (conf.isServerRunning()) |
| | |
| | | boolean errorWithRemote = |
| | | !updateUserUninstallDataWithRemoteServers(userData); |
| | | cancelled = errorWithRemote && !parser.isForceOnError(); |
| | | logger.debug(LocalizableMessage.raw("Non interactive mode. errorWithRemote: "+ |
| | | logger.info(LocalizableMessage.raw("Non interactive mode. errorWithRemote: "+ |
| | | errorWithRemote)); |
| | | } |
| | | } |
| | |
| | | /* During all the confirmations, the server might be stopped. */ |
| | | userData.setStopServer( |
| | | Installation.getLocal().getStatus().isServerRunning()); |
| | | logger.debug(LocalizableMessage.raw("Must stop the server after confirmations? "+ |
| | | logger.info(LocalizableMessage.raw("Must stop the server after confirmations? "+ |
| | | userData.getStopServer())); |
| | | } |
| | | } |
| | |
| | | /* During all the confirmations, the server might be stopped. */ |
| | | userData.setStopServer( |
| | | Installation.getLocal().getStatus().isServerRunning()); |
| | | logger.debug(LocalizableMessage.raw("Must stop the server after confirmations? "+ |
| | | logger.info(LocalizableMessage.raw("Must stop the server after confirmations? "+ |
| | | userData.getStopServer())); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | logger.debug(LocalizableMessage.raw("cancelled: "+cancelled)); |
| | | logger.info(LocalizableMessage.raw("cancelled: "+cancelled)); |
| | | return cancelled; |
| | | } |
| | | |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Error closing connection: "+t, t)); |
| | | logger.info(LocalizableMessage.raw("Error closing connection: "+t, t)); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | private boolean startServer(boolean supressOutput) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("startServer, supressOutput: "+supressOutput)); |
| | | logger.info(LocalizableMessage.raw("startServer, supressOutput: "+supressOutput)); |
| | | boolean serverStarted = false; |
| | | Application application = new Application() |
| | | { |
| | |
| | | printlnProgress(); |
| | | } |
| | | serverStarted = Installation.getLocal().getStatus().isServerRunning(); |
| | | logger.debug(LocalizableMessage.raw("server started successfully. serverStarted: "+ |
| | | logger.info(LocalizableMessage.raw("server started successfully. serverStarted: "+ |
| | | serverStarted)); |
| | | } |
| | | catch (ApplicationException ae) |
| | |
| | | |
| | | LocalizableMessage exceptionMsg = null; |
| | | |
| | | logger.debug(LocalizableMessage.raw("Updating user data with remote servers.")); |
| | | logger.info(LocalizableMessage.raw("Updating user data with remote servers.")); |
| | | |
| | | InitialLdapContext ctx = null; |
| | | try |
| | |
| | | forceTrustManagerInitialization(); |
| | | updateTrustManager(userData, ci); |
| | | } |
| | | logger.debug(LocalizableMessage.raw("Reloading topology")); |
| | | logger.info(LocalizableMessage.raw("Reloading topology")); |
| | | TopologyCache cache = new TopologyCache(adsContext, |
| | | userData.getTrustManager(), getConnectTimeout()); |
| | | cache.getFilter().setSearchMonitoringInformation(false); |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Error closing connection: "+t, t)); |
| | | logger.info(LocalizableMessage.raw("Error closing connection: "+t, t)); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | userData.setUpdateRemoteReplication(accepted); |
| | | logger.debug(LocalizableMessage.raw("accepted: "+accepted)); |
| | | logger.info(LocalizableMessage.raw("accepted: "+accepted)); |
| | | return accepted; |
| | | } |
| | | |
| | |
| | | boolean reloadTopologyCache = false; |
| | | boolean interactive = parser.isInteractive(); |
| | | |
| | | logger.debug(LocalizableMessage.raw("Handle topology cache.")); |
| | | logger.info(LocalizableMessage.raw("Handle topology cache.")); |
| | | |
| | | Set<TopologyCacheException> exceptions = |
| | | new HashSet<TopologyCacheException>(); |
| | |
| | | /* Check the exceptions and see if we throw them or not. */ |
| | | for (TopologyCacheException e : exceptions) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Analyzing exception: "+e, e)); |
| | | logger.info(LocalizableMessage.raw("Analyzing exception: "+e, e)); |
| | | if (stopProcessing) |
| | | { |
| | | break; |
| | |
| | | } |
| | | else |
| | | { |
| | | logger.debug(LocalizableMessage.raw("exceptionMsgs: "+exceptionMsgs)); |
| | | logger.info(LocalizableMessage.raw("exceptionMsgs: "+exceptionMsgs)); |
| | | if (exceptionMsgs.size() > 0) |
| | | { |
| | | if (parser.isForceOnError()) |
| | |
| | | returnValue = true; |
| | | } |
| | | } |
| | | logger.debug(LocalizableMessage.raw("Return value: "+returnValue)); |
| | | logger.info(LocalizableMessage.raw("Return value: "+returnValue)); |
| | | return returnValue; |
| | | } |
| | | |
| | |
| | | // Switch off attribute type name validation in client. |
| | | AttributeTypePropertyDefinition.setCheckSchema(false); |
| | | |
| | | logger.debug(LocalizableMessage.raw("Uninstaller is created.")); |
| | | logger.info(LocalizableMessage.raw("Uninstaller is created.")); |
| | | } |
| | | /** |
| | | * {@inheritDoc} |
| | |
| | | */ |
| | | public void run() { |
| | | runStarted = true; |
| | | logger.debug(LocalizableMessage.raw("run of the Uninstaller started")); |
| | | logger.info(LocalizableMessage.raw("run of the Uninstaller started")); |
| | | |
| | | initMaps(); |
| | | PrintStream origErr = System.err; |
| | |
| | | |
| | | boolean displaySeparator = false; |
| | | |
| | | logger.debug(LocalizableMessage.raw("Update remote replication? "+ |
| | | logger.info(LocalizableMessage.raw("Update remote replication? "+ |
| | | getUninstallUserData().getUpdateRemoteReplication())); |
| | | if (getUninstallUserData().getUpdateRemoteReplication()) |
| | | { |
| | |
| | | displaySeparator = true; |
| | | } |
| | | |
| | | logger.debug(LocalizableMessage.raw("Stop server? "+getUserData().getStopServer())); |
| | | logger.info(LocalizableMessage.raw("Stop server? "+getUserData().getStopServer())); |
| | | if (getUserData().getStopServer()) { |
| | | status = UninstallProgressStep.STOPPING_SERVER; |
| | | if (displaySeparator && isVerbose()) { |
| | |
| | | } |
| | | displaySeparator = true; |
| | | } |
| | | logger.debug(LocalizableMessage.raw("Is Windows Service Enabled? "+ |
| | | logger.info(LocalizableMessage.raw("Is Windows Service Enabled? "+ |
| | | isWindowsServiceEnabled())); |
| | | if (isWindowsServiceEnabled()) { |
| | | status = UninstallProgressStep.DISABLING_WINDOWS_SERVICE; |
| | |
| | | !equalsOrDescendant(file, parent); |
| | | } |
| | | |
| | | logger.debug(LocalizableMessage.raw("accept for :"+file+" is: "+accept)); |
| | | logger.info(LocalizableMessage.raw("accept for :"+file+" is: "+accept)); |
| | | return accept; |
| | | } |
| | | } |
| | |
| | | { |
| | | public TopologyCache processBackgroundTask() throws Throwable |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Loading Topology Cache in askForAuthentication")); |
| | | logger.info(LocalizableMessage.raw("Loading Topology Cache in askForAuthentication")); |
| | | ADSContext adsContext = new ADSContext(ctx); |
| | | TopologyCache cache = new TopologyCache(adsContext, |
| | | getTrustManager(), getConnectTimeout()); |
| | |
| | | getThrowableMsg(INFO_BUG_MSG.get(), throwable), |
| | | INFO_ERROR_TITLE.get()); |
| | | } |
| | | logger.debug(LocalizableMessage.raw("Error was displayed")); |
| | | logger.info(LocalizableMessage.raw("Error was displayed")); |
| | | } |
| | | else |
| | | { |
| | |
| | | */ |
| | | private void handleTopologyCache(QuickSetup qs, TopologyCache cache) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Handling TopologyCache")); |
| | | logger.info(LocalizableMessage.raw("Handling TopologyCache")); |
| | | boolean stopProcessing = false; |
| | | Set<TopologyCacheException> exceptions = |
| | | new HashSet<TopologyCacheException>(); |
| | |
| | | /* Check the exceptions and see if we throw them or not. */ |
| | | for (TopologyCacheException e : exceptions) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Analyzing exception: "+e, e)); |
| | | logger.info(LocalizableMessage.raw("Analyzing exception: "+e, e)); |
| | | if (stopProcessing) |
| | | { |
| | | break; |
| | |
| | | { |
| | | cause = e.getTrustManager().getLastRefusedCause(); |
| | | } |
| | | logger.debug(LocalizableMessage.raw("Certificate exception cause: "+cause)); |
| | | logger.info(LocalizableMessage.raw("Certificate exception cause: "+cause)); |
| | | if (cause == ApplicationTrustManager.Cause.NOT_TRUSTED) |
| | | { |
| | | excType = UserDataCertificateException.Type.NOT_TRUSTED; |
| | |
| | | |
| | | if ((chain != null) && (authType != null) && (host != null)) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Accepting certificate presented by host "+host)); |
| | | logger.info(LocalizableMessage.raw("Accepting certificate presented by host "+host)); |
| | | getTrustManager().acceptCertificate(chain, authType, host); |
| | | BackgroundTask<TopologyCache> worker = |
| | | new BackgroundTask<TopologyCache>() |
| | | { |
| | | public TopologyCache processBackgroundTask() throws Throwable |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Reloading topology")); |
| | | logger.info(LocalizableMessage.raw("Reloading topology")); |
| | | cache.getFilter().setSearchMonitoringInformation(false); |
| | | cache.reloadTopology(); |
| | | return cache; |
| | |
| | | |
| | | if (!hasReferences) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("No references in: "+ server.getHostPort(true))); |
| | | logger.info(LocalizableMessage.raw("No references in: "+ server.getHostPort(true))); |
| | | } |
| | | if (hasReferences) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Updating references in: "+ server.getHostPort(true))); |
| | | logger.info(LocalizableMessage.raw("Updating references in: "+ server.getHostPort(true))); |
| | | notifyListeners(getFormattedWithPoints( |
| | | INFO_PROGRESS_REMOVING_REFERENCES.get(server.getHostPort(true)))); |
| | | InitialLdapContext ctx = null; |
| | |
| | | catch (ApplicationException ae) |
| | | { |
| | | errorOnRemoteOccurred = true; |
| | | logger.debug(LocalizableMessage.raw("Error updating replication references in: "+ |
| | | logger.info(LocalizableMessage.raw("Error updating replication references in: "+ |
| | | server.getHostPort(true), ae)); |
| | | |
| | | if (!getUninstallUserData().isForceOnError()) |
| | |
| | | } |
| | | if (replServer != null) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Updating references in replication server on "+ |
| | | logger.info(LocalizableMessage.raw("Updating references in replication server on "+ |
| | | serverDisplay+".")); |
| | | replServers.remove(replServer); |
| | | if (replServers.size() > 0) |
| | |
| | | } |
| | | if (replServer != null) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Updating references in domain " + |
| | | logger.info(LocalizableMessage.raw("Updating references in domain " + |
| | | domain.getBaseDN()+" on " + serverDisplay + ".")); |
| | | replServers.remove(replServer); |
| | | if (replServers.size() > 0) |
| | |
| | | catch (ManagedObjectNotFoundException monfe) |
| | | { |
| | | // It does not exist. |
| | | logger.debug(LocalizableMessage.raw("No synchronization found on "+ serverDisplay+".", |
| | | logger.info(LocalizableMessage.raw("No synchronization found on "+ serverDisplay+".", |
| | | monfe)); |
| | | } |
| | | catch (Throwable t) |
| | |
| | | { |
| | | if (adsContext.hasAdminData() && (serverADSProperties != null)) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Unregistering server on ADS of server "+ |
| | | logger.info(LocalizableMessage.raw("Unregistering server on ADS of server "+ |
| | | ConnectionUtils.getHostPort(ctx)+". Properties: "+ |
| | | serverADSProperties)); |
| | | adsContext.unregisterServer(serverADSProperties); |
| | |
| | | try { |
| | | outsideDbs = config.getOutsideDbs(); |
| | | } catch (IOException ioe) { |
| | | logger.debug(LocalizableMessage.raw("Unable to determin outside databases", ioe)); |
| | | logger.info(LocalizableMessage.raw("Unable to determin outside databases", ioe)); |
| | | } |
| | | |
| | | try { |
| | | outsideLogs = config.getOutsideLogs(); |
| | | } catch (IOException ioe) { |
| | | logger.debug(LocalizableMessage.raw("Unable to determin outside logs", ioe)); |
| | | logger.info(LocalizableMessage.raw("Unable to determin outside logs", ioe)); |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | if (throwable != null) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Error connecting: " + throwable, throwable)); |
| | | logger.info(LocalizableMessage.raw("Error connecting: " + throwable, throwable)); |
| | | if (Utils.isCertificateException(throwable)) |
| | | { |
| | | ApplicationTrustManager.Cause cause = |
| | | trustManager.getLastRefusedCause(); |
| | | |
| | | logger.debug(LocalizableMessage.raw("Certificate exception cause: "+cause)); |
| | | logger.info(LocalizableMessage.raw("Certificate exception cause: "+cause)); |
| | | UserDataCertificateException.Type excType = null; |
| | | if (cause == ApplicationTrustManager.Cause.NOT_TRUSTED) |
| | | { |
| | |
| | | |
| | | if ((chain != null) && (authType != null) && (host != null)) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Accepting certificate presented by host "+host)); |
| | | logger.info(LocalizableMessage.raw("Accepting certificate presented by host "+host)); |
| | | getTrustManager().acceptCertificate(chain, authType, host); |
| | | /* Simulate a click on the OK by calling in the okClicked method. */ |
| | | SwingUtilities.invokeLater(new Runnable() |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.messages; |
| | |
| | | /** |
| | | * The severity that will be used for informational messages. |
| | | */ |
| | | INFORMATION(0x00000000, "INFO", "INFO"), |
| | | INFORMATION("INFO", "INFO"), |
| | | |
| | | /** |
| | | * The severity that will be used for mild warning messages. |
| | | */ |
| | | MILD_WARNING(0x00010000, "MILD_WARN", "WARN"), |
| | | MILD_WARNING("MILD_WARN", "WARN"), |
| | | |
| | | /** |
| | | * The severity that will be used for severe warning messages. |
| | | */ |
| | | SEVERE_WARNING(0x00020000, "SEVERE_WARN", "WARN"), |
| | | SEVERE_WARNING("SEVERE_WARN", "WARN"), |
| | | |
| | | /** |
| | | * The severity that will be used for mild error messages. |
| | | */ |
| | | MILD_ERROR(0x00030000, "MILD_ERR", "ERR"), |
| | | MILD_ERROR("MILD_ERR", "ERR"), |
| | | |
| | | /** |
| | | * The severity that will be used for severe error messages. |
| | | */ |
| | | SEVERE_ERROR(0x00040000, "SEVERE_ERR", "ERR"), |
| | | SEVERE_ERROR("SEVERE_ERR", "ERR"), |
| | | |
| | | /** |
| | | * The severity that will be used for fatal error messages. |
| | | */ |
| | | FATAL_ERROR(0x00050000, "FATAL_ERR", "ERR"), |
| | | FATAL_ERROR("FATAL_ERR", "ERR"), |
| | | |
| | | /** |
| | | * The severity that will be used for debug messages. |
| | | */ |
| | | DEBUG(0x00060000, "DEBUG", "DEBUG"), |
| | | DEBUG("DEBUG", "DEBUG"), |
| | | |
| | | /** |
| | | * The severity that will be used for important informational |
| | | * messages. |
| | | */ |
| | | NOTICE(0x00070000, "NOTICE", "NOTE"); |
| | | NOTICE("NOTICE", "NOTE"); |
| | | |
| | | static private Set<String> PROPERTY_KEY_FORM_VALUES_SET; |
| | | |
| | | static private Map<String,Severity> PROPERTY_KEY_FORM_MAP; |
| | | |
| | | static private Map<Integer,Severity> MASK_VALUE_MAP; |
| | | |
| | | static { |
| | | MASK_VALUE_MAP = new HashMap<Integer,Severity>(); |
| | | for (Severity c : EnumSet.allOf(Severity.class)) { |
| | | MASK_VALUE_MAP.put(c.mask, c); |
| | | } |
| | | } |
| | | |
| | | static { |
| | | PROPERTY_KEY_FORM_MAP = new HashMap<String,Severity>(); |
| | | PROPERTY_KEY_FORM_VALUES_SET = new HashSet<String>(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * Obtains the <code>Severity</code> associated with a given mask |
| | | * value. |
| | | * @param mask for which a <code>Severity</code> is obtained. |
| | | * @return Severity associated with <code>mask</code> |
| | | */ |
| | | static public Severity parseMask(int mask) { |
| | | Severity sev = MASK_VALUE_MAP.get(mask); |
| | | if (sev == null) { |
| | | throw new IllegalArgumentException( |
| | | "No Severity defined with int value " + mask); |
| | | } |
| | | return sev; |
| | | } |
| | | |
| | | /** |
| | | * Returns the <code>Severity</code> associated with the input |
| | | * string <code>s</code> which can either be a severity's name |
| | | * or messageDescriptorForm. |
| | |
| | | return sev; |
| | | } |
| | | |
| | | /** |
| | | * Obtains the <code>Severity</code> associated with the the input |
| | | * message ID <code>msgId</code>. |
| | | * @param msgId int message ID |
| | | * @return Severity assocated with the ID |
| | | */ |
| | | static public Severity parseMessageId(int msgId) { |
| | | return parseMask(msgId & 0x000F0000); |
| | | } |
| | | |
| | | private final int mask; |
| | | private final String propertyKeyForm; |
| | | private final String messageDescriptorForm; |
| | | |
| | | /** |
| | | * Returns the mask associated with this <code>Severity</code>. |
| | | * @return mask for this severity |
| | | */ |
| | | public int getMask() { |
| | | return mask; |
| | | } |
| | | |
| | | /** |
| | | * Gets the abbreviated form of this <code>Severity</code>. |
| | | * @return String abbreviated form |
| | | */ |
| | |
| | | return propertyKeyForm; |
| | | } |
| | | |
| | | private Severity(int mask, String propertyKeyForm, |
| | | String messageDescriptorName) { |
| | | this.mask = mask; |
| | | private Severity(String propertyKeyForm, String messageDescriptorName) { |
| | | this.propertyKeyForm = propertyKeyForm; |
| | | this.messageDescriptorForm = messageDescriptorName; |
| | | } |
| | |
| | | appClass = Class.forName(appClassName); |
| | | app = (GuiApplication) appClass.newInstance(); |
| | | } catch (ClassNotFoundException e) { |
| | | logger.debug(LocalizableMessage.raw("error creating quicksetup application", e)); |
| | | logger.info(LocalizableMessage.raw("error creating quicksetup application", e)); |
| | | String msg = "Application class " + appClass + " not found"; |
| | | throw new RuntimeException(msg, e); |
| | | } catch (IllegalAccessException e) { |
| | | logger.debug(LocalizableMessage.raw("error creating quicksetup application", e)); |
| | | logger.info(LocalizableMessage.raw("error creating quicksetup application", e)); |
| | | String msg = "Could not access class " + appClass; |
| | | throw new RuntimeException(msg, e); |
| | | } catch (InstantiationException e) { |
| | | logger.debug(LocalizableMessage.raw("error creating quicksetup application", e)); |
| | | logger.info(LocalizableMessage.raw("error creating quicksetup application", e)); |
| | | String msg = "Error instantiating class " + appClass; |
| | | throw new RuntimeException(msg, e); |
| | | } catch (ClassCastException e) { |
| | |
| | | |
| | | notifyListeners(mb.toMessage()); |
| | | applicationPrintStreamReceived(msg); |
| | | logger.debug(LocalizableMessage.raw(msg)); |
| | | logger.info(LocalizableMessage.raw(msg)); |
| | | isFirstLine = false; |
| | | } |
| | | |
| | |
| | | port = Installation.getLocal().getCurrentConfiguration(). |
| | | getPort(); |
| | | } catch (IOException ioe) { |
| | | logger.debug(LocalizableMessage.raw("Failed to get port", ioe)); |
| | | logger.info(LocalizableMessage.raw("Failed to get port", ioe)); |
| | | } |
| | | return port; |
| | | } |
| | |
| | | |
| | | /** Relative path to bootstrap OpenDJ jar file. */ |
| | | public static final String OPENDJ_BOOTSTRAP_JAR_RELATIVE_PATH = |
| | | "lib/bootstrap.jar"; |
| | | "lib/bootstrap-client.jar"; |
| | | |
| | | /** |
| | | * The relative path where all the Windows binaries (batch files) are. |
| | |
| | | try |
| | | { |
| | | BuildInformation bi = getBuildInformation(); |
| | | logger.debug(LocalizableMessage.raw("build info for " + rootDirectory.getName() + ": " |
| | | logger.info(LocalizableMessage.raw("build info for " + rootDirectory.getName() + ": " |
| | | + bi)); |
| | | } |
| | | catch (ApplicationException e) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("error determining build information", e)); |
| | | logger.info(LocalizableMessage.raw("error determining build information", e)); |
| | | } |
| | | } |
| | | } |
| | |
| | | try |
| | | { |
| | | BuildInformation bi = getBuildInformation(); |
| | | logger.debug(LocalizableMessage.raw("build info for " + instanceDirectory.getName() |
| | | logger.info(LocalizableMessage.raw("build info for " + instanceDirectory.getName() |
| | | + ": " + bi)); |
| | | } |
| | | catch (ApplicationException e) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("error determining build information", e)); |
| | | logger.info(LocalizableMessage.raw("error determining build information", e)); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (InterruptedException e) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("interrupted trying to get build information", e)); |
| | | logger.info(LocalizableMessage.raw("interrupted trying to get build information", e)); |
| | | } |
| | | catch (ExecutionException e) |
| | | { |
| | |
| | | }); |
| | | } |
| | | Thread appThread = new Thread(cliApp, "CLI Application"); |
| | | logger.debug(LocalizableMessage.raw("Launching application")); |
| | | logger.info(LocalizableMessage.raw("Launching application")); |
| | | appThread.start(); |
| | | while (!Thread.State.TERMINATED.equals(appThread.getState())) { |
| | | try { |
| | |
| | | } |
| | | } |
| | | returnValue = cliApp.getReturnCode(); |
| | | logger.debug(LocalizableMessage.raw("Application returnValue: "+returnValue)); |
| | | logger.info(LocalizableMessage.raw("Application returnValue: "+returnValue)); |
| | | if (returnValue == null) { |
| | | ApplicationException ue = cliApp.getRunError(); |
| | | if (ue != null) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Application run error: "+ue, ue)); |
| | | logger.info(LocalizableMessage.raw("Application run error: "+ue, ue)); |
| | | returnValue = ue.getType(); |
| | | } |
| | | else |
| | |
| | | logger.error(LocalizableMessage.raw("Unexpected error: "+t, t)); |
| | | returnValue = ReturnCode.UNKNOWN; |
| | | } |
| | | logger.debug(LocalizableMessage.raw("returnValue: "+returnValue.getReturnCode())); |
| | | logger.info(LocalizableMessage.raw("returnValue: "+returnValue.getReturnCode())); |
| | | return returnValue; |
| | | } |
| | | |
| | |
| | | import java.io.IOException; |
| | | import java.util.logging.FileHandler; |
| | | import java.util.logging.Logger; |
| | | import java.util.logging.SimpleFormatter; |
| | | |
| | | import java.util.Date; |
| | | import java.text.DateFormat; |
| | | |
| | | import org.opends.server.loggers.JdkLoggingFormater; |
| | | |
| | | /** |
| | | * Utilities for setting up QuickSetup application log. |
| | | */ |
| | |
| | | if (!isInitialized()) { |
| | | logFile = file; |
| | | fileHandler = new FileHandler(logFile.getCanonicalPath()); |
| | | fileHandler.setFormatter(new SimpleFormatter()); |
| | | fileHandler.setFormatter(new JdkLoggingFormater()); |
| | | Logger logger = Logger.getLogger("org.opends"); |
| | | logger.addHandler(fileHandler); |
| | | disableConsoleLogging(); |
| | |
| | | try { |
| | | new InstallerHelper().disableWindowsService(); |
| | | } catch (ApplicationException ae) { |
| | | logger.debug(LocalizableMessage.raw("Error disabling Windows service", ae)); |
| | | logger.info(LocalizableMessage.raw("Error disabling Windows service", ae)); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | nextPassword = "-w".equals(s); |
| | | } |
| | | logger.debug(LocalizableMessage.raw("configure DS cmd: "+cmd)); |
| | | logger.info(LocalizableMessage.raw("configure DS cmd: "+cmd)); |
| | | final InstallerHelper helper = new InstallerHelper(); |
| | | setNotifyListeners(false); |
| | | InvokeThread thread = new InvokeThread() |
| | |
| | | { |
| | | try |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Calling initializeSuffix with base DN: "+dn)); |
| | | logger.debug(LocalizableMessage.raw("Try number: "+(6 - nTries))); |
| | | logger.debug(LocalizableMessage.raw("replicationId of source replica: "+ |
| | | logger.info(LocalizableMessage.raw("Calling initializeSuffix with base DN: "+dn)); |
| | | logger.info(LocalizableMessage.raw("Try number: "+(6 - nTries))); |
| | | logger.info(LocalizableMessage.raw("replicationId of source replica: "+ |
| | | replicationId)); |
| | | initializeSuffix(ctx, replicationId, dn, !isADS && !isSchema, |
| | | hostPort); |
| | |
| | | } |
| | | catch (PeerNotFoundException pnfe) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Peer could not be found")); |
| | | logger.info(LocalizableMessage.raw("Peer could not be found")); |
| | | if (nTries == 1) |
| | | { |
| | | throw new ApplicationException( |
| | |
| | | { |
| | | cause = e.getTrustManager().getLastRefusedCause(); |
| | | } |
| | | logger.debug(LocalizableMessage.raw("Certificate exception cause: "+cause)); |
| | | logger.info(LocalizableMessage.raw("Certificate exception cause: "+cause)); |
| | | if (cause == ApplicationTrustManager.Cause.NOT_TRUSTED) |
| | | { |
| | | excType = UserDataCertificateException.Type.NOT_TRUSTED; |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Error connecting to remote server.", t)); |
| | | logger.info(LocalizableMessage.raw("Error connecting to remote server.", t)); |
| | | if (isCertificateException(t)) |
| | | { |
| | | UserDataCertificateException.Type excType; |
| | | ApplicationTrustManager.Cause cause = |
| | | trustManager.getLastRefusedCause(); |
| | | logger.debug(LocalizableMessage.raw("Certificate exception cause: "+cause)); |
| | | logger.info(LocalizableMessage.raw("Certificate exception cause: "+cause)); |
| | | if (cause == ApplicationTrustManager.Cause.NOT_TRUSTED) |
| | | { |
| | | excType = UserDataCertificateException.Type.NOT_TRUSTED; |
| | |
| | | { |
| | | DirContext dirCtx = ctx.createSubcontext(dn, attrs); |
| | | taskCreated = true; |
| | | logger.debug(LocalizableMessage.raw("created task entry: "+attrs)); |
| | | logger.info(LocalizableMessage.raw("created task entry: "+attrs)); |
| | | dirCtx.close(); |
| | | } |
| | | catch (NameAlreadyBoundException x) |
| | |
| | | if (((currentTime - minRefreshPeriod) > lastTimeMsgLogged)) |
| | | { |
| | | lastTimeMsgLogged = currentTime; |
| | | logger.debug(LocalizableMessage.raw("Progress msg: "+msg)); |
| | | logger.info(LocalizableMessage.raw("Progress msg: "+msg)); |
| | | } |
| | | if (displayProgress) |
| | | { |
| | |
| | | { |
| | | if (!logMsg.equals(lastLogMsg)) |
| | | { |
| | | logger.debug(LocalizableMessage.raw(logMsg)); |
| | | logger.info(LocalizableMessage.raw(logMsg)); |
| | | lastLogMsg = logMsg; |
| | | } |
| | | } |
| | |
| | | { |
| | | isOver = true; |
| | | LocalizableMessage errorMsg; |
| | | logger.debug(LocalizableMessage.raw("Last task entry: "+sr)); |
| | | logger.info(LocalizableMessage.raw("Last task entry: "+sr)); |
| | | if (displayProgress && (msg != null) && !msg.equals(lastDisplayedMsg)) |
| | | { |
| | | notifyListeners(getFormattedProgress(msg)); |
| | |
| | | } |
| | | else if (displayProgress) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Initialization completed successfully.")); |
| | | logger.info(LocalizableMessage.raw("Initialization completed successfully.")); |
| | | notifyListeners(getFormattedProgress( |
| | | INFO_SUFFIX_INITIALIZED_SUCCESSFULLY.get())); |
| | | notifyListeners(getLineBreak()); |
| | |
| | | catch (NameNotFoundException x) |
| | | { |
| | | isOver = true; |
| | | logger.debug(LocalizableMessage.raw("Initialization entry not found.")); |
| | | logger.info(LocalizableMessage.raw("Initialization entry not found.")); |
| | | if (displayProgress) |
| | | { |
| | | notifyListeners(getFormattedProgress( |
| | |
| | | { |
| | | DirContext dirCtx = ctx.createSubcontext(dn, attrs); |
| | | taskCreated = true; |
| | | logger.debug(LocalizableMessage.raw("created task entry: "+attrs)); |
| | | logger.info(LocalizableMessage.raw("created task entry: "+attrs)); |
| | | dirCtx.close(); |
| | | } |
| | | catch (NameAlreadyBoundException x) |
| | |
| | | { |
| | | if (!logMsg.equals(lastLogMsg)) |
| | | { |
| | | logger.debug(LocalizableMessage.raw(logMsg)); |
| | | logger.info(LocalizableMessage.raw(logMsg)); |
| | | lastLogMsg = logMsg; |
| | | } |
| | | } |
| | |
| | | |
| | | String[] allArgs = new String[argList.size()]; |
| | | argList.toArray(allArgs); |
| | | logger.debug(LocalizableMessage.raw("import-ldif arg list: "+argList)); |
| | | logger.info(LocalizableMessage.raw("import-ldif arg list: "+argList)); |
| | | ProcessBuilder pb = new ProcessBuilder(allArgs); |
| | | Map<String, String> env = pb.environment(); |
| | | env.remove(SetupUtils.OPENDJ_JAVA_HOME); |
| | |
| | | @Override |
| | | public void processLine(String line) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("import-ldif out log: "+line)); |
| | | logger.info(LocalizableMessage.raw("import-ldif out log: "+line)); |
| | | application.notifyListeners(LocalizableMessage.raw(line)); |
| | | application.notifyListeners(application.getLineBreak()); |
| | | } |
| | |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | } |
| | | } catch (Throwable t) { |
| | | logger.debug(LocalizableMessage.raw("error stopping server", t)); |
| | | logger.info(LocalizableMessage.raw("error stopping server", t)); |
| | | } |
| | | } |
| | | notifyListeners(getLineBreak()); |
| | |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | } |
| | | } catch (Throwable t2) { |
| | | logger.debug(LocalizableMessage.raw("error stopping server", t2)); |
| | | logger.info(LocalizableMessage.raw("error stopping server", t2)); |
| | | } |
| | | } |
| | | notifyListeners(getLineBreak()); |
| | |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | } |
| | | } catch (ApplicationException e) { |
| | | logger.debug(LocalizableMessage.raw("error stopping server", e)); |
| | | logger.info(LocalizableMessage.raw("error stopping server", e)); |
| | | } |
| | | } |
| | | |
| | |
| | | fm.rename(newConfig, installation.getCurrentConfigurationFile()); |
| | | |
| | | } catch (ApplicationException ae) { |
| | | logger.debug(LocalizableMessage.raw("failed to restore base configuration", ae)); |
| | | logger.info(LocalizableMessage.raw("failed to restore base configuration", ae)); |
| | | } |
| | | |
| | | // Cleanup SSL if necessary |
| | |
| | | try { |
| | | cm.removeCertificate(SELF_SIGNED_CERT_ALIAS); |
| | | } catch (KeyStoreException e) { |
| | | logger.debug(LocalizableMessage.raw("Error deleting self signed certification", e)); |
| | | logger.info(LocalizableMessage.raw("Error deleting self signed certification", e)); |
| | | } |
| | | } |
| | | |
| | |
| | | try { |
| | | fm.delete(keystore); |
| | | } catch (ApplicationException e) { |
| | | logger.debug(LocalizableMessage.raw("Failed to delete keystore", e)); |
| | | logger.info(LocalizableMessage.raw("Failed to delete keystore", e)); |
| | | } |
| | | } |
| | | |
| | |
| | | try { |
| | | fm.delete(keystorePin); |
| | | } catch (ApplicationException e) { |
| | | logger.debug(LocalizableMessage.raw("Failed to delete keystore.pin", e)); |
| | | logger.info(LocalizableMessage.raw("Failed to delete keystore.pin", e)); |
| | | } |
| | | } |
| | | |
| | |
| | | try { |
| | | fm.delete(truststore); |
| | | } catch (ApplicationException e) { |
| | | logger.debug(LocalizableMessage.raw("Failed to delete truststore", e)); |
| | | logger.info(LocalizableMessage.raw("Failed to delete truststore", e)); |
| | | } |
| | | } |
| | | } |
| | |
| | | try { |
| | | fm.deleteChildren(installation.getDatabasesDirectory()); |
| | | } catch (ApplicationException e) { |
| | | logger.debug(LocalizableMessage.raw("Error deleting databases", e)); |
| | | logger.info(LocalizableMessage.raw("Error deleting databases", e)); |
| | | } |
| | | |
| | | if (!isVerbose()) |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Error closing zip input stream: "+t, t)); |
| | | logger.info(LocalizableMessage.raw("Error closing zip input stream: "+t, t)); |
| | | } |
| | | |
| | | checkAbort(); |
| | |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | } |
| | | } catch (Throwable t) { |
| | | logger.debug(LocalizableMessage.raw("error stopping server", t)); |
| | | logger.info(LocalizableMessage.raw("error stopping server", t)); |
| | | } |
| | | } |
| | | notifyListeners(getLineBreak()); |
| | |
| | | try { |
| | | new ServerController(installation).stopServer(true); |
| | | } catch (Throwable t2) { |
| | | logger.debug(LocalizableMessage.raw("error stopping server", t2)); |
| | | logger.info(LocalizableMessage.raw("error stopping server", t2)); |
| | | } |
| | | } |
| | | notifyListeners(getLineBreak()); |
| | |
| | | try { |
| | | new ServerController(installation).stopServer(true); |
| | | } catch (ApplicationException e) { |
| | | logger.debug(LocalizableMessage.raw("error stopping server", e)); |
| | | logger.info(LocalizableMessage.raw("error stopping server", e)); |
| | | } |
| | | } |
| | | |
| | |
| | | fm.deleteRecursively(installation.getRootDirectory(), null, |
| | | FileManager.DeletionPolicy.DELETE_ON_EXIT_IF_UNSUCCESSFUL); |
| | | } catch (ApplicationException e) { |
| | | logger.debug(LocalizableMessage.raw("error deleting files", e)); |
| | | logger.info(LocalizableMessage.raw("error deleting files", e)); |
| | | } |
| | | } |
| | | else |
| | |
| | | fm.deleteRecursively(serverRoot, null, |
| | | FileManager.DeletionPolicy.DELETE_ON_EXIT_IF_UNSUCCESSFUL); |
| | | } catch (ApplicationException e) { |
| | | logger.debug(LocalizableMessage.raw("error deleting files", e)); |
| | | logger.info(LocalizableMessage.raw("error deleting files", e)); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | if ((chain != null) && (authType != null) && (host != null)) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Accepting certificate presented by host "+host)); |
| | | logger.info(LocalizableMessage.raw("Accepting certificate presented by host "+host)); |
| | | getTrustManager().acceptCertificate(chain, authType, host); |
| | | } |
| | | else |
| | |
| | | */ |
| | | public void quit() |
| | | { |
| | | logger.debug(LocalizableMessage.raw("quitting application")); |
| | | logger.info(LocalizableMessage.raw("quitting application")); |
| | | flushLogs(); |
| | | System.exit(0); |
| | | } |
| | |
| | | if (button != null) { |
| | | button.requestFocusInWindow(); |
| | | } else { |
| | | logger.debug(LocalizableMessage.raw("Focus requested for unknown button '" + |
| | | logger.info(LocalizableMessage.raw("Focus requested for unknown button '" + |
| | | buttonName + "'")); |
| | | } |
| | | } |
| | |
| | | application.notifyListeners(application.getFormattedWarning( |
| | | INFO_FILE_DOES_NOT_EXIST.get(file))); |
| | | } |
| | | logger.debug(LocalizableMessage.raw("file '" + file + "' does not exist")); |
| | | logger.info(LocalizableMessage.raw("file '" + file + "' does not exist")); |
| | | } |
| | | } |
| | | |
| | |
| | | objectFile.getAbsolutePath(), |
| | | destination.getAbsolutePath()))); |
| | | } |
| | | logger.debug(LocalizableMessage.raw("copying file '" + |
| | | logger.info(LocalizableMessage.raw("copying file '" + |
| | | objectFile.getAbsolutePath() + "' to '" + |
| | | destination.getAbsolutePath() + "'")); |
| | | FileInputStream fis = null; |
| | |
| | | errMsg, null); |
| | | } |
| | | } else { |
| | | logger.debug(LocalizableMessage.raw("Ignoring file '" + |
| | | logger.info(LocalizableMessage.raw("Ignoring file '" + |
| | | objectFile.getAbsolutePath() + "' since '" + |
| | | destination.getAbsolutePath() + "' already exists")); |
| | | if ((application != null) && application.isVerbose()) { |
| | |
| | | file.getAbsolutePath()))); |
| | | } |
| | | } |
| | | logger.debug(LocalizableMessage.raw("deleting " + |
| | | logger.info(LocalizableMessage.raw("deleting " + |
| | | (isFile ? " file " : " directory ") + |
| | | file.getAbsolutePath())); |
| | | |
| | |
| | | processLine(line); |
| | | } |
| | | } catch (Throwable t) { |
| | | logger.debug(LocalizableMessage.raw("error reading output"), t); |
| | | logger.info(LocalizableMessage.raw("error reading output"), t); |
| | | } |
| | | } |
| | | }); |
| | |
| | | mb.append(application.getLineBreak()); |
| | | application.notifyListeners(mb.toMessage()); |
| | | } |
| | | logger.debug(LocalizableMessage.raw("stopping server")); |
| | | logger.info(LocalizableMessage.raw("stopping server")); |
| | | |
| | | ArrayList<String> argList = new ArrayList<String>(); |
| | | argList.add(Utils.getScriptPath( |
| | |
| | | env.remove(SetupUtils.OPENDJ_JAVA_ARGS); |
| | | env.remove("CLASSPATH"); |
| | | |
| | | logger.debug(LocalizableMessage.raw("Before calling stop-ds. Is server running? "+ |
| | | logger.info(LocalizableMessage.raw("Before calling stop-ds. Is server running? "+ |
| | | installation.getStatus().isServerRunning())); |
| | | |
| | | int stopTries = 3; |
| | | while (stopTries > 0) |
| | | { |
| | | stopTries --; |
| | | logger.debug(LocalizableMessage.raw("Launching stop command, stopTries left: "+ |
| | | logger.info(LocalizableMessage.raw("Launching stop command, stopTries left: "+ |
| | | stopTries)); |
| | | |
| | | try |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Launching stop command, argList: "+argList)); |
| | | logger.info(LocalizableMessage.raw("Launching stop command, argList: "+argList)); |
| | | Process process = pb.start(); |
| | | |
| | | BufferedReader err = |
| | |
| | | // do nothing |
| | | } |
| | | stopped = !installation.getStatus().isServerRunning(); |
| | | logger.debug(LocalizableMessage.raw( |
| | | logger.info(LocalizableMessage.raw( |
| | | "After calling stop-ds. Is server running? "+!stopped)); |
| | | |
| | | if (!stopped) { |
| | |
| | | mb.append(application.getLineBreak()); |
| | | application.notifyListeners(mb.toMessage()); |
| | | } |
| | | logger.debug(LocalizableMessage.raw("server already stopped")); |
| | | logger.info(LocalizableMessage.raw("server already stopped")); |
| | | break; |
| | | } else if (returnValue != 0) { |
| | | if (stopTries <= 0) |
| | |
| | | application.notifyListeners(application.getFormattedLog( |
| | | INFO_PROGRESS_SERVER_STOPPED.get())); |
| | | } |
| | | logger.debug(LocalizableMessage.raw("server stopped")); |
| | | logger.info(LocalizableMessage.raw("server stopped")); |
| | | break; |
| | | } |
| | | |
| | |
| | | mb.append(application.getLineBreak()); |
| | | application.notifyListeners(mb.toMessage()); |
| | | } |
| | | logger.debug(LocalizableMessage.raw("starting server")); |
| | | logger.info(LocalizableMessage.raw("starting server")); |
| | | |
| | | ArrayList<String> argList = new ArrayList<String>(); |
| | | argList.add(Utils.getScriptPath( |
| | |
| | | |
| | | int returnValue = process.waitFor(); |
| | | |
| | | logger.debug(LocalizableMessage.raw("start-ds return value: "+returnValue)); |
| | | logger.info(LocalizableMessage.raw("start-ds return value: "+returnValue)); |
| | | |
| | | if (returnValue != 0) |
| | | { |
| | |
| | | } |
| | | if (outputReader.isFinished()) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Output reader finished.")); |
| | | logger.info(LocalizableMessage.raw("Output reader finished.")); |
| | | } |
| | | if (errReader.isFinished()) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Error reader finished.")); |
| | | logger.info(LocalizableMessage.raw("Error reader finished.")); |
| | | } |
| | | if (!outputReader.startedIdFound() && !errReader.startedIdFound()) |
| | | { |
| | |
| | | application.notifyListeners(buf.toMessage()); |
| | | isFirstLine = false; |
| | | } |
| | | logger.debug(LocalizableMessage.raw("server: " + line)); |
| | | logger.info(LocalizableMessage.raw("server: " + line)); |
| | | line = reader.readLine(); |
| | | } |
| | | } catch (Throwable t) { |
| | |
| | | LocalizableMessage errorMsg = getThrowableMsg(errorTag, t); |
| | | application.notifyListeners(errorMsg); |
| | | } |
| | | logger.debug(LocalizableMessage.raw("error reading server messages",t)); |
| | | logger.info(LocalizableMessage.raw("error reading server messages",t)); |
| | | } |
| | | } |
| | | }); |
| | |
| | | application.notifyListeners(buf.toMessage()); |
| | | isFirstLine = false; |
| | | } |
| | | logger.debug(LocalizableMessage.raw("server: " + line)); |
| | | logger.info(LocalizableMessage.raw("server: " + line)); |
| | | if (line.toLowerCase().contains("=" + startedId)) |
| | | { |
| | | isFinished = true; |
| | |
| | | File f = new File(keyStorePath); |
| | | if (!f.exists()) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Path "+keyStorePath+ " does not exist")); |
| | | logger.info(LocalizableMessage.raw("Path "+keyStorePath+ " does not exist")); |
| | | keyStorePath = null; |
| | | } |
| | | else if (f.isDirectory()) |
| | |
| | | throws IOException,KeyStoreException, CertificateException, |
| | | NoSuchAlgorithmException |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Accepting certificate chain.")); |
| | | logger.info(LocalizableMessage.raw("Accepting certificate chain.")); |
| | | KeyStore k = getInstance(); |
| | | for (X509Certificate aChain : chain) { |
| | | if (!containsCertificate(aChain, k)) { |
| | |
| | | File f = new File(adminTrustStorePath); |
| | | if (!f.exists()) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Path "+adminTrustStorePath+ " does not exist")); |
| | | logger.info(LocalizableMessage.raw("Path "+adminTrustStorePath+ " does not exist")); |
| | | adminTrustStorePath = null; |
| | | } |
| | | else if (f.isDirectory()) |
| | |
| | | String installPath) |
| | | { |
| | | boolean supported = false; |
| | | logger.debug(LocalizableMessage.raw("Checking if options "+option+ |
| | | logger.info(LocalizableMessage.raw("Checking if options "+option+ |
| | | " are supported with java home: "+javaHome)); |
| | | try |
| | | { |
| | |
| | | env.put("DO_NOT_PAUSE", "true"); |
| | | } |
| | | final Process process = pb.start(); |
| | | logger.debug(LocalizableMessage.raw("launching "+args+ " with env: "+env)); |
| | | logger.info(LocalizableMessage.raw("launching "+args+ " with env: "+env)); |
| | | InputStream is = process.getInputStream(); |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(is)); |
| | | String line; |
| | | boolean errorDetected = false; |
| | | while (null != (line = reader.readLine())) { |
| | | logger.debug(LocalizableMessage.raw("The output: "+line)); |
| | | logger.info(LocalizableMessage.raw("The output: "+line)); |
| | | if (line.contains("ERROR: The detected Java version")) |
| | | { |
| | | if (Utils.isWindows()) |
| | |
| | | } |
| | | process.waitFor(); |
| | | int returnCode = process.exitValue(); |
| | | logger.debug(LocalizableMessage.raw("returnCode: "+returnCode)); |
| | | logger.info(LocalizableMessage.raw("returnCode: "+returnCode)); |
| | | supported = returnCode == 0 && !errorDetected; |
| | | logger.debug(LocalizableMessage.raw("supported: "+supported)); |
| | | logger.info(LocalizableMessage.raw("supported: "+supported)); |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | |
| | | @Override |
| | | public void println(String msg) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("EmptyStream msg: "+msg)); |
| | | logger.info(LocalizableMessage.raw("EmptyStream msg: "+msg)); |
| | | } |
| | | } |
| | |
| | | application.notifyListenersRatioChange(ratioBeforeCompleted); |
| | | } |
| | | } |
| | | logger.debug(LocalizableMessage.raw("extracting " + Utils.getPath(destination))); |
| | | logger.info(LocalizableMessage.raw("extracting " + Utils.getPath(destination))); |
| | | if (Utils.insureParentsExist(destination)) |
| | | { |
| | | if (entry.isDirectory()) |
| | |
| | | try { |
| | | // Log build information of extensions in the error log |
| | | String[] information = getBuildInformation(jarFile); |
| | | logger.error(NOTE_LOG_EXTENSION_INFORMATION, jarFile.getName(), information[1], information[2]); |
| | | logger.info(NOTE_LOG_EXTENSION_INFORMATION, jarFile.getName(), information[1], information[2]); |
| | | } catch(Exception e) { |
| | | // Do not log information for that extension |
| | | } |
| | |
| | | { |
| | | String saslMech = expr.substring(5); |
| | | if (DirectoryServer.getSASLMechanismHandler(saslMech) == null) { |
| | | logger.error(NOTE_ACI_SYNTAX_DUBIOUS_AUTHMETHOD_SASL_MECHANISM, saslMech); |
| | | logger.info(NOTE_ACI_SYNTAX_DUBIOUS_AUTHMETHOD_SASL_MECHANISM, saslMech); |
| | | } |
| | | return new AuthMethod(EnumAuthMethod.AUTHMETHOD_SASL, saslMech, type); |
| | | } |
| | |
| | | long closeTime = (finishTime - startTime) / 1000; |
| | | LocalizableMessage msg = |
| | | NOTE_JEB_IMPORT_LDIF_ROOTCONTAINER_CLOSE.get(closeTime); |
| | | logger.error(msg); |
| | | logger.info(msg); |
| | | rootContainer = null; |
| | | } |
| | | |
| | | // Sync the environment to disk. |
| | | logger.trace(NOTE_JEB_IMPORT_CLOSING_DATABASE); |
| | | logger.info(NOTE_JEB_IMPORT_CLOSING_DATABASE); |
| | | } |
| | | catch (DatabaseException de) |
| | | { |
| | |
| | | |
| | | if(!vlvIndex.isTrusted()) |
| | | { |
| | | logger.error(NOTE_JEB_INDEX_ADD_REQUIRES_REBUILD, vlvIndex.getName()); |
| | | logger.info(NOTE_JEB_INDEX_ADD_REQUIRES_REBUILD, vlvIndex.getName()); |
| | | } |
| | | |
| | | vlvIndexMap.put(vlvIndexCfg.getName().toLowerCase(), vlvIndex); |
| | |
| | | env.removeDatabase(txn, database.getName()); |
| | | if(database instanceof Index) |
| | | { |
| | | state.removeIndexTrustState(txn, (Index)database); |
| | | state.removeIndexTrustState(txn, database); |
| | | } |
| | | transactionCommit(txn); |
| | | } |
| | |
| | | env.removeDatabase(null, database.getName()); |
| | | if(database instanceof Index) |
| | | { |
| | | state.removeIndexTrustState(null, (Index)database); |
| | | state.removeIndexTrustState(null, database); |
| | | } |
| | | } |
| | | } |
| | |
| | | state.putIndexTrustState(null, id2subtree, false); |
| | | id2subtree.open(); // No-op |
| | | |
| | | logger.error(NOTE_JEB_SUBORDINATE_INDEXES_DISABLED, cfg.getBackendId()); |
| | | logger.info(NOTE_JEB_SUBORDINATE_INDEXES_DISABLED, cfg.getBackendId()); |
| | | } |
| | | } |
| | | |
| | |
| | | id2children.open(); |
| | | if (!id2children.isTrusted()) |
| | | { |
| | | logger.error(NOTE_JEB_INDEX_ADD_REQUIRES_REBUILD, id2children.getName()); |
| | | logger.info(NOTE_JEB_INDEX_ADD_REQUIRES_REBUILD, id2children.getName()); |
| | | } |
| | | id2subtree = new Index(databasePrefix + "_" + ID2SUBTREE_DATABASE_NAME, |
| | | new ID2SIndexer(), state, config.getIndexEntryLimit(), 0, true, |
| | |
| | | id2subtree.open(); |
| | | if (!id2subtree.isTrusted()) |
| | | { |
| | | logger.error(NOTE_JEB_INDEX_ADD_REQUIRES_REBUILD, id2subtree.getName()); |
| | | logger.info(NOTE_JEB_INDEX_ADD_REQUIRES_REBUILD, id2subtree.getName()); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (oldThreadCount != threadCount) |
| | | { |
| | | logger.error(NOTE_JEB_IMPORT_ADJUST_THREAD_COUNT, oldThreadCount, threadCount); |
| | | logger.info(NOTE_JEB_IMPORT_ADJUST_THREAD_COUNT, oldThreadCount, threadCount); |
| | | } |
| | | |
| | | logger.info(NOTE_JEB_IMPORT_LDIF_TOT_MEM_BUF, availableMemory, phaseOneBufferCount); |
| | |
| | | } |
| | | if ( message != null ) |
| | | { |
| | | logger.error(message); |
| | | logger.info(message); |
| | | } |
| | | } |
| | | |
| | |
| | | return notifyOnError; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the set of messages that were logged by this task. This list |
| | | * must not be directly modified by the caller. |
| | |
| | | return Collections.unmodifiableList(msgList); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Writes a message to the error log using the provided information. |
| | | * Tasks should use this method to log messages to the error log instead of |
| | | * the one in <code>org.opends.server.loggers.Error</code> to ensure the |
| | | * messages are included in the ds-task-log-message attribute. |
| | | * |
| | | * @param message The message to be logged. |
| | | */ |
| | | protected void logError(LocalizableMessage message) |
| | | { |
| | | // Simply pass this on to the server error logger, and it will call back |
| | | // to the addLogMessage method for this task. |
| | | logger.error(message); |
| | | } |
| | | |
| | | /** |
| | | * Adds a log message to the set of messages logged by this task. This method |
| | | * should not be called directly by tasks, but rather will be called |
| | | * indirectly through the {@code ErrorLog.logError} methods. It does not |
| | | * automatically persist the updated task information to disk. |
| | | * |
| | | * @param message |
| | | * the log message. |
| | | */ |
| | | // TODO : remove this method |
| | | public void addLogMessage(LocalizableMessage message) { |
| | | addLogMessage(Severity.SEVERE_ERROR, message); |
| | | } |
| | | |
| | | /** |
| | | * Adds a log message to the set of messages logged by this task. This method |
| | | * should not be called directly by tasks, but rather will be called |
| | |
| | | identityMapper = DirectoryServer.getIdentityMapper(identityMapperDN); |
| | | serverFQDN = getFQDN(configuration); |
| | | LocalizableMessage msg= NOTE_DIGEST_MD5_SERVER_FQDN.get(serverFQDN); |
| | | logger.error(msg); |
| | | logger.info(msg); |
| | | String QOP = getQOP(configuration); |
| | | saslProps = new HashMap<String,String>(); |
| | | saslProps.put(Sasl.QOP, QOP); |
| | |
| | | identityMapper = DirectoryServer.getIdentityMapper(identityMapperDN); |
| | | serverFQDN = getFQDN(configuration); |
| | | LocalizableMessage msg = NOTE_DIGEST_MD5_SERVER_FQDN.get(serverFQDN); |
| | | logger.error(msg); |
| | | logger.info(msg); |
| | | String QOP = getQOP(configuration); |
| | | saslProps = new HashMap<String,String>(); |
| | | saslProps.put(Sasl.QOP, QOP); |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt |
| | | * or http://forgerock.org/license/CDDLv1.0.html. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at legal-notices/CDDLv1_0.txt. |
| | | * If applicable, add the following below this CDDL HEADER, with the |
| | | * fields enclosed by brackets "[]" replaced with your own identifying |
| | | * information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2014 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.loggers; |
| | | |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.logging.Formatter; |
| | | import java.util.logging.LogRecord; |
| | | |
| | | import org.opends.server.util.StaticUtils; |
| | | |
| | | /** |
| | | * A formatter to replace default format of java.util.logging loggers. |
| | | * <p> |
| | | * With JDK 7+, it is possible to pass in the format from the |
| | | * "java.util.logging.SimpleFormatter.format" parameter to the JVM. Use the |
| | | * parameter instead of this class when JDK6 is not supported any more. |
| | | */ |
| | | public class JdkLoggingFormater extends Formatter |
| | | { |
| | | |
| | | /** Use one formatter per thread as DateFormat is not thread-safe. */ |
| | | private static final ThreadLocal<DateFormat> DATE_FORMAT = |
| | | new ThreadLocal<DateFormat>() |
| | | { |
| | | @Override |
| | | protected DateFormat initialValue() |
| | | { |
| | | return new SimpleDateFormat("[dd/MM/yyyy:HH:mm:ss Z]"); |
| | | } |
| | | }; |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String format(LogRecord record) |
| | | { |
| | | StringBuilder b = new StringBuilder(); |
| | | b.append(DATE_FORMAT.get().format(new Date(record.getMillis()))); |
| | | b.append(" category=").append(LoggingCategoryNames.getCategoryName(record.getLoggerName())); |
| | | b.append(" seq=").append(record.getSequenceNumber()); |
| | | b.append(" severity=").append(record.getLevel()); |
| | | b.append(" msg=").append(record.getMessage()); |
| | | if (record.getThrown() != null) |
| | | { |
| | | b.append(" exception=").append( |
| | | StaticUtils.stackTraceToSingleLineString(record.getThrown())); |
| | | } |
| | | b.append("\n"); |
| | | return b.toString(); |
| | | } |
| | | |
| | | } |
| | |
| | | // The category used for messages associated with tools |
| | | NAMES.put("org.opends.server.tools", "TOOLS"); |
| | | |
| | | // The category used for messages associated with upgrade tool |
| | | NAMES.put("org.opends.server.tools.upgrade", "UPGRADE"); |
| | | |
| | | // The category used for messages associated with tasks |
| | | NAMES.put("org.opends.server.tasks", "TASK"); |
| | | |
| | |
| | | buf.append(" "); |
| | | |
| | | // Emit the debug level. |
| | | buf.append("TRACE "); |
| | | buf.append("trace "); |
| | | |
| | | // Emit thread info. |
| | | buf.append("thread={"); |
| | |
| | | // Should not happen as normally already called without problem in |
| | | // isConfigurationChangeAcceptable or isConfigurationAcceptable |
| | | // if we come up to this method |
| | | logger.error(NOTE_ERR_FRACTIONAL, getBaseDNString(), stackTraceToSingleLineString(e)); |
| | | logger.info(NOTE_ERR_FRACTIONAL, getBaseDNString(), stackTraceToSingleLineString(e)); |
| | | return; |
| | | } |
| | | |
| | |
| | | catch (ConfigException e) |
| | | { |
| | | // Should not happen |
| | | logger.error(NOTE_ERR_FRACTIONAL, getBaseDNString(), stackTraceToSingleLineString(e)); |
| | | logger.info(NOTE_ERR_FRACTIONAL, getBaseDNString(), stackTraceToSingleLineString(e)); |
| | | return; |
| | | } |
| | | |
| | |
| | | { |
| | | // Should not happen as configuration in domain root entry is flushed |
| | | // from valid configuration in local variables |
| | | logger.error(NOTE_ERR_FRACTIONAL, fractionalConfig.getBaseDn(), stackTraceToSingleLineString(e)); |
| | | logger.info(NOTE_ERR_FRACTIONAL, fractionalConfig.getBaseDn(), stackTraceToSingleLineString(e)); |
| | | return false; |
| | | } |
| | | |
| | |
| | | // Should not happen as configuration in domain root entry is flushed |
| | | // from valid configuration in local variables so both should have already |
| | | // been checked |
| | | logger.error(NOTE_ERR_FRACTIONAL, fractionalConfig.getBaseDn(), stackTraceToSingleLineString(e)); |
| | | logger.info(NOTE_ERR_FRACTIONAL, fractionalConfig.getBaseDn(), stackTraceToSingleLineString(e)); |
| | | return false; |
| | | } |
| | | } |
| | |
| | | } |
| | | catch(DirectoryException e) |
| | | { |
| | | logger.error(NOTE_ERR_FRACTIONAL, getBaseDNString(), stackTraceToSingleLineString(e)); |
| | | logger.info(NOTE_ERR_FRACTIONAL, getBaseDNString(), stackTraceToSingleLineString(e)); |
| | | return FRACTIONAL_HAS_NO_FRACTIONAL_FILTERED_ATTRIBUTES; |
| | | } |
| | | Set<ObjectClass> entryClasses = entryToModify.getObjectClasses().keySet(); |
| | |
| | | } catch (TimeoutException ex) |
| | | { |
| | | // This exception may only be raised if assured replication is enabled |
| | | logger.error(NOTE_DS_ACK_TIMEOUT, getBaseDNString(), getAssuredTimeout(), msg); |
| | | logger.info(NOTE_DS_ACK_TIMEOUT, getBaseDNString(), getAssuredTimeout(), msg); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | logger.error(NOTE_ERR_UNABLE_TO_ENABLE_ECL, |
| | | logger.info(NOTE_ERR_UNABLE_TO_ENABLE_ECL, |
| | | "Replication Domain on " + getBaseDNString(), stackTraceToSingleLineString(de)); |
| | | // and go on |
| | | } |
| | |
| | | // Go into bad data set status |
| | | setNewStatus(StatusMachineEvent.TO_BAD_GEN_ID_STATUS_EVENT); |
| | | broker.signalStatusChange(status); |
| | | logger.error(NOTE_FRACTIONAL_BAD_DATA_SET_NEED_RESYNC, getBaseDNString()); |
| | | logger.info(NOTE_FRACTIONAL_BAD_DATA_SET_NEED_RESYNC, getBaseDNString()); |
| | | return; // Do not send changes to the replication server |
| | | } |
| | | |
| | |
| | | getServerId(), |
| | | listenSocket.getInetAddress().getHostAddress(), |
| | | listenSocket.getLocalPort()); |
| | | logger.error(listenMsg); |
| | | logger.info(listenMsg); |
| | | |
| | | while (!shutdown && !stopListen) |
| | | { |
| | |
| | | * connection. |
| | | */ |
| | | errMessage = NOTE_READER_NULL_MSG.get(handler); |
| | | logger.error(errMessage); |
| | | logger.info(errMessage); |
| | | return; |
| | | } |
| | | } catch (NotSupportedOldVersionPDUException e) |
| | |
| | | * close the connection. |
| | | */ |
| | | errMessage = NOTE_READER_EXCEPTION.get(handler, stackTraceToSingleLineString(e)); |
| | | logger.error(errMessage); |
| | | logger.info(errMessage); |
| | | } |
| | | finally |
| | | { |
| | |
| | | evals.getEvaluation(previousRsServerID), |
| | | evals.getEvaluation(bestRsServerId)); |
| | | } |
| | | logger.error(message); |
| | | logger.info(message); |
| | | if (logger.isTraceEnabled()) |
| | | debugInfo("best replication servers evaluation results: " |
| | | + evals); |
| | |
| | | Some problems detected: message did not correctly reach every |
| | | requested servers. Log problem |
| | | */ |
| | | logger.error(NOTE_DS_RECEIVED_ACK_ERROR, getBaseDN(), getServerId(), update, ack.errorsToString()); |
| | | logger.info(NOTE_DS_RECEIVED_ACK_ERROR, getBaseDN(), getServerId(), update, ack.errorsToString()); |
| | | |
| | | List<Integer> failedServers = ack.getFailedServers(); |
| | | |
| | |
| | | |
| | | if (serverToInitialize == RoutableMsg.ALL_SERVERS) |
| | | { |
| | | logger.error(NOTE_FULL_UPDATE_ENGAGED_FOR_REMOTE_START_ALL, |
| | | logger.info(NOTE_FULL_UPDATE_ENGAGED_FOR_REMOTE_START_ALL, |
| | | countEntries(), getBaseDNString(), getServerId()); |
| | | |
| | | for (DSInfo dsi : getReplicasList()) |
| | |
| | | } |
| | | else |
| | | { |
| | | logger.error(NOTE_FULL_UPDATE_ENGAGED_FOR_REMOTE_START, countEntries(), |
| | | logger.info(NOTE_FULL_UPDATE_ENGAGED_FOR_REMOTE_START, countEntries(), |
| | | getBaseDNString(), getServerId(), serverToInitialize); |
| | | |
| | | ieCtx.startList.add(serverToInitialize); |
| | |
| | | try { Thread.sleep(1000); } |
| | | catch(Exception e){ /* do nothing */ } |
| | | |
| | | logger.error(NOTE_RESENDING_INIT_TARGET, exportRootException.getLocalizedMessage()); |
| | | logger.info(NOTE_RESENDING_INIT_TARGET, exportRootException.getLocalizedMessage()); |
| | | continue; |
| | | } |
| | | |
| | |
| | | : exportRootException.getLocalizedMessage(); |
| | | if (serverToInitialize == RoutableMsg.ALL_SERVERS) |
| | | { |
| | | logger.error(NOTE_FULL_UPDATE_ENGAGED_FOR_REMOTE_END_ALL, |
| | | logger.info(NOTE_FULL_UPDATE_ENGAGED_FOR_REMOTE_END_ALL, |
| | | getBaseDNString(), getServerId(), cause); |
| | | } |
| | | else |
| | | { |
| | | logger.error(NOTE_FULL_UPDATE_ENGAGED_FOR_REMOTE_END, |
| | | logger.info(NOTE_FULL_UPDATE_ENGAGED_FOR_REMOTE_END, |
| | | getBaseDNString(), getServerId(), serverToInitialize, cause); |
| | | } |
| | | |
| | |
| | | try |
| | | { |
| | | // Log starting |
| | | logger.error(NOTE_FULL_UPDATE_ENGAGED_FROM_REMOTE_START, getBaseDNString(), |
| | | logger.info(NOTE_FULL_UPDATE_ENGAGED_FROM_REMOTE_START, getBaseDNString(), |
| | | initTargetMsgReceived.getSenderID(), getServerId()); |
| | | |
| | | // Go into full update status |
| | |
| | | Restart the whole import protocol exchange by sending again |
| | | the request |
| | | */ |
| | | logger.error(NOTE_RESENDING_INIT_FROM_REMOTE_REQUEST, |
| | | logger.info(NOTE_RESENDING_INIT_FROM_REMOTE_REQUEST, |
| | | ieCtx.getException().getLocalizedMessage()); |
| | | |
| | | broker.publish(ieCtx.initReqMsgSent); |
| | |
| | | } catch (TimeoutException ex) |
| | | { |
| | | // This exception may only be raised if assured replication is enabled |
| | | logger.error(NOTE_DS_ACK_TIMEOUT, getBaseDNString(), getAssuredTimeout(), update); |
| | | logger.info(NOTE_DS_ACK_TIMEOUT, getBaseDNString(), getAssuredTimeout(), update); |
| | | } |
| | | } |
| | | |
| | |
| | | package org.opends.server.tasks; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.messages.Severity; |
| | | import org.opends.messages.TaskMessages; |
| | | |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | |
| | | if (TaskState.STOPPED_BY_ADMINISTRATOR.equals(interruptState) && |
| | | backupConfig != null) |
| | | { |
| | | addLogMessage(TaskMessages.INFO_TASK_STOPPED_BY_ADMIN.get( |
| | | addLogMessage(Severity.INFORMATION, TaskMessages.INFO_TASK_STOPPED_BY_ADMIN.get( |
| | | interruptReason)); |
| | | setTaskInterruptState(interruptState); |
| | | backupConfig.cancel(); |
| | |
| | | package org.opends.server.tasks; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.messages.Severity; |
| | | import org.opends.messages.TaskMessages; |
| | | |
| | | import static org.opends.server.core.DirectoryServer.getAttributeType; |
| | |
| | | import static org.opends.messages.TaskMessages.*; |
| | | import static org.opends.messages.ToolMessages.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | import org.opends.server.backends.task.Task; |
| | | import org.opends.server.backends.task.TaskState; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | if (TaskState.STOPPED_BY_ADMINISTRATOR.equals(interruptState) && |
| | | exportConfig != null) |
| | | { |
| | | addLogMessage(TaskMessages.INFO_TASK_STOPPED_BY_ADMIN.get( |
| | | addLogMessage(Severity.INFORMATION, TaskMessages.INFO_TASK_STOPPED_BY_ADMIN.get( |
| | | interruptReason)); |
| | | setTaskInterruptState(interruptState); |
| | | exportConfig.cancel(); |
| | |
| | | try |
| | | { |
| | | DirectoryServer.notifyExportBeginning(backend, exportConfig); |
| | | addLogMessage(INFO_LDIFEXPORT_PATH_TO_LDIF_FILE.get(ldifFile)); |
| | | addLogMessage(Severity.INFORMATION, INFO_LDIFEXPORT_PATH_TO_LDIF_FILE.get(ldifFile)); |
| | | backend.exportLDIF(exportConfig); |
| | | DirectoryServer.notifyExportEnded(backend, exportConfig, true); |
| | | } |
| | |
| | | */ |
| | | package org.opends.server.tasks; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.opends.messages.Severity; |
| | | import org.opends.messages.TaskMessages; |
| | | |
| | | import static org.opends.messages.TaskMessages.*; |
| | | import static org.opends.messages.ToolMessages.*; |
| | | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.tools.makeldif.TemplateFile; |
| | | |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.core.DirectoryServer.getAttributeType; |
| | |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | |
| | | |
| | | import org.opends.server.types.ExistingFileBehavior; |
| | | import org.opends.server.types.LDIFImportConfig; |
| | | import org.opends.server.types.Operation; |
| | |
| | | if (TaskState.STOPPED_BY_ADMINISTRATOR.equals(interruptState) && |
| | | importConfig != null) |
| | | { |
| | | addLogMessage(TaskMessages.INFO_TASK_STOPPED_BY_ADMIN.get( |
| | | addLogMessage(Severity.INFORMATION, TaskMessages.INFO_TASK_STOPPED_BY_ADMIN.get( |
| | | interruptReason)); |
| | | setTaskInterruptState(interruptState); |
| | | importConfig.cancel(); |
| | |
| | | */ |
| | | package org.opends.server.tasks; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.opends.messages.Severity; |
| | | import org.opends.messages.TaskMessages; |
| | | |
| | | import static org.opends.server.core.DirectoryServer.getAttributeType; |
| | |
| | | import static org.opends.messages.TaskMessages.*; |
| | | import static org.opends.messages.ToolMessages.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.backends.task.Task; |
| | | import org.opends.server.backends.task.TaskState; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | |
| | | |
| | | import org.opends.server.types.Operation; |
| | | import org.opends.server.types.Privilege; |
| | | import org.opends.server.types.RestoreConfig; |
| | |
| | | if (TaskState.STOPPED_BY_ADMINISTRATOR.equals(interruptState) && |
| | | restoreConfig != null) |
| | | { |
| | | addLogMessage(TaskMessages.INFO_TASK_STOPPED_BY_ADMIN.get( |
| | | addLogMessage(Severity.INFORMATION, TaskMessages.INFO_TASK_STOPPED_BY_ADMIN.get( |
| | | interruptReason)); |
| | | setTaskInterruptState(interruptState); |
| | | restoreConfig.cancel(); |
| | |
| | | buf.append(" "); |
| | | |
| | | // Emit the debug level. |
| | | buf.append("TRACE "); |
| | | buf.append("trace "); |
| | | |
| | | // Emit message. |
| | | buf.append(msg); |
| | |
| | | { |
| | | DirContext dirCtx = ctx.createSubcontext(dn, attrs); |
| | | taskCreated = true; |
| | | logger.debug(LocalizableMessage.raw("created task entry: "+attrs)); |
| | | logger.info(LocalizableMessage.raw("created task entry: "+attrs)); |
| | | dirCtx.close(); |
| | | } |
| | | catch (NameAlreadyBoundException ex) |
| | |
| | | { |
| | | if (!logMsg.equals(lastLogMsg)) |
| | | { |
| | | logger.debug(LocalizableMessage.raw(logMsg)); |
| | | logger.info(LocalizableMessage.raw(logMsg)); |
| | | lastLogMsg = logMsg; |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (ManagedObjectNotFoundException monfe) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Synchronization server does not exist in "+ |
| | | logger.info(LocalizableMessage.raw("Synchronization server does not exist in "+ |
| | | ConnectionUtils.getHostPort(ctx))); |
| | | } |
| | | if (sync == null) |
| | |
| | | Set<String> alreadyConfiguredReplicationServers) |
| | | throws ReplicationCliException |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Configuring base DN '"+baseDN+ |
| | | logger.info(LocalizableMessage.raw("Configuring base DN '"+baseDN+ |
| | | "' the replication servers are "+repServers)); |
| | | Set<ServerDescriptor> serversToConfigureDomain = |
| | | new HashSet<ServerDescriptor>(); |
| | |
| | | |
| | | for (ServerDescriptor s : allServers) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Configuring server "+server.getHostPort(true))); |
| | | logger.info(LocalizableMessage.raw("Configuring server "+server.getHostPort(true))); |
| | | InitialLdapContext ctx = null; |
| | | try |
| | | { |
| | |
| | | } |
| | | catch (PeerNotFoundException pnfe) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Peer could not be found")); |
| | | logger.info(LocalizableMessage.raw("Peer could not be found")); |
| | | if (nTries == 1) |
| | | { |
| | | throw new ReplicationCliException( |
| | |
| | | } |
| | | catch (PeerNotFoundException pnfe) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Peer could not be found")); |
| | | logger.info(LocalizableMessage.raw("Peer could not be found")); |
| | | if (nTries == 1) |
| | | { |
| | | throw new ReplicationCliException( |
| | |
| | | { |
| | | DirContext dirCtx = ctx.createSubcontext(dn, attrs); |
| | | taskCreated = true; |
| | | logger.debug(LocalizableMessage.raw("created task entry: "+attrs)); |
| | | logger.info(LocalizableMessage.raw("created task entry: "+attrs)); |
| | | dirCtx.close(); |
| | | } |
| | | catch (NameAlreadyBoundException x) |
| | |
| | | { |
| | | if (!logMsg.equals(lastLogMsg)) |
| | | { |
| | | logger.debug(LocalizableMessage.raw(logMsg)); |
| | | logger.info(LocalizableMessage.raw(logMsg)); |
| | | lastLogMsg = logMsg; |
| | | } |
| | | } |
| | |
| | | { |
| | | DirContext dirCtx = ctx.createSubcontext(dn, attrs); |
| | | taskCreated = true; |
| | | logger.debug(LocalizableMessage.raw("created task entry: "+attrs)); |
| | | logger.info(LocalizableMessage.raw("created task entry: "+attrs)); |
| | | dirCtx.close(); |
| | | } |
| | | catch (NameAlreadyBoundException x) |
| | |
| | | if (((currentTime - minRefreshPeriod) > lastTimeMsgLogged)) |
| | | { |
| | | lastTimeMsgLogged = currentTime; |
| | | logger.debug(LocalizableMessage.raw("Progress msg: "+msg)); |
| | | logger.info(LocalizableMessage.raw("Progress msg: "+msg)); |
| | | } |
| | | if (displayProgress) |
| | | { |
| | |
| | | { |
| | | if (!logMsg.equals(lastLogMsg)) |
| | | { |
| | | logger.debug(LocalizableMessage.raw(logMsg)); |
| | | logger.info(LocalizableMessage.raw(logMsg)); |
| | | lastLogMsg = logMsg; |
| | | } |
| | | } |
| | |
| | | { |
| | | isOver = true; |
| | | LocalizableMessage errorMsg; |
| | | logger.debug(LocalizableMessage.raw("Last task entry: "+sr)); |
| | | logger.info(LocalizableMessage.raw("Last task entry: "+sr)); |
| | | if (displayProgress && (msg != null) && !msg.equals(lastDisplayedMsg)) |
| | | { |
| | | printProgress(msg); |
| | |
| | | printProgress(INFO_SUFFIX_INITIALIZED_SUCCESSFULLY.get()); |
| | | printlnProgress(); |
| | | } |
| | | logger.debug(LocalizableMessage.raw("Processed msg: "+errorMsg)); |
| | | logger.debug(LocalizableMessage.raw("Initialization completed successfully.")); |
| | | logger.info(LocalizableMessage.raw("Processed msg: "+errorMsg)); |
| | | logger.info(LocalizableMessage.raw("Initialization completed successfully.")); |
| | | } |
| | | } |
| | | } |
| | | catch (NameNotFoundException x) |
| | | { |
| | | isOver = true; |
| | | logger.debug(LocalizableMessage.raw("Initialization entry not found.")); |
| | | logger.info(LocalizableMessage.raw("Initialization entry not found.")); |
| | | if (displayProgress) |
| | | { |
| | | printProgress(INFO_SUFFIX_INITIALIZED_SUCCESSFULLY.get()); |
| | |
| | | catch (ManagedObjectNotFoundException monfe) |
| | | { |
| | | // It does not exist. |
| | | logger.debug(LocalizableMessage.raw("No synchronization found on "+ hostPort +".", |
| | | logger.info(LocalizableMessage.raw("No synchronization found on "+ hostPort +".", |
| | | monfe)); |
| | | } |
| | | if (sync != null) |
| | |
| | | } |
| | | if (replServer != null) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Updating references in domain " + |
| | | logger.info(LocalizableMessage.raw("Updating references in domain " + |
| | | domain.getBaseDN()+" on " + hostPort + ".")); |
| | | replServers.remove(replServer); |
| | | if (replServers.size() > 0) |
| | |
| | | catch (ManagedObjectNotFoundException monfe) |
| | | { |
| | | // It does not exist. |
| | | logger.debug(LocalizableMessage.raw("No synchronization found on "+ hostPort +".", |
| | | logger.info(LocalizableMessage.raw("No synchronization found on "+ hostPort +".", |
| | | monfe)); |
| | | } |
| | | if (sync != null) |
| | |
| | | catch (ManagedObjectNotFoundException monfe) |
| | | { |
| | | // It does not exist. |
| | | logger.debug(LocalizableMessage.raw("No synchronization found on "+ hostPort +".", |
| | | logger.info(LocalizableMessage.raw("No synchronization found on "+ hostPort +".", |
| | | monfe)); |
| | | } |
| | | if (replicationServer != null) |
| | |
| | | { |
| | | if (server.isReplicationServer()) |
| | | { |
| | | logger.debug(LocalizableMessage.raw("Seeding to replication server on "+ |
| | | logger.info(LocalizableMessage.raw("Seeding to replication server on "+ |
| | | server.getHostPort(true)+" with certificates of "+ |
| | | ConnectionUtils.getHostPort(adsCtxSource.getDirContext()))); |
| | | InitialLdapContext ctx = null; |