| | |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | println(ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage())); |
| | | errPrintln(ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage())); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:"), ae); |
| | | returnValue = CANNOT_INITIALIZE_ARGS; |
| | | } |
| | |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | println(ERR_ERROR_PARSING_ARGS.get(ae.getMessage())); |
| | | println(); |
| | | println(LocalizableMessage.raw(argParser.getUsage())); |
| | | errPrintln(ERR_ERROR_PARSING_ARGS.get(ae.getMessage())); |
| | | errPrintln(); |
| | | errPrintln(LocalizableMessage.raw(argParser.getUsage())); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:"), ae); |
| | | returnValue = ERROR_USER_DATA; |
| | | } |
| | |
| | | } |
| | | catch (InitializationException e) |
| | | { |
| | | println(e.getMessageObject()); |
| | | errPrintln(e.getMessageObject()); |
| | | return 1; |
| | | } |
| | | |
| | |
| | | argParser.validateOptions(buf); |
| | | if (buf.length() > 0) |
| | | { |
| | | println(buf.toMessage()); |
| | | println(LocalizableMessage.raw(argParser.getUsage())); |
| | | errPrintln(buf.toMessage()); |
| | | errPrintln(LocalizableMessage.raw(argParser.getUsage())); |
| | | returnValue = ERROR_USER_DATA; |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | println(ie.getMessageObject()); |
| | | errPrintln(ie.getMessageObject()); |
| | | returnValue = ERROR_INITIALIZING_ADMINISTRATION_FRAMEWORK; |
| | | } |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | println(ERR_REPLICATION_VALID_SUBCOMMAND_NOT_FOUND.get( |
| | | errPrintln(ERR_REPLICATION_VALID_SUBCOMMAND_NOT_FOUND.get( |
| | | "--"+OPTION_LONG_NO_PROMPT)); |
| | | println(LocalizableMessage.raw(argParser.getUsage())); |
| | | errPrintln(LocalizableMessage.raw(argParser.getUsage())); |
| | | returnValue = ERROR_USER_DATA; |
| | | subcommandLaunched = false; |
| | | } |
| | |
| | | catch (NumberFormatException e) |
| | | { |
| | | // Try again... |
| | | app.println(); |
| | | app.println(ERR_BAD_INTEGER.get(ninput)); |
| | | app.println(); |
| | | app.errPrintln(); |
| | | app.errPrintln(ERR_BAD_INTEGER.get(ninput)); |
| | | app.errPrintln(); |
| | | return null; |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (ReplicationCliException rce) |
| | | { |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | errPrintln(); |
| | | errPrintln(getCriticalExceptionMessage(rce)); |
| | | return rce.getErrorCode(); |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (ReplicationCliException rce) |
| | | { |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | errPrintln(); |
| | | errPrintln(getCriticalExceptionMessage(rce)); |
| | | return rce.getErrorCode(); |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (ReplicationCliException rce) |
| | | { |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | errPrintln(); |
| | | errPrintln(getCriticalExceptionMessage(rce)); |
| | | return rce.getErrorCode(); |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (ReplicationCliException rce) |
| | | { |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | errPrintln(); |
| | | errPrintln(getCriticalExceptionMessage(rce)); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:"), rce); |
| | | return rce.getErrorCode(); |
| | | } |
| | |
| | | } |
| | | catch (ReplicationCliException rce) |
| | | { |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | errPrintln(); |
| | | errPrintln(getCriticalExceptionMessage(rce)); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:"), rce); |
| | | return rce.getErrorCode(); |
| | | } |
| | |
| | | catch (NamingException ne) |
| | | { |
| | | String hostPort = getServerRepresentation(uData.getHostName(), uData.getPort()); |
| | | println(); |
| | | println(getMessageForException(ne, hostPort)); |
| | | errPrintln(); |
| | | errPrintln(getMessageForException(ne, hostPort)); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:"), ne); |
| | | return null; |
| | | } |
| | |
| | | if (helper.isCompletedWithErrors(state)) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Completed with error: "+errorMsg)); |
| | | println(errorMsg); |
| | | errPrintln(errorMsg); |
| | | } |
| | | else if (!helper.isSuccessful(state) || |
| | | helper.isStoppedByError(state)) |
| | |
| | | { |
| | | if (availableSuffixes.isEmpty()) |
| | | { |
| | | println(); |
| | | println(ERR_NO_SUFFIXES_AVAILABLE_TO_PURGE_HISTORICAL.get()); |
| | | errPrintln(); |
| | | errPrintln(ERR_NO_SUFFIXES_AVAILABLE_TO_PURGE_HISTORICAL.get()); |
| | | suffixes.clear(); |
| | | } |
| | | else |
| | |
| | | suffixes.removeAll(alreadyNotReplicated); |
| | | if (notFound.size() > 0) |
| | | { |
| | | println(); |
| | | println(ERR_REPLICATION_PURGE_SUFFIXES_NOT_FOUND.get(toSingleLine(notFound))); |
| | | errPrintln(); |
| | | errPrintln(ERR_REPLICATION_PURGE_SUFFIXES_NOT_FOUND.get(toSingleLine(notFound))); |
| | | } |
| | | if (interactive) |
| | | { |
| | |
| | | if (containsOnlySchemaOrAdminSuffix(availableSuffixes)) |
| | | { |
| | | // In interactive mode we do not propose to manage the administration suffix. |
| | | println(); |
| | | println(noSuffixAvailableMsg.get()); |
| | | errPrintln(); |
| | | errPrintln(noSuffixAvailableMsg.get()); |
| | | return; |
| | | } |
| | | |
| | | while (suffixes.isEmpty()) |
| | | { |
| | | println(); |
| | | println(noSuffixSelectedMsg.get()); |
| | | errPrintln(); |
| | | errPrintln(noSuffixSelectedMsg.get()); |
| | | boolean confirmationLimitReached = askConfirmations(confirmationMsgPromt, availableSuffixes, suffixes); |
| | | if (confirmationLimitReached) |
| | | { |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | println(ce.getMessageObject()); |
| | | errPrintln(ce.getMessageObject()); |
| | | return false; |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | println(ce.getMessageObject()); |
| | | errPrintln(ce.getMessageObject()); |
| | | } |
| | | |
| | | if (!promptForConnection) |
| | |
| | | catch (ClientException ce) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Client exception " + ce)); |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ce.getMessageObject()); |
| | | errPrintln(); |
| | | ci.resetConnectionArguments(); |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Argument exception " + ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ae.getMessageObject()); |
| | | errPrintln(); |
| | | return null; |
| | | } |
| | | firstTry = false; |
| | |
| | | catch (ClientException ce) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Client exception "+ce)); |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ce.getMessageObject()); |
| | | errPrintln(); |
| | | ci.resetConnectionArguments(); |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Argument exception "+ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ae.getMessageObject()); |
| | | errPrintln(); |
| | | cancelled = true; |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | println(ce.getMessageObject()); |
| | | errPrintln(ce.getMessageObject()); |
| | | cancelled = true; |
| | | } |
| | | } |
| | |
| | | { |
| | | if (!SetupUtils.canUseAsPort(replicationPort1)) |
| | | { |
| | | println(); |
| | | println(getCannotBindToPortError(replicationPort1)); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(getCannotBindToPortError(replicationPort1)); |
| | | errPrintln(); |
| | | replicationPort1 = -1; |
| | | } |
| | | } |
| | |
| | | { |
| | | // This is something that we must do in any case... this test is |
| | | // already included when we call SetupUtils.canUseAsPort |
| | | println(); |
| | | println(ERR_REPLICATION_PORT_AND_REPLICATION_PORT_EQUAL.get(host1, replicationPort1)); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ERR_REPLICATION_PORT_AND_REPLICATION_PORT_EQUAL.get(host1, replicationPort1)); |
| | | errPrintln(); |
| | | replicationPort1 = -1; |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | println(ce.getMessageObject()); |
| | | errPrintln(ce.getMessageObject()); |
| | | cancelled = true; |
| | | } |
| | | println(); |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | println(ce.getMessageObject()); |
| | | errPrintln(ce.getMessageObject()); |
| | | cancelled = true; |
| | | } |
| | | } |
| | |
| | | if (host1.equalsIgnoreCase(host2) && port1 == port2) |
| | | { |
| | | port2 = -1; |
| | | println(); |
| | | println(ERR_REPLICATION_ENABLE_SAME_SERVER_PORT.get(host1, port1)); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ERR_REPLICATION_ENABLE_SAME_SERVER_PORT.get(host1, port1)); |
| | | errPrintln(); |
| | | error = true; |
| | | } |
| | | |
| | |
| | | logger.warn(LocalizableMessage.raw("Client exception "+ce)); |
| | | if (!doNotDisplayFirstError) |
| | | { |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ce.getMessageObject()); |
| | | errPrintln(); |
| | | ci.resetConnectionArguments(); |
| | | } |
| | | else |
| | |
| | | catch (ArgumentException ae) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Argument exception "+ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ae.getMessageObject()); |
| | | errPrintln(); |
| | | cancelled = true; |
| | | } |
| | | finally |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | println(ce.getMessageObject()); |
| | | errPrintln(ce.getMessageObject()); |
| | | cancelled = true; |
| | | } |
| | | } |
| | |
| | | { |
| | | if (!SetupUtils.canUseAsPort(replicationPort2)) |
| | | { |
| | | println(); |
| | | println(getCannotBindToPortError(replicationPort2)); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(getCannotBindToPortError(replicationPort2)); |
| | | errPrintln(); |
| | | replicationPort2 = -1; |
| | | } |
| | | } |
| | |
| | | { |
| | | // This is something that we must do in any case... this test is |
| | | // already included when we call SetupUtils.canUseAsPort |
| | | println(); |
| | | println(ERR_REPLICATION_PORT_AND_REPLICATION_PORT_EQUAL.get(host2, replicationPort2)); |
| | | errPrintln(); |
| | | errPrintln(ERR_REPLICATION_PORT_AND_REPLICATION_PORT_EQUAL.get(host2, replicationPort2)); |
| | | replicationPort2 = -1; |
| | | } |
| | | if (host1.equalsIgnoreCase(host2) |
| | | && replicationPort1 > 0 |
| | | && replicationPort1 == replicationPort2) |
| | | { |
| | | println(); |
| | | println(ERR_REPLICATION_SAME_REPLICATION_PORT.get(replicationPort2, host1)); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ERR_REPLICATION_SAME_REPLICATION_PORT.get(replicationPort2, host1)); |
| | | errPrintln(); |
| | | replicationPort2 = -1; |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | println(ce.getMessageObject()); |
| | | errPrintln(ce.getMessageObject()); |
| | | cancelled = true; |
| | | } |
| | | println(); |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | println(ce.getMessageObject()); |
| | | errPrintln(ce.getMessageObject()); |
| | | cancelled = true; |
| | | } |
| | | } |
| | |
| | | { |
| | | if (nPasswordPrompts > CONFIRMATION_MAX_TRIES) |
| | | { |
| | | println(ERR_CONFIRMATION_TRIES_LIMIT_REACHED.get( |
| | | errPrintln(ERR_CONFIRMATION_TRIES_LIMIT_REACHED.get( |
| | | CONFIRMATION_MAX_TRIES)); |
| | | cancelled = true; |
| | | break; |
| | |
| | | if (!adminPwd.equals(adminPwdConfirm)) |
| | | { |
| | | println(); |
| | | println(ERR_ADMINISTRATOR_PWD_DO_NOT_MATCH.get()); |
| | | errPrintln(ERR_ADMINISTRATOR_PWD_DO_NOT_MATCH.get()); |
| | | println(); |
| | | adminPwd = null; |
| | | } |
| | |
| | | catch (ClientException ce) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Client exception "+ce)); |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ce.getMessageObject()); |
| | | errPrintln(); |
| | | ci.resetConnectionArguments(); |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Argument exception "+ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ae.getMessageObject()); |
| | | errPrintln(); |
| | | cancelled = true; |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | println(ce.getMessageObject()); |
| | | errPrintln(ce.getMessageObject()); |
| | | cancelled = true; |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | println(ce.getMessageObject()); |
| | | errPrintln(ce.getMessageObject()); |
| | | cancelled = true; |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | println(ce.getMessageObject()); |
| | | errPrintln(ce.getMessageObject()); |
| | | cancelled = true; |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | println(ce.getMessageObject()); |
| | | errPrintln(ce.getMessageObject()); |
| | | cancelled = true; |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | println(ce.getMessageObject()); |
| | | errPrintln(ce.getMessageObject()); |
| | | return false; |
| | | } |
| | | } |
| | |
| | | catch (ClientException ce) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Client exception " + ce)); |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ce.getMessageObject()); |
| | | errPrintln(); |
| | | ci.resetConnectionArguments(); |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Argument exception " + ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ae.getMessageObject()); |
| | | errPrintln(); |
| | | return null; |
| | | } |
| | | } |
| | |
| | | catch (ClientException ce) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Client exception "+ce)); |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ce.getMessageObject()); |
| | | errPrintln(); |
| | | ci.resetConnectionArguments(); |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Argument exception "+ae)); |
| | | println(); |
| | | println(ae.getMessageObject()); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ae.getMessageObject()); |
| | | errPrintln(); |
| | | cancelled = true; |
| | | } |
| | | } |
| | |
| | | && portSource == portDestination) |
| | | { |
| | | portDestination = -1; |
| | | println(); |
| | | println(ERR_REPLICATION_INITIALIZE_SAME_SERVER_PORT.get(hostSource, portSource)); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ERR_REPLICATION_INITIALIZE_SAME_SERVER_PORT.get(hostSource, portSource)); |
| | | errPrintln(); |
| | | error = true; |
| | | } |
| | | |
| | |
| | | catch (ClientException ce) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Client exception "+ce)); |
| | | println(); |
| | | println(ce.getMessageObject()); |
| | | println(); |
| | | errPrintln(); |
| | | errPrintln(ce.getMessageObject()); |
| | | errPrintln(); |
| | | ci.resetConnectionArguments(); |
| | | } |
| | | catch (ArgumentException ae) |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | println(); |
| | | println( |
| | | errPrintln(); |
| | | errPrintln( |
| | | ERR_ERROR_CONNECTING_TO_SERVER_PROMPT_AGAIN.get( |
| | | getServerRepresentation(host, port), t.getMessage())); |
| | | logger.warn(LocalizableMessage.raw("Complete error stack:", t)); |
| | | println(); |
| | | errPrintln(); |
| | | } |
| | | } |
| | | uData.setAdminUid(adminUid); |
| | |
| | | { |
| | | if (uData instanceof StatusReplicationUserData) |
| | | { |
| | | println( |
| | | errPrintln( |
| | | ERR_REPLICATION_STATUS_READING_REGISTERED_SERVERS.get( |
| | | getMessageFromCollection(exceptionMsgs, |
| | | Constants.LINE_SEPARATOR))); |
| | | println(); |
| | | errPrintln(); |
| | | } |
| | | else |
| | | { |
| | |
| | | catch (ReplicationCliException rce) |
| | | { |
| | | returnValue = rce.getErrorCode(); |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | errPrintln(); |
| | | errPrintln(getCriticalExceptionMessage(rce)); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:"), rce); |
| | | } |
| | | } |
| | |
| | | |
| | | for (LocalizableMessage msg : errorMessages) |
| | | { |
| | | println(); |
| | | println(msg); |
| | | errPrintln(); |
| | | errPrintln(msg); |
| | | } |
| | | |
| | | if (returnValue == SUCCESSFUL) |
| | |
| | | } |
| | | catch (ReplicationCliException rce) |
| | | { |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | errPrintln(); |
| | | errPrintln(getCriticalExceptionMessage(rce)); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:"), rce); |
| | | return rce.getErrorCode(); |
| | | } |
| | |
| | | } |
| | | catch (ReplicationCliException rce) |
| | | { |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | errPrintln(); |
| | | errPrintln(getCriticalExceptionMessage(rce)); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:"), rce); |
| | | return rce.getErrorCode(); |
| | | } |
| | |
| | | } |
| | | catch (ReplicationCliException rce) |
| | | { |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | errPrintln(); |
| | | errPrintln(getCriticalExceptionMessage(rce)); |
| | | returnValue = rce.getErrorCode(); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:"), rce); |
| | | } |
| | |
| | | catch (NamingException ne) |
| | | { |
| | | final String hostPort = getServerRepresentation(host, port); |
| | | println(); |
| | | println(getMessageForException(ne, hostPort)); |
| | | errPrintln(); |
| | | errPrintln(getMessageForException(ne, hostPort)); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:"), ne); |
| | | return null; |
| | | } |
| | |
| | | } |
| | | catch (ReplicationCliException rce) |
| | | { |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | errPrintln(); |
| | | errPrintln(getCriticalExceptionMessage(rce)); |
| | | returnValue = rce.getErrorCode(); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:"), rce); |
| | | } |
| | |
| | | } |
| | | catch (ReplicationCliException rce) |
| | | { |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | errPrintln(); |
| | | errPrintln(getCriticalExceptionMessage(rce)); |
| | | returnValue = rce.getErrorCode(); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:"), rce); |
| | | } |
| | |
| | | } |
| | | catch (ReplicationCliException rce) |
| | | { |
| | | println(); |
| | | println(getCriticalExceptionMessage(rce)); |
| | | errPrintln(); |
| | | errPrintln(getCriticalExceptionMessage(rce)); |
| | | returnValue = rce.getErrorCode(); |
| | | logger.error(LocalizableMessage.raw("Complete error stack:"), rce); |
| | | } |
| | |
| | | alreadyReplicatedSuffixes.isEmpty()) |
| | | { |
| | | // Use a clarifying message: there is no replicated base DN. |
| | | println(ERR_NO_SUFFIXES_AVAILABLE_TO_ENABLE_REPLICATION_NO_DOMAIN.get()); |
| | | errPrintln(ERR_NO_SUFFIXES_AVAILABLE_TO_ENABLE_REPLICATION_NO_DOMAIN.get()); |
| | | } |
| | | else |
| | | { |
| | | println(ERR_NO_SUFFIXES_AVAILABLE_TO_ENABLE_REPLICATION.get()); |
| | | errPrintln(ERR_NO_SUFFIXES_AVAILABLE_TO_ENABLE_REPLICATION.get()); |
| | | } |
| | | |
| | | LinkedList<String> userProvidedSuffixes = argParser.getBaseDNs(); |
| | |
| | | suffixes.removeAll(alreadyReplicated); |
| | | if (notFound.size() > 0) |
| | | { |
| | | println(); |
| | | println(ERR_REPLICATION_ENABLE_SUFFIXES_NOT_FOUND.get(toSingleLine(notFound))); |
| | | errPrintln(); |
| | | errPrintln(ERR_REPLICATION_ENABLE_SUFFIXES_NOT_FOUND.get(toSingleLine(notFound))); |
| | | } |
| | | if (alreadyReplicated.size() > 0) |
| | | { |
| | |
| | | { |
| | | if (displayErrors) |
| | | { |
| | | println(); |
| | | println(ERR_NO_SUFFIXES_AVAILABLE_TO_DISABLE_REPLICATION.get()); |
| | | errPrintln(); |
| | | errPrintln(ERR_NO_SUFFIXES_AVAILABLE_TO_DISABLE_REPLICATION.get()); |
| | | } |
| | | LinkedList<String> userProvidedSuffixes = argParser.getBaseDNs(); |
| | | TreeSet<String> userProvidedNotReplicatedSuffixes = new TreeSet<String>(); |
| | |
| | | suffixes.removeAll(alreadyNotReplicated); |
| | | if (notFound.size() > 0 && displayErrors) |
| | | { |
| | | println(); |
| | | println(ERR_REPLICATION_DISABLE_SUFFIXES_NOT_FOUND.get(toSingleLine(notFound))); |
| | | errPrintln(); |
| | | errPrintln(ERR_REPLICATION_DISABLE_SUFFIXES_NOT_FOUND.get(toSingleLine(notFound))); |
| | | } |
| | | if (alreadyNotReplicated.size() > 0 && displayErrors) |
| | | { |
| | |
| | | // In interactive mode we do not propose to manage the administration suffix. |
| | | if (displayErrors) |
| | | { |
| | | println(); |
| | | println(ERR_NO_SUFFIXES_AVAILABLE_TO_DISABLE_REPLICATION.get()); |
| | | errPrintln(); |
| | | errPrintln(ERR_NO_SUFFIXES_AVAILABLE_TO_DISABLE_REPLICATION.get()); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | if (areSuffixRequired) |
| | | { |
| | | println(); |
| | | println(ERR_NO_SUFFIXES_SELECTED_TO_DISABLE.get()); |
| | | errPrintln(); |
| | | errPrintln(ERR_NO_SUFFIXES_SELECTED_TO_DISABLE.get()); |
| | | } |
| | | boolean confirmationLimitReached = |
| | | askConfirmations(INFO_REPLICATION_DISABLE_SUFFIX_PROMPT, availableSuffixes, suffixes); |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | println(ce.getMessageObject()); |
| | | errPrintln(ce.getMessageObject()); |
| | | return true; |
| | | } |
| | | } |
| | |
| | | println(); |
| | | if (argParser.isInitializeAllReplicationSubcommand()) |
| | | { |
| | | println(ERR_NO_SUFFIXES_AVAILABLE_TO_INITIALIZE_ALL_REPLICATION.get()); |
| | | errPrintln(ERR_NO_SUFFIXES_AVAILABLE_TO_INITIALIZE_ALL_REPLICATION.get()); |
| | | } |
| | | else |
| | | { |
| | | println( |
| | | errPrintln( |
| | | ERR_NO_SUFFIXES_AVAILABLE_TO_INITIALIZE_LOCAL_REPLICATION.get()); |
| | | } |
| | | LinkedList<String> userProvidedSuffixes = argParser.getBaseDNs(); |
| | |
| | | suffixes.removeAll(alreadyNotReplicated); |
| | | if (notFound.size() > 0) |
| | | { |
| | | println(); |
| | | println(ERR_REPLICATION_INITIALIZE_LOCAL_SUFFIXES_NOT_FOUND.get(toSingleLine(notFound))); |
| | | errPrintln(); |
| | | errPrintln(ERR_REPLICATION_INITIALIZE_LOCAL_SUFFIXES_NOT_FOUND.get(toSingleLine(notFound))); |
| | | } |
| | | if (alreadyNotReplicated.size() > 0) |
| | | { |
| | |
| | | // In interactive mode we do not propose to manage the administration suffix. |
| | | if (argParser.isInitializeAllReplicationSubcommand()) |
| | | { |
| | | println(ERR_NO_SUFFIXES_AVAILABLE_TO_INITIALIZE_ALL_REPLICATION.get()); |
| | | errPrintln(ERR_NO_SUFFIXES_AVAILABLE_TO_INITIALIZE_ALL_REPLICATION.get()); |
| | | } |
| | | else |
| | | { |
| | | println(ERR_NO_SUFFIXES_AVAILABLE_TO_INITIALIZE_LOCAL_REPLICATION.get()); |
| | | errPrintln(ERR_NO_SUFFIXES_AVAILABLE_TO_INITIALIZE_LOCAL_REPLICATION.get()); |
| | | } |
| | | break; |
| | | } |
| | |
| | | { |
| | | if (argParser.isInitializeAllReplicationSubcommand()) |
| | | { |
| | | println(ERR_NO_SUFFIXES_SELECTED_TO_INITIALIZE_ALL.get()); |
| | | errPrintln(ERR_NO_SUFFIXES_SELECTED_TO_INITIALIZE_ALL.get()); |
| | | } |
| | | else if (argParser.isPreExternalInitializationSubcommand()) |
| | | { |
| | | println(ERR_NO_SUFFIXES_SELECTED_TO_PRE_EXTERNAL_INITIALIZATION.get()); |
| | | errPrintln(ERR_NO_SUFFIXES_SELECTED_TO_PRE_EXTERNAL_INITIALIZATION.get()); |
| | | } |
| | | else if (argParser.isPostExternalInitializationSubcommand()) |
| | | { |
| | | println(ERR_NO_SUFFIXES_SELECTED_TO_POST_EXTERNAL_INITIALIZATION.get()); |
| | | errPrintln(ERR_NO_SUFFIXES_SELECTED_TO_POST_EXTERNAL_INITIALIZATION.get()); |
| | | } |
| | | |
| | | for (String dn : availableSuffixes) |
| | |
| | | } |
| | | catch (ClientException ce) |
| | | { |
| | | println(ce.getMessageObject()); |
| | | errPrintln(ce.getMessageObject()); |
| | | confirmationLimitReached = true; |
| | | break; |
| | | } |
| | |
| | | SuffixRelationType.REPLICATED)); |
| | | if (availableSuffixes.isEmpty()) |
| | | { |
| | | println(); |
| | | println(ERR_NO_SUFFIXES_AVAILABLE_TO_INITIALIZE_REPLICATION.get()); |
| | | errPrintln(); |
| | | errPrintln(ERR_NO_SUFFIXES_AVAILABLE_TO_INITIALIZE_REPLICATION.get()); |
| | | suffixes.clear(); |
| | | } |
| | | else |
| | |
| | | suffixes.removeAll(notFound); |
| | | if (notFound.size() > 0) |
| | | { |
| | | println(); |
| | | println(ERR_SUFFIXES_CANNOT_BE_INITIALIZED.get(toSingleLine(notFound))); |
| | | errPrintln(); |
| | | errPrintln(ERR_SUFFIXES_CANNOT_BE_INITIALIZED.get(toSingleLine(notFound))); |
| | | } |
| | | if (interactive) |
| | | { |
| | |
| | | } |
| | | if (!messages.isEmpty()) |
| | | { |
| | | println(ERR_REPLICATION_READING_REGISTERED_SERVERS_WARNING.get( |
| | | errPrintln(ERR_REPLICATION_READING_REGISTERED_SERVERS_WARNING.get( |
| | | getMessageFromCollection(messages, |
| | | Constants.LINE_SEPARATOR))); |
| | | } |
| | |
| | | LocalizableMessage warningMsg = |
| | | INFO_REPLICATION_ONLY_ONE_REPLICATION_SERVER_WARNING.get( |
| | | toSingleLine(baseDNsWithOneReplicationServer)); |
| | | println(warningMsg); |
| | | println(); |
| | | errPrintln(warningMsg); |
| | | errPrintln(); |
| | | } |
| | | } |
| | | |
| | |
| | | "Ignoring provided replication port for " |
| | | + "first server (already configured with port " |
| | | + server1.getReplicationServerPort() + ")")); |
| | | println(WARN_FIRST_REPLICATION_SERVER_ALREADY_CONFIGURED.get( |
| | | errPrintln(WARN_FIRST_REPLICATION_SERVER_ALREADY_CONFIGURED.get( |
| | | server1.getReplicationServerPort(), uData.getReplicationPort1())); |
| | | } |
| | | } |
| | |
| | | "Ignoring provided replication port for " |
| | | + "second server (already configured with port " |
| | | + server2.getReplicationServerPort() + ")")); |
| | | println(WARN_SECOND_REPLICATION_SERVER_ALREADY_CONFIGURED.get( |
| | | errPrintln(WARN_SECOND_REPLICATION_SERVER_ALREADY_CONFIGURED.get( |
| | | server2.getReplicationServerPort(), uData.getReplicationPort2())); |
| | | } |
| | | } |
| | |
| | | } |
| | | if (!messages.isEmpty()) |
| | | { |
| | | println( |
| | | errPrintln( |
| | | ERR_REPLICATION_READING_REGISTERED_SERVERS_WARNING.get( |
| | | getMessageFromCollection(messages, |
| | | Constants.LINE_SEPARATOR))); |
| | |
| | | Set<LocalizableMessage> messages = new LinkedHashSet<LocalizableMessage>(cache.getErrorMessages()); |
| | | if (!messages.isEmpty()) |
| | | { |
| | | println(ERR_REPLICATION_STATUS_READING_REGISTERED_SERVERS.get( |
| | | errPrintln(ERR_REPLICATION_STATUS_READING_REGISTERED_SERVERS.get( |
| | | getMessageFromCollection(messages, Constants.LINE_SEPARATOR))); |
| | | } |
| | | } |
| | |
| | | if (helper.isCompletedWithErrors(state)) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Completed with error: "+errorMsg)); |
| | | println(errorMsg); |
| | | errPrintln(errorMsg); |
| | | } |
| | | else if (!helper.isSuccessful(state) || |
| | | helper.isStoppedByError(state)) |
| | |
| | | logger.warn(LocalizableMessage.raw("Processed errorMsg: "+errorMsg)); |
| | | if (displayProgress) |
| | | { |
| | | println(errorMsg); |
| | | errPrintln(errorMsg); |
| | | } |
| | | } |
| | | else if (!helper.isSuccessful(state) || |
| | |
| | | } |
| | | catch (IOException ioe) |
| | | { |
| | | println(ERR_REPLICATION_ERROR_WRITING_EQUIVALENT_COMMAND_LINE.get(file, ioe)); |
| | | errPrintln(ERR_REPLICATION_ERROR_WRITING_EQUIVALENT_COMMAND_LINE.get(file, ioe)); |
| | | } |
| | | } |
| | | } |