| | |
| | | import javax.naming.ldap.InitialLdapContext; |
| | | import java.io.*; |
| | | import java.util.*; |
| | | import java.util.logging.Level; |
| | | import java.util.logging.Logger; |
| | | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | |
| | | import static org.opends.admin.ads.ServerDescriptor.*; |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | |
| | | |
| | | private boolean forceNonInteractive; |
| | | |
| | | private static final Logger LOG = |
| | | Logger.getLogger(ReplicationCliMain.class.getName()); |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // Always use SSL with the administration connector |
| | | private final boolean useSSL = true; |
| | |
| | | LocalizableMessage message = |
| | | ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage()); |
| | | println(message); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", ae); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", ae)); |
| | | returnValue = CANNOT_INITIALIZE_ARGS; |
| | | } |
| | | |
| | |
| | | println(message); |
| | | println(); |
| | | println(LocalizableMessage.raw(argParser.getUsage())); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", ae); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", ae)); |
| | | returnValue = ERROR_USER_DATA; |
| | | } |
| | | } |
| | |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | returnValue = rce.getErrorCode(); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", rce); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", rce)); |
| | | } |
| | | } |
| | | else |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error printing equivalent command-line: "+t, |
| | | t); |
| | | logger.error(LocalizableMessage.raw("Error printing equivalent command-line: "+t, |
| | | t)); |
| | | } |
| | | } |
| | | } |
| | |
| | | getServerRepresentation(uData.getHostName(), uData.getPort()); |
| | | println(); |
| | | println(getMessageForException(ne, hostPort)); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", ne); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", ne)); |
| | | } |
| | | |
| | | if (ctx != null) |
| | |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | returnValue = rce.getErrorCode(); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", rce); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", rce)); |
| | | } |
| | | } |
| | | else |
| | |
| | | { |
| | | DirContext dirCtx = ctx.createSubcontext(dn, attrs); |
| | | taskCreated = true; |
| | | LOG.log(Level.INFO, "created task entry: "+attrs); |
| | | logger.debug(LocalizableMessage.raw("created task entry: "+attrs)); |
| | | dirCtx.close(); |
| | | } |
| | | catch (NameAlreadyBoundException ex) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error creating task "+attrs, ex); |
| | | logger.error(LocalizableMessage.raw("Error creating task "+attrs, ex)); |
| | | LocalizableMessage msg = ERR_LAUNCHING_PURGE_HISTORICAL.get(); |
| | | ReplicationCliReturnCode code = ERROR_LAUNCHING_PURGE_HISTORICAL; |
| | | throw new ReplicationCliException( |
| | |
| | | } |
| | | catch (NamingException ne) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error creating task "+attrs, ne); |
| | | logger.error(LocalizableMessage.raw("Error creating task "+attrs, ne)); |
| | | LocalizableMessage msg = ERR_LAUNCHING_PURGE_HISTORICAL.get(); |
| | | ReplicationCliReturnCode code = ERROR_LAUNCHING_PURGE_HISTORICAL; |
| | | throw new ReplicationCliException( |
| | |
| | | { |
| | | if (!logMsg.equals(lastLogMsg)) |
| | | { |
| | | LOG.log(Level.INFO, logMsg); |
| | | logger.debug(LocalizableMessage.raw(logMsg)); |
| | | lastLogMsg = logMsg; |
| | | } |
| | | } |
| | |
| | | |
| | | if (helper.isCompletedWithErrors(state)) |
| | | { |
| | | LOG.log(Level.WARNING, "Completed with error: "+errorMsg); |
| | | logger.warn(LocalizableMessage.raw("Completed with error: "+errorMsg)); |
| | | println(errorMsg); |
| | | } |
| | | else if (!helper.isSuccessful(state) || |
| | | helper.isStoppedByError(state)) |
| | | { |
| | | LOG.log(Level.WARNING, "Error: "+errorMsg); |
| | | logger.warn(LocalizableMessage.raw("Error: "+errorMsg)); |
| | | ReplicationCliReturnCode code = ERROR_LAUNCHING_PURGE_HISTORICAL; |
| | | throw new ReplicationCliException(errorMsg, code, null); |
| | | } |
| | |
| | | { |
| | | if (askConfirmation( |
| | | INFO_REPLICATION_PURGE_HISTORICAL_PROMPT.get(dn), true, |
| | | LOG)) |
| | | logger)) |
| | | { |
| | | suffixes.add(dn); |
| | | } |
| | |
| | | promptForConnection = |
| | | !askConfirmation( |
| | | INFO_REPLICATION_PURGE_HISTORICAL_LOCAL_PROMPT.get(), |
| | | true, LOG); |
| | | true, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | LOG.log(Level.WARNING, "Client exception "+ce); |
| | | logger.warn(LocalizableMessage.raw("Client exception "+ce)); |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | LOG.log(Level.WARNING, "Argument exception "+ae); |
| | | logger.warn(LocalizableMessage.raw("Argument exception "+ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | |
| | | printlnProgress(); |
| | | maximumDuration = askInteger( |
| | | INFO_REPLICATION_PURGE_HISTORICAL_MAXIMUM_DURATION_PROMPT.get(), |
| | | argParser.getDefaultMaximumDuration(), LOG); |
| | | argParser.getDefaultMaximumDuration(), logger); |
| | | } |
| | | uData.setMaximumDuration(maximumDuration); |
| | | } |
| | |
| | | cfg.updateTaskInformation(ctx, exceptions, taskEntries); |
| | | for (OpenDsException ode : exceptions) |
| | | { |
| | | LOG.log(Level.WARNING, "Error retrieving task entries: "+ode, ode); |
| | | logger.warn(LocalizableMessage.raw("Error retrieving task entries: "+ode, ode)); |
| | | } |
| | | return taskEntries; |
| | | } |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | LOG.log(Level.WARNING, "Client exception "+ce); |
| | | logger.warn(LocalizableMessage.raw("Client exception "+ce)); |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | LOG.log(Level.WARNING, "Argument exception "+ae); |
| | | logger.warn(LocalizableMessage.raw("Argument exception "+ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | |
| | | { |
| | | if (!askConfirmation( |
| | | INFO_REPLICATION_SERVER_CONFIGURED_WARNING_PROMPT. |
| | | get(ConnectionUtils.getHostPort(ctx1), repPort1), false, LOG)) |
| | | get(ConnectionUtils.getHostPort(ctx1), repPort1), false, logger)) |
| | | { |
| | | cancelled = true; |
| | | } |
| | |
| | | { |
| | | configureReplicationServer1 = askConfirmation( |
| | | INFO_REPLICATION_ENABLE_REPLICATION_SERVER1_PROMPT.get(), |
| | | true, LOG); |
| | | true, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | { |
| | | replicationPort1 = askPort( |
| | | INFO_REPLICATION_ENABLE_REPLICATIONPORT1_PROMPT.get(), |
| | | argParser.getDefaultReplicationPort1(), LOG); |
| | | argParser.getDefaultReplicationPort1(), logger); |
| | | println(); |
| | | } |
| | | if (!argParser.skipReplicationPortCheck() && Utils.isLocalHost(host1)) |
| | |
| | | { |
| | | secureReplication1 = |
| | | askConfirmation(INFO_REPLICATION_ENABLE_SECURE1_PROMPT.get( |
| | | String.valueOf(replicationPort1)), false, LOG); |
| | | String.valueOf(replicationPort1)), false, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | { |
| | | configureReplicationDomain1 = askConfirmation( |
| | | INFO_REPLICATION_ENABLE_REPLICATION_DOMAIN1_PROMPT.get(), |
| | | true, LOG); |
| | | true, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | LOG.log(Level.WARNING, "Client exception "+ce); |
| | | logger.warn(LocalizableMessage.raw("Client exception "+ce)); |
| | | if (!doNotDisplayFirstError) |
| | | { |
| | | println(); |
| | |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | LOG.log(Level.WARNING, "Argument exception "+ae); |
| | | logger.warn(LocalizableMessage.raw("Argument exception "+ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | |
| | | { |
| | | if (!askConfirmation( |
| | | INFO_REPLICATION_SERVER_CONFIGURED_WARNING_PROMPT. |
| | | get(ConnectionUtils.getHostPort(ctx2), repPort2), false, LOG)) |
| | | get(ConnectionUtils.getHostPort(ctx2), repPort2), false, logger)) |
| | | { |
| | | cancelled = true; |
| | | } |
| | |
| | | { |
| | | configureReplicationServer2 = askConfirmation( |
| | | INFO_REPLICATION_ENABLE_REPLICATION_SERVER2_PROMPT.get(), |
| | | true, LOG); |
| | | true, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | { |
| | | replicationPort2 = askPort( |
| | | INFO_REPLICATION_ENABLE_REPLICATIONPORT2_PROMPT.get(), |
| | | argParser.getDefaultReplicationPort2(), LOG); |
| | | argParser.getDefaultReplicationPort2(), logger); |
| | | println(); |
| | | } |
| | | if (!argParser.skipReplicationPortCheck() && |
| | |
| | | { |
| | | secureReplication2 = |
| | | askConfirmation(INFO_REPLICATION_ENABLE_SECURE2_PROMPT.get( |
| | | String.valueOf(replicationPort2)), false, LOG); |
| | | String.valueOf(replicationPort2)), false, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | { |
| | | configureReplicationDomain2 = askConfirmation( |
| | | INFO_REPLICATION_ENABLE_REPLICATION_DOMAIN2_PROMPT.get(), |
| | | true, LOG); |
| | | true, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | println(INFO_REPLICATION_ENABLE_ADMINISTRATOR_MUST_BE_CREATED.get()); |
| | | promptedForAdmin = true; |
| | | adminUid= askForAdministratorUID( |
| | | argParser.getDefaultAdministratorUID(), LOG); |
| | | argParser.getDefaultAdministratorUID(), logger); |
| | | println(); |
| | | } |
| | | uData.setAdminUid(adminUid); |
| | |
| | | } |
| | | while (adminPwd == null) |
| | | { |
| | | adminPwd = askForAdministratorPwd(LOG); |
| | | adminPwd = askForAdministratorPwd(logger); |
| | | println(); |
| | | } |
| | | String adminPwdConfirm = null; |
| | | while (adminPwdConfirm == null) |
| | | { |
| | | adminPwdConfirm = |
| | | readPassword(INFO_ADMINISTRATOR_PWD_CONFIRM_PROMPT.get(), LOG); |
| | | readPassword(INFO_ADMINISTRATOR_PWD_CONFIRM_PROMPT.get(), logger); |
| | | println(); |
| | | } |
| | | if (!adminPwd.equals(adminPwdConfirm)) |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | LOG.log(Level.WARNING, "Client exception "+ce); |
| | | logger.warn(LocalizableMessage.raw("Client exception "+ce)); |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | LOG.log(Level.WARNING, "Argument exception "+ae); |
| | | logger.warn(LocalizableMessage.raw("Argument exception "+ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | |
| | | try |
| | | { |
| | | disableAll = askConfirmation(INFO_REPLICATION_PROMPT_DISABLE_ALL.get(), |
| | | disableAll, LOG); |
| | | disableAll, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | disableReplicationServer = askConfirmation( |
| | | INFO_REPLICATION_PROMPT_DISABLE_REPLICATION_SERVER.get(repPort), |
| | | disableReplicationServer, |
| | | LOG); |
| | | logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | INFO_REPLICATION_PROMPT_NO_REPLICATION_SERVER_TO_DISABLE.get( |
| | | ConnectionUtils.getHostPort(ctx)), |
| | | false, |
| | | LOG); |
| | | logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | { |
| | | uData.setDisableReplicationServer(askConfirmation( |
| | | INFO_REPLICATION_DISABLE_ALL_SUFFIXES_DISABLE_REPLICATION_SERVER.get( |
| | | ConnectionUtils.getHostPort(ctx), repPort), true, LOG)); |
| | | ConnectionUtils.getHostPort(ctx), repPort), true, logger)); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | try |
| | | { |
| | | cancelled = !askConfirmation(INFO_REPLICATION_CONFIRM_DISABLE_ADS.get( |
| | | ADSContext.getAdministrationSuffixDN()), true, LOG); |
| | | ADSContext.getAdministrationSuffixDN()), true, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | try |
| | | { |
| | | cancelled = !askConfirmation( |
| | | INFO_REPLICATION_CONFIRM_DISABLE_SCHEMA.get(), true, LOG); |
| | | INFO_REPLICATION_CONFIRM_DISABLE_SCHEMA.get(), true, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | { |
| | | cancelled = !askConfirmation( |
| | | INFO_REPLICATION_CONFIRM_DISABLE_GENERIC.get(), true, |
| | | LOG); |
| | | logger); |
| | | } |
| | | } |
| | | catch (CLIException ce) |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | LOG.log(Level.WARNING, "Client exception "+ce); |
| | | logger.warn(LocalizableMessage.raw("Client exception "+ce)); |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | LOG.log(Level.WARNING, "Argument exception "+ae); |
| | | logger.warn(LocalizableMessage.raw("Argument exception "+ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | |
| | | cancelled = !askConfirmation( |
| | | INFO_REPLICATION_CONFIRM_INITIALIZE_ALL_ADS.get( |
| | | ADSContext.getAdministrationSuffixDN(), hostPortSource), true, |
| | | LOG); |
| | | logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | { |
| | | cancelled = !askConfirmation( |
| | | INFO_REPLICATION_CONFIRM_INITIALIZE_ALL_GENERIC.get( |
| | | hostPortSource), true, LOG); |
| | | hostPortSource), true, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | LOG.log(Level.WARNING, "Client exception "+ce); |
| | | logger.warn(LocalizableMessage.raw("Client exception "+ce)); |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | LOG.log(Level.WARNING, "Argument exception "+ae); |
| | | logger.warn(LocalizableMessage.raw("Argument exception "+ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | LOG.log(Level.WARNING, "Client exception "+ce); |
| | | logger.warn(LocalizableMessage.raw("Client exception "+ce)); |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | LOG.log(Level.WARNING, "Argument exception "+ae); |
| | | logger.warn(LocalizableMessage.raw("Argument exception "+ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | LOG.log(Level.WARNING, "Client exception "+ce); |
| | | logger.warn(LocalizableMessage.raw("Client exception "+ce)); |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | LOG.log(Level.WARNING, "Argument exception "+ae); |
| | | logger.warn(LocalizableMessage.raw("Argument exception "+ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | LOG.log(Level.WARNING, "Client exception "+ce); |
| | | logger.warn(LocalizableMessage.raw("Client exception "+ce)); |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | LOG.log(Level.WARNING, "Argument exception "+ae); |
| | | logger.warn(LocalizableMessage.raw("Argument exception "+ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | LOG.log(Level.WARNING, "Client exception "+ce); |
| | | logger.warn(LocalizableMessage.raw("Client exception "+ce)); |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | LOG.log(Level.WARNING, "Argument exception "+ae); |
| | | logger.warn(LocalizableMessage.raw("Argument exception "+ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | |
| | | cancelled = !askConfirmation( |
| | | INFO_REPLICATION_CONFIRM_INITIALIZE_ADS.get( |
| | | ADSContext.getAdministrationSuffixDN(), hostPortDestination, |
| | | hostPortSource), true, LOG); |
| | | hostPortSource), true, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | { |
| | | cancelled = !askConfirmation( |
| | | INFO_REPLICATION_CONFIRM_INITIALIZE_GENERIC.get( |
| | | hostPortDestination, hostPortSource), true, LOG); |
| | | hostPortDestination, hostPortSource), true, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.WARNING, |
| | | "Unexpected error retrieving the replication port: "+t, t); |
| | | logger.warn(LocalizableMessage.raw( |
| | | "Unexpected error retrieving the replication port: "+t, t)); |
| | | } |
| | | return replicationPort; |
| | | } |
| | |
| | | errorDisplayed = true; |
| | | } |
| | | adminUid = askForAdministratorUID( |
| | | argParser.getDefaultAdministratorUID(), LOG); |
| | | argParser.getDefaultAdministratorUID(), logger); |
| | | println(); |
| | | adminPwd = askForAdministratorPwd(LOG); |
| | | adminPwd = askForAdministratorPwd(logger); |
| | | println(); |
| | | } |
| | | close(ctx[0]); |
| | |
| | | println( |
| | | ERR_ERROR_CONNECTING_TO_SERVER_PROMPT_AGAIN.get( |
| | | getServerRepresentation(host, port), t.getMessage())); |
| | | LOG.log(Level.WARNING, "Complete error stack:", t); |
| | | logger.warn(LocalizableMessage.raw("Complete error stack:", t)); |
| | | println(); |
| | | } |
| | | } |
| | |
| | | { |
| | | reloadTopology = true; |
| | | cancelled = !ci.promptForCertificateConfirmation(e.getCause(), |
| | | e.getTrustManager(), e.getLdapUrl(), true, LOG); |
| | | e.getTrustManager(), e.getLdapUrl(), true, logger); |
| | | } |
| | | else |
| | | { |
| | |
| | | cancelled = !askConfirmation( |
| | | ERR_REPLICATION_READING_REGISTERED_SERVERS_CONFIRM_UPDATE_REMOTE. |
| | | get(Utils.getMessageFromCollection(exceptionMsgs, |
| | | Constants.LINE_SEPARATOR).toString()), true, LOG); |
| | | Constants.LINE_SEPARATOR).toString()), true, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | { |
| | |
| | | } |
| | | catch (ADSContextException ace) |
| | | { |
| | | LOG.log(Level.SEVERE, "Complete error stack:", ace); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", ace)); |
| | | throw new ReplicationCliException( |
| | | ERR_REPLICATION_READING_ADS.get(ace.getMessage()), |
| | | ERROR_READING_ADS, ace); |
| | | } |
| | | catch (TopologyCacheException tce) |
| | | { |
| | | LOG.log(Level.SEVERE, "Complete error stack:", tce); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", tce)); |
| | | throw new ReplicationCliException( |
| | | ERR_REPLICATION_READING_ADS.get(tce.getMessage()), |
| | | ERROR_READING_TOPOLOGY_CACHE, tce); |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.WARNING, |
| | | "Unexpected error retrieving the ADS data: "+t, t); |
| | | logger.warn(LocalizableMessage.raw( |
| | | "Unexpected error retrieving the ADS data: "+t, t)); |
| | | } |
| | | return isAdminDefined; |
| | | } |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.WARNING, |
| | | "Unexpected error retrieving the ADS data: "+t, t); |
| | | logger.warn(LocalizableMessage.raw( |
| | | "Unexpected error retrieving the ADS data: "+t, t)); |
| | | } |
| | | return isAdminDefined; |
| | | } |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.WARNING, |
| | | "Unexpected error retrieving the server configuration: "+t, t); |
| | | logger.warn(LocalizableMessage.raw( |
| | | "Unexpected error retrieving the server configuration: "+t, t)); |
| | | } |
| | | return suffixes; |
| | | } |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.WARNING, |
| | | "Unexpected error retrieving the server configuration: "+t, t); |
| | | logger.warn(LocalizableMessage.raw( |
| | | "Unexpected error retrieving the server configuration: "+t, t)); |
| | | } |
| | | return suffixes; |
| | | } |
| | |
| | | String hostPort = getServerRepresentation(host1, port1); |
| | | errorMessages.add(getMessageForException(ne, hostPort)); |
| | | |
| | | LOG.log(Level.SEVERE, "Complete error stack:", ne); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", ne)); |
| | | } |
| | | try |
| | | { |
| | |
| | | String hostPort = getServerRepresentation(host2, port2); |
| | | errorMessages.add(getMessageForException(ne, hostPort)); |
| | | |
| | | LOG.log(Level.SEVERE, "Complete error stack:", ne); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", ne)); |
| | | } |
| | | |
| | | if (errorMessages.size() > 0) |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error printing equivalente command-line: "+t, |
| | | t); |
| | | logger.error(LocalizableMessage.raw("Error printing equivalente command-line: "+t, |
| | | t)); |
| | | } |
| | | } |
| | | |
| | |
| | | returnValue = rce.getErrorCode(); |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", rce); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", rce)); |
| | | } |
| | | } |
| | | else |
| | |
| | | getServerRepresentation(uData.getHostName(), uData.getPort()); |
| | | println(); |
| | | println(getMessageForException(ne, hostPort)); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", ne); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", ne)); |
| | | } |
| | | |
| | | if (ctx != null) |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error printing equivalente command-line: "+t, |
| | | t); |
| | | logger.error(LocalizableMessage.raw("Error printing equivalente command-line: "+t, |
| | | t)); |
| | | } |
| | | } |
| | | |
| | |
| | | returnValue = rce.getErrorCode(); |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", rce); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", rce)); |
| | | } |
| | | } |
| | | else |
| | |
| | | getServerRepresentation(uData.getHostName(), uData.getPort()); |
| | | println(); |
| | | println(getMessageForException(ne, hostPort)); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", ne); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", ne)); |
| | | } |
| | | |
| | | if (ctx != null) |
| | |
| | | returnValue = rce.getErrorCode(); |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", rce); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", rce)); |
| | | } |
| | | } |
| | | else |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error printing equivalente command-line: "+t, |
| | | t); |
| | | logger.error(LocalizableMessage.raw("Error printing equivalente command-line: "+t, |
| | | t)); |
| | | } |
| | | } |
| | | |
| | |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | returnValue = rce.getErrorCode(); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", rce); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", rce)); |
| | | } |
| | | } |
| | | } |
| | |
| | | final String hostPort = getServerRepresentation(host, port); |
| | | println(); |
| | | println(Utils.getMessageForException(ne, hostPort)); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", ne); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", ne)); |
| | | } |
| | | return context; |
| | | } |
| | |
| | | getServerRepresentation(uData.getHostName(), uData.getPort()); |
| | | println(); |
| | | println(getMessageForException(ne, hostPort)); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", ne); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", ne)); |
| | | } |
| | | if (ctx != null) |
| | | { |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error printing equivalente command-line: "+t, |
| | | t); |
| | | logger.error(LocalizableMessage.raw("Error printing equivalente command-line: "+t, |
| | | t)); |
| | | } |
| | | } |
| | | for (String baseDN : baseDNs) |
| | |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | returnValue = rce.getErrorCode(); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", rce); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", rce)); |
| | | } |
| | | } |
| | | } |
| | |
| | | getServerRepresentation(uData.getHostName(), uData.getPort()); |
| | | println(); |
| | | println(getMessageForException(ne, hostPort)); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", ne); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", ne)); |
| | | } |
| | | if (ctx != null) |
| | | { |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error printing equivalente command-line: "+t, |
| | | t); |
| | | logger.error(LocalizableMessage.raw("Error printing equivalente command-line: "+t, |
| | | t)); |
| | | } |
| | | } |
| | | returnValue = SUCCESSFUL; |
| | |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | returnValue = rce.getErrorCode(); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", rce); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", rce)); |
| | | } |
| | | } |
| | | printlnProgress(); |
| | |
| | | getServerRepresentation(uData.getHostName(), uData.getPort()); |
| | | println(); |
| | | println(getMessageForException(ne, hostPort)); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", ne); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", ne)); |
| | | } |
| | | if (ctx != null) |
| | | { |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error printing equivalente command-line: "+t, |
| | | t); |
| | | logger.error(LocalizableMessage.raw("Error printing equivalente command-line: "+t, |
| | | t)); |
| | | } |
| | | } |
| | | returnValue = SUCCESSFUL; |
| | |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | returnValue = rce.getErrorCode(); |
| | | LOG.log(Level.SEVERE, "Complete error stack:", rce); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:", rce)); |
| | | } |
| | | } |
| | | printlnProgress(); |
| | |
| | | try |
| | | { |
| | | if (askConfirmation( |
| | | INFO_REPLICATION_ENABLE_SUFFIX_PROMPT.get(dn), true, LOG)) |
| | | INFO_REPLICATION_ENABLE_SUFFIX_PROMPT.get(dn), true, logger)) |
| | | { |
| | | suffixes.add(dn); |
| | | } |
| | |
| | | { |
| | | if (askConfirmation( |
| | | INFO_REPLICATION_DISABLE_SUFFIX_PROMPT.get(dn), true, |
| | | LOG)) |
| | | logger)) |
| | | { |
| | | suffixes.add(dn); |
| | | } |
| | |
| | | { |
| | | addSuffix = askConfirmation( |
| | | INFO_REPLICATION_PRE_EXTERNAL_INITIALIZATION_SUFFIX_PROMPT. |
| | | get(dn), true, LOG); |
| | | get(dn), true, logger); |
| | | } |
| | | else if (argParser.isPostExternalInitializationSubcommand()) |
| | | { |
| | | addSuffix = askConfirmation( |
| | | INFO_REPLICATION_POST_EXTERNAL_INITIALIZATION_SUFFIX_PROMPT. |
| | | get(dn), true, LOG); |
| | | get(dn), true, logger); |
| | | } |
| | | else |
| | | { |
| | | addSuffix = askConfirmation( |
| | | INFO_REPLICATION_INITIALIZE_ALL_SUFFIX_PROMPT.get(dn), |
| | | true, LOG); |
| | | true, logger); |
| | | } |
| | | } |
| | | catch (CLIException ce) |
| | |
| | | { |
| | | if (askConfirmation( |
| | | INFO_REPLICATION_INITIALIZE_SUFFIX_PROMPT.get(dn), true, |
| | | LOG)) |
| | | logger)) |
| | | { |
| | | suffixes.add(dn); |
| | | } |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error seeding truststores: "+t, t); |
| | | logger.error(LocalizableMessage.raw("Error seeding truststores: "+t, t)); |
| | | String arg = (t instanceof OpenDsException) ? |
| | | ((OpenDsException)t).getMessageObject().toString() : t.toString(); |
| | | throw new ReplicationCliException( |
| | |
| | | if (uData.getReplicationPort1() != |
| | | server1.getReplicationServerPort()) |
| | | { |
| | | LOG.log(Level.WARNING, "Ignoring provided replication port for "+ |
| | | logger.warn(LocalizableMessage.raw("Ignoring provided replication port for "+ |
| | | "first server (already configured with port "+ |
| | | server1.getReplicationServerPort()+")"); |
| | | server1.getReplicationServerPort()+")")); |
| | | println(WARN_FIRST_REPLICATION_SERVER_ALREADY_CONFIGURED.get( |
| | | server1.getReplicationServerPort(), uData.getReplicationPort1())); |
| | | } |
| | |
| | | if (uData.getReplicationPort2() != |
| | | server2.getReplicationServerPort()) |
| | | { |
| | | LOG.log(Level.WARNING, "Ignoring provided replication port for "+ |
| | | logger.warn(LocalizableMessage.raw("Ignoring provided replication port for "+ |
| | | "second server (already configured with port "+ |
| | | server2.getReplicationServerPort()+")"); |
| | | server2.getReplicationServerPort()+")")); |
| | | println(WARN_SECOND_REPLICATION_SERVER_ALREADY_CONFIGURED.get( |
| | | server2.getReplicationServerPort(), uData.getReplicationPort2())); |
| | | } |
| | |
| | | { |
| | | if (!askConfirmation( |
| | | INFO_DISABLE_REPLICATION_ONE_POINT_OF_FAILURE_PROMPT.get(arg), |
| | | false, LOG)) |
| | | false, logger)) |
| | | { |
| | | throw new ReplicationCliException( |
| | | ERR_REPLICATION_USER_CANCELLED.get(), |
| | |
| | | { |
| | | if (!askConfirmation( |
| | | INFO_DISABLE_REPLICATION_DISABLE_IN_REMOTE_PROMPT.get(arg), |
| | | false, LOG)) |
| | | false, logger)) |
| | | { |
| | | throw new ReplicationCliException( |
| | | ERR_REPLICATION_USER_CANCELLED.get(), |
| | |
| | | } |
| | | catch (ADSContextException adce) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error unregistering server: "+ |
| | | server.getAdsProperties(), adce); |
| | | logger.error(LocalizableMessage.raw("Error unregistering server: "+ |
| | | server.getAdsProperties(), adce)); |
| | | if (adce.getError() != ADSContextException.ErrorType.NOT_YET_REGISTERED) |
| | | { |
| | | throw new ReplicationCliException( |
| | |
| | | } |
| | | catch (ADSContextException adce) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error removing contents of cn=admin data: "+ |
| | | adce, adce); |
| | | logger.error(LocalizableMessage.raw("Error removing contents of cn=admin data: "+ |
| | | adce, adce)); |
| | | throw new ReplicationCliException( |
| | | ERR_REPLICATION_UPDATING_ADS.get(adce.getMessageObject()), |
| | | ERROR_UPDATING_ADS, adce); |
| | |
| | | catch (ADSContextException adce) |
| | | { |
| | | // This is not critical, do not send an error |
| | | LOG.log(Level.WARNING, "Error unregistering server: "+ |
| | | server.getAdsProperties(), adce); |
| | | logger.warn(LocalizableMessage.raw("Error unregistering server: "+ |
| | | server.getAdsProperties(), adce)); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error printing equivalente command-line: "+t, |
| | | t); |
| | | logger.error(LocalizableMessage.raw("Error printing equivalente command-line: "+t, |
| | | t)); |
| | | } |
| | | } |
| | | if (!argParser.isInteractive()) |
| | |
| | | } |
| | | catch (ManagedObjectNotFoundException monfe) |
| | | { |
| | | LOG.log(Level.INFO, "Synchronization server does not exist in "+ |
| | | ConnectionUtils.getHostPort(ctx)); |
| | | logger.debug(LocalizableMessage.raw("Synchronization server does not exist in "+ |
| | | ConnectionUtils.getHostPort(ctx))); |
| | | } |
| | | if (sync == null) |
| | | { |
| | |
| | | Set<String> alreadyConfiguredReplicationServers) |
| | | throws ReplicationCliException |
| | | { |
| | | LOG.log(Level.INFO, "Configuring base DN '"+baseDN+ |
| | | "' the replication servers are "+repServers); |
| | | logger.debug(LocalizableMessage.raw("Configuring base DN '"+baseDN+ |
| | | "' the replication servers are "+repServers)); |
| | | Set<ServerDescriptor> serversToConfigureDomain = |
| | | new HashSet<ServerDescriptor>(); |
| | | Set<ServerDescriptor> replicationServersToConfigure = |
| | |
| | | |
| | | for (ServerDescriptor s : allServers) |
| | | { |
| | | LOG.log(Level.INFO,"Configuring server "+server.getHostPort(true)); |
| | | logger.debug(LocalizableMessage.raw("Configuring server "+server.getHostPort(true))); |
| | | InitialLdapContext ctx = null; |
| | | try |
| | | { |
| | |
| | | } |
| | | catch (PeerNotFoundException pnfe) |
| | | { |
| | | LOG.log(Level.INFO, "Peer could not be found"); |
| | | logger.debug(LocalizableMessage.raw("Peer could not be found")); |
| | | if (nTries == 1) |
| | | { |
| | | throw new ReplicationCliException( |
| | |
| | | } |
| | | catch (PeerNotFoundException pnfe) |
| | | { |
| | | LOG.log(Level.INFO, "Peer could not be found"); |
| | | logger.debug(LocalizableMessage.raw("Peer could not be found")); |
| | | if (nTries == 1) |
| | | { |
| | | throw new ReplicationCliException( |
| | |
| | | { |
| | | DirContext dirCtx = ctx.createSubcontext(dn, attrs); |
| | | taskCreated = true; |
| | | LOG.log(Level.INFO, "created task entry: "+attrs); |
| | | logger.debug(LocalizableMessage.raw("created task entry: "+attrs)); |
| | | dirCtx.close(); |
| | | } |
| | | catch (NameAlreadyBoundException x) |
| | |
| | | } |
| | | catch (NamingException ne) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error creating task "+attrs, ne); |
| | | logger.error(LocalizableMessage.raw("Error creating task "+attrs, ne)); |
| | | LocalizableMessage msg = isPre ? |
| | | ERR_LAUNCHING_PRE_EXTERNAL_INITIALIZATION.get(): |
| | | ERR_LAUNCHING_POST_EXTERNAL_INITIALIZATION.get(); |
| | |
| | | { |
| | | if (!logMsg.equals(lastLogMsg)) |
| | | { |
| | | LOG.log(Level.INFO, logMsg); |
| | | logger.debug(LocalizableMessage.raw(logMsg)); |
| | | lastLogMsg = logMsg; |
| | | } |
| | | } |
| | |
| | | |
| | | if (helper.isCompletedWithErrors(state)) |
| | | { |
| | | LOG.log(Level.WARNING, "Completed with error: "+errorMsg); |
| | | logger.warn(LocalizableMessage.raw("Completed with error: "+errorMsg)); |
| | | println(errorMsg); |
| | | } |
| | | else if (!helper.isSuccessful(state) || |
| | | helper.isStoppedByError(state)) |
| | | { |
| | | LOG.log(Level.WARNING, "Error: "+errorMsg); |
| | | logger.warn(LocalizableMessage.raw("Error: "+errorMsg)); |
| | | ReplicationCliReturnCode code = isPre? |
| | | ERROR_LAUNCHING_PRE_EXTERNAL_INITIALIZATION: |
| | | ERROR_LAUNCHING_POST_EXTERNAL_INITIALIZATION; |
| | |
| | | { |
| | | DirContext dirCtx = ctx.createSubcontext(dn, attrs); |
| | | taskCreated = true; |
| | | LOG.log(Level.INFO, "created task entry: "+attrs); |
| | | logger.debug(LocalizableMessage.raw("created task entry: "+attrs)); |
| | | dirCtx.close(); |
| | | } |
| | | catch (NameAlreadyBoundException x) |
| | | { |
| | | LOG.log(Level.WARNING, "A task with dn: "+dn+" already existed."); |
| | | logger.warn(LocalizableMessage.raw("A task with dn: "+dn+" already existed.")); |
| | | } |
| | | catch (NamingException ne) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error creating task "+attrs, ne); |
| | | logger.error(LocalizableMessage.raw("Error creating task "+attrs, ne)); |
| | | throw new ApplicationException( |
| | | ReturnCode.APPLICATION_ERROR, |
| | | getThrowableMsg(INFO_ERROR_LAUNCHING_INITIALIZATION.get( |
| | |
| | | if (((currentTime - minRefreshPeriod) > lastTimeMsgLogged)) |
| | | { |
| | | lastTimeMsgLogged = currentTime; |
| | | LOG.log(Level.INFO, "Progress msg: "+msg); |
| | | logger.debug(LocalizableMessage.raw("Progress msg: "+msg)); |
| | | } |
| | | if (displayProgress) |
| | | { |
| | |
| | | { |
| | | if (!logMsg.equals(lastLogMsg)) |
| | | { |
| | | LOG.log(Level.INFO, logMsg); |
| | | logger.debug(LocalizableMessage.raw(logMsg)); |
| | | lastLogMsg = logMsg; |
| | | } |
| | | } |
| | |
| | | { |
| | | isOver = true; |
| | | LocalizableMessage errorMsg; |
| | | LOG.log(Level.INFO, "Last task entry: "+sr); |
| | | logger.debug(LocalizableMessage.raw("Last task entry: "+sr)); |
| | | if (displayProgress && (msg != null) && !msg.equals(lastDisplayedMsg)) |
| | | { |
| | | printProgress(msg); |
| | |
| | | |
| | | if (helper.isCompletedWithErrors(state)) |
| | | { |
| | | LOG.log(Level.WARNING, "Processed errorMsg: "+errorMsg); |
| | | logger.warn(LocalizableMessage.raw("Processed errorMsg: "+errorMsg)); |
| | | if (displayProgress) |
| | | { |
| | | println(errorMsg); |
| | |
| | | else if (!helper.isSuccessful(state) || |
| | | helper.isStoppedByError(state)) |
| | | { |
| | | LOG.log(Level.WARNING, "Processed errorMsg: "+errorMsg); |
| | | logger.warn(LocalizableMessage.raw("Processed errorMsg: "+errorMsg)); |
| | | ApplicationException ae = new ApplicationException( |
| | | ReturnCode.APPLICATION_ERROR, errorMsg, |
| | | null); |
| | | if ((lastLogMsg == null) || |
| | | helper.isPeersNotFoundError(lastLogMsg)) |
| | | { |
| | | LOG.log(Level.WARNING, "Throwing peer not found error. "+ |
| | | "Last Log Msg: "+lastLogMsg); |
| | | logger.warn(LocalizableMessage.raw("Throwing peer not found error. "+ |
| | | "Last Log Msg: "+lastLogMsg)); |
| | | // Assume that this is a peer not found error. |
| | | throw new PeerNotFoundException(errorMsg); |
| | | } |
| | | else |
| | | { |
| | | LOG.log(Level.SEVERE, "Throwing ApplicationException."); |
| | | logger.error(LocalizableMessage.raw("Throwing ApplicationException.")); |
| | | throw ae; |
| | | } |
| | | } |
| | |
| | | printProgress(INFO_SUFFIX_INITIALIZED_SUCCESSFULLY.get()); |
| | | printlnProgress(); |
| | | } |
| | | LOG.log(Level.INFO, "Processed msg: "+errorMsg); |
| | | LOG.log(Level.INFO, "Initialization completed successfully."); |
| | | logger.debug(LocalizableMessage.raw("Processed msg: "+errorMsg)); |
| | | logger.debug(LocalizableMessage.raw("Initialization completed successfully.")); |
| | | } |
| | | } |
| | | } |
| | | catch (NameNotFoundException x) |
| | | { |
| | | isOver = true; |
| | | LOG.log(Level.INFO, "Initialization entry not found."); |
| | | logger.debug(LocalizableMessage.raw("Initialization entry not found.")); |
| | | if (displayProgress) |
| | | { |
| | | printProgress(INFO_SUFFIX_INITIALIZED_SUCCESSFULLY.get()); |
| | |
| | | catch (ManagedObjectNotFoundException monfe) |
| | | { |
| | | // It does not exist. |
| | | LOG.log(Level.INFO, "No synchronization found on "+ hostPort +".", |
| | | monfe); |
| | | logger.debug(LocalizableMessage.raw("No synchronization found on "+ hostPort +".", |
| | | monfe)); |
| | | } |
| | | if (sync != null) |
| | | { |
| | |
| | | } |
| | | if (replServer != null) |
| | | { |
| | | LOG.log(Level.INFO, "Updating references in domain " + |
| | | domain.getBaseDN()+" on " + hostPort + "."); |
| | | logger.debug(LocalizableMessage.raw("Updating references in domain " + |
| | | domain.getBaseDN()+" on " + hostPort + ".")); |
| | | replServers.remove(replServer); |
| | | if (replServers.size() > 0) |
| | | { |
| | |
| | | catch (ManagedObjectNotFoundException monfe) |
| | | { |
| | | // It does not exist. |
| | | LOG.log(Level.INFO, "No synchronization found on "+ hostPort +".", |
| | | monfe); |
| | | logger.debug(LocalizableMessage.raw("No synchronization found on "+ hostPort +".", |
| | | monfe)); |
| | | } |
| | | if (sync != null) |
| | | { |
| | |
| | | catch (ManagedObjectNotFoundException monfe) |
| | | { |
| | | // It does not exist. |
| | | LOG.log(Level.INFO, "No synchronization found on "+ hostPort +".", |
| | | monfe); |
| | | logger.debug(LocalizableMessage.raw("No synchronization found on "+ hostPort +".", |
| | | monfe)); |
| | | } |
| | | if (replicationServer != null) |
| | | { |
| | |
| | | if (ade.getError() == |
| | | ADSContextException.ErrorType.ALREADY_REGISTERED) |
| | | { |
| | | LOG.log(Level.WARNING, "The server was already registered: "+ |
| | | serverProperties); |
| | | logger.warn(LocalizableMessage.raw("The server was already registered: "+ |
| | | serverProperties)); |
| | | adsContext.unregisterServer(serverProperties); |
| | | adsContext.registerServer(serverProperties); |
| | | } |
| | |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | LOG.log(Level.WARNING, "Error initializing trust store: "+ae, ae); |
| | | logger.warn(LocalizableMessage.raw("Error initializing trust store: "+ae, ae)); |
| | | } |
| | | forceNonInteractive = false; |
| | | } |
| | |
| | | catch (CLIException ce) |
| | | { |
| | | returnValue = SubcommandChoice.CANCEL; |
| | | LOG.log(Level.WARNING, "Error reading input: "+ce, ce); |
| | | logger.warn(LocalizableMessage.raw("Error reading input: "+ce, ce)); |
| | | } |
| | | return returnValue; |
| | | } |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.WARNING, "Error loading topology cache in "+ |
| | | ConnectionUtils.getLdapUrl(ctx1)+": "+t, t); |
| | | logger.warn(LocalizableMessage.raw("Error loading topology cache in "+ |
| | | ConnectionUtils.getLdapUrl(ctx1)+": "+t, t)); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.WARNING, "Error loading topology cache in "+ |
| | | ConnectionUtils.getLdapUrl(ctx2)+": "+t, t); |
| | | logger.warn(LocalizableMessage.raw("Error loading topology cache in "+ |
| | | ConnectionUtils.getLdapUrl(ctx2)+": "+t, t)); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.WARNING, "Error loading topology cache from "+ |
| | | ConnectionUtils.getHostPort(adsCtx1.getDirContext())+": "+t, t); |
| | | logger.warn(LocalizableMessage.raw("Error loading topology cache from "+ |
| | | ConnectionUtils.getHostPort(adsCtx1.getDirContext())+": "+t, t)); |
| | | } |
| | | |
| | | try |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.WARNING, "Error loading topology cache from "+ |
| | | ConnectionUtils.getHostPort(adsCtx2.getDirContext())+": "+t, t); |
| | | logger.warn(LocalizableMessage.raw("Error loading topology cache from "+ |
| | | ConnectionUtils.getHostPort(adsCtx2.getDirContext())+": "+t, t)); |
| | | } |
| | | |
| | | int repPort1 = getReplicationPort(adsCtx1.getDirContext()); |
| | |
| | | } |
| | | catch (TopologyCacheException te) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error reading topology cache of "+ |
| | | ConnectionUtils.getHostPort(adsCtx1.getDirContext())+ " "+te, te); |
| | | logger.error(LocalizableMessage.raw("Error reading topology cache of "+ |
| | | ConnectionUtils.getHostPort(adsCtx1.getDirContext())+ " "+te, te)); |
| | | throw new ReplicationCliException( |
| | | ERR_REPLICATION_READING_ADS.get(te.getMessageObject()), |
| | | ERROR_UPDATING_ADS, te); |
| | |
| | | } |
| | | catch (TopologyCacheException te) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error reading topology cache of "+ |
| | | ConnectionUtils.getHostPort(adsCtx2.getDirContext())+ " "+te, te); |
| | | logger.error(LocalizableMessage.raw("Error reading topology cache of "+ |
| | | ConnectionUtils.getHostPort(adsCtx2.getDirContext())+ " "+te, te)); |
| | | throw new ReplicationCliException( |
| | | ERR_REPLICATION_READING_ADS.get(te.getMessageObject()), |
| | | ERROR_UPDATING_ADS, te); |
| | |
| | | ConnectionUtils.getHostPort(ctxDestination)); |
| | | try |
| | | { |
| | | if (!askConfirmation(msg, true, LOG)) |
| | | if (!askConfirmation(msg, true, logger)) |
| | | { |
| | | throw new ReplicationCliException( |
| | | ERR_REPLICATION_USER_CANCELLED.get(), |
| | |
| | | } |
| | | catch (ADSContextException adce) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error merging registry of "+ |
| | | logger.error(LocalizableMessage.raw("Error merging registry of "+ |
| | | ConnectionUtils.getHostPort(adsCtxSource.getDirContext())+ |
| | | " with registry of "+ |
| | | ConnectionUtils.getHostPort(adsCtxDestination.getDirContext())+" "+ |
| | | adce, adce); |
| | | adce, adce)); |
| | | if (adce.getError() == ADSContextException.ErrorType.ERROR_MERGING) |
| | | { |
| | | throw new ReplicationCliException(adce.getMessageObject(), |
| | |
| | | { |
| | | if (server.isReplicationServer()) |
| | | { |
| | | LOG.log(Level.INFO, "Seeding to replication server on "+ |
| | | logger.debug(LocalizableMessage.raw("Seeding to replication server on "+ |
| | | server.getHostPort(true)+" with certificates of "+ |
| | | ConnectionUtils.getHostPort(adsCtxSource.getDirContext())); |
| | | ConnectionUtils.getHostPort(adsCtxSource.getDirContext()))); |
| | | InitialLdapContext ctx = null; |
| | | try |
| | | { |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error seeding truststore: "+t, t); |
| | | logger.error(LocalizableMessage.raw("Error seeding truststore: "+t, t)); |
| | | String arg = (t instanceof OpenDsException) ? |
| | | ((OpenDsException)t).getMessageObject().toString() : t.toString(); |
| | | throw new ReplicationCliException( |