| | |
| | | PurgeHistoricalUserData uData) |
| | | { |
| | | ReplicationCliReturnCode returnValue; |
| | | LinkedList<String> baseDNs = uData.getBaseDNs(); |
| | | List<String> baseDNs = uData.getBaseDNs(); |
| | | checkSuffixesForLocalPurgeHistorical(baseDNs, false); |
| | | if (!baseDNs.isEmpty()) |
| | | { |
| | |
| | | |
| | | if (ctx != null) |
| | | { |
| | | LinkedList<String> baseDNs = uData.getBaseDNs(); |
| | | List<String> baseDNs = uData.getBaseDNs(); |
| | | checkSuffixesForPurgeHistorical(baseDNs, ctx, false); |
| | | if (!baseDNs.isEmpty()) |
| | | { |
| | |
| | | String bindDn1 = argParser.getBindDn1(); |
| | | String pwd1 = argParser.getBindPassword1(); |
| | | String pwd = null; |
| | | LinkedHashMap<String, String> pwdFile = null; |
| | | Map<String, String> pwdFile = null; |
| | | if (argParser.bindPassword1Arg.isPresent()) |
| | | { |
| | | pwd = argParser.bindPassword1Arg.getValue(); |
| | |
| | | String hostSource = argParser.getHostNameSource(); |
| | | int portSource = argParser.getPortSource(); |
| | | |
| | | LinkedHashMap<String, String> pwdFile = null; |
| | | Map<String, String> pwdFile = null; |
| | | |
| | | if (argParser.getSecureArgsList().bindPasswordFileArg.isPresent()) |
| | | { |
| | |
| | | |
| | | if (errorMessages.isEmpty()) |
| | | { |
| | | LinkedList<String> suffixes = uData.getBaseDNs(); |
| | | List<String> suffixes = uData.getBaseDNs(); |
| | | checkSuffixesForEnableReplication(suffixes, ctx1, ctx2, false, uData); |
| | | if (!suffixes.isEmpty()) |
| | | { |
| | |
| | | // This done is for the message informing that we are connecting. |
| | | printProgress(formatter.getFormattedDone()); |
| | | printlnProgress(); |
| | | LinkedList<String> suffixes = uData.getBaseDNs(); |
| | | List<String> suffixes = uData.getBaseDNs(); |
| | | checkSuffixesForDisableReplication(suffixes, ctx, false, |
| | | !uData.disableReplicationServer(), !uData.disableReplicationServer()); |
| | | if (!suffixes.isEmpty() || uData.disableReplicationServer() || |
| | |
| | | |
| | | if ((ctxSource != null) && (ctxDestination != null)) |
| | | { |
| | | LinkedList<String> baseDNs = uData.getBaseDNs(); |
| | | List<String> baseDNs = uData.getBaseDNs(); |
| | | checkSuffixesForInitializeReplication(baseDNs, ctxSource, ctxDestination, |
| | | false); |
| | | if (!baseDNs.isEmpty()) |
| | |
| | | } |
| | | if (ctx != null) |
| | | { |
| | | LinkedList<String> baseDNs = uData.getBaseDNs(); |
| | | List<String> baseDNs = uData.getBaseDNs(); |
| | | checkSuffixesForInitializeReplication(baseDNs, ctx, false); |
| | | if (!baseDNs.isEmpty()) |
| | | { |
| | |
| | | } |
| | | if (ctx != null) |
| | | { |
| | | LinkedList<String> baseDNs = uData.getBaseDNs(); |
| | | List<String> baseDNs = uData.getBaseDNs(); |
| | | checkSuffixesForInitializeReplication(baseDNs, ctx, false); |
| | | if (!baseDNs.isEmpty()) |
| | | { |
| | |
| | | } |
| | | if (ctx != null) |
| | | { |
| | | LinkedList<String> baseDNs = uData.getBaseDNs(); |
| | | List<String> baseDNs = uData.getBaseDNs(); |
| | | checkSuffixesForInitializeReplication(baseDNs, ctx, false); |
| | | if (!baseDNs.isEmpty()) |
| | | { |
| | |
| | | InitialLdapContext ctx2, EnableReplicationUserData uData) |
| | | throws ReplicationCliException |
| | | { |
| | | LinkedHashSet<String> twoReplServers = new LinkedHashSet<String>(); |
| | | LinkedHashSet<String> allRepServers = new LinkedHashSet<String>(); |
| | | HashMap<String, LinkedHashSet<String>> hmRepServers = |
| | | new HashMap<String, LinkedHashSet<String>>(); |
| | | Set<Integer> usedReplicationServerIds = new HashSet<Integer>(); |
| | | HashMap<String, Set<Integer>> hmUsedReplicationDomainIds = |
| | | final Set<String> twoReplServers = new LinkedHashSet<String>(); |
| | | final Set<String> allRepServers = new LinkedHashSet<String>(); |
| | | final Map<String, Set<String>> hmRepServers = |
| | | new HashMap<String, Set<String>>(); |
| | | final Set<Integer> usedReplicationServerIds = new HashSet<Integer>(); |
| | | final Map<String, Set<Integer>> hmUsedReplicationDomainIds = |
| | | new HashMap<String, Set<Integer>>(); |
| | | |
| | | ServerDescriptor server1; |
| | |
| | | { |
| | | // Inform the user of the potential errors that we found in the already |
| | | // registered servers. |
| | | LinkedHashSet<Message> messages = new LinkedHashSet<Message>(); |
| | | final Set<Message> messages = new LinkedHashSet<Message>(); |
| | | try |
| | | { |
| | | LinkedHashSet<PreferredConnection> cnx = |
| | | final Set<PreferredConnection> cnx = |
| | | new LinkedHashSet<PreferredConnection>(); |
| | | cnx.addAll(PreferredConnection.getPreferredConnections(ctx1)); |
| | | cnx.addAll(PreferredConnection.getPreferredConnections(ctx2)); |
| | |
| | | printProgress(formatter.getFormattedDone()); |
| | | printlnProgress(); |
| | | } |
| | | LinkedList<String> baseDNs = uData.getBaseDNs(); |
| | | List<String> baseDNs = uData.getBaseDNs(); |
| | | if (!adsAlreadyReplicated) |
| | | { |
| | | boolean found = false; |
| | |
| | | |
| | | try |
| | | { |
| | | LinkedHashSet<PreferredConnection> cnx = |
| | | Set<PreferredConnection> cnx = |
| | | new LinkedHashSet<PreferredConnection>(); |
| | | cnx.addAll(PreferredConnection.getPreferredConnections(ctx1)); |
| | | cnx.addAll(PreferredConnection.getPreferredConnections(ctx2)); |
| | |
| | | |
| | | for (String baseDN : uData.getBaseDNs()) |
| | | { |
| | | LinkedHashSet<String> repServersForBaseDN = new LinkedHashSet<String>(); |
| | | Set<String> repServersForBaseDN = new LinkedHashSet<String>(); |
| | | repServersForBaseDN.addAll(getReplicationServers(baseDN, cache1, |
| | | server1)); |
| | | repServersForBaseDN.addAll(getReplicationServers(baseDN, cache2, |
| | |
| | | if (!argParser.isInteractive()) |
| | | { |
| | | // Inform the user of the potential errors that we found. |
| | | LinkedHashSet<Message> messages = new LinkedHashSet<Message>(); |
| | | Set<Message> messages = new LinkedHashSet<Message>(); |
| | | if (cache != null) |
| | | { |
| | | messages.addAll(cache.getErrorMessages()); |
| | |
| | | // Inform the user |
| | | if (beforeLastRepServer.size() > 0) |
| | | { |
| | | LinkedHashSet<String> baseDNs = new LinkedHashSet<String>(); |
| | | Set<String> baseDNs = new LinkedHashSet<String>(); |
| | | for (SuffixDescriptor suffix : beforeLastRepServer) |
| | | { |
| | | if (!Utils.areDnsEqual(suffix.getDN(), |
| | |
| | | { |
| | | // Check that there are other replicas and that this message, really |
| | | // makes sense to be displayed. |
| | | LinkedHashSet<String> suffixArg = new LinkedHashSet<String>(); |
| | | Set<String> suffixArg = new LinkedHashSet<String>(); |
| | | for (SuffixDescriptor suffix : lastRepServer) |
| | | { |
| | | boolean baseDNSpecified = false; |
| | |
| | | if (!argParser.isInteractive()) |
| | | { |
| | | // Inform the user of the potential errors that we found. |
| | | LinkedHashSet<Message> messages = new LinkedHashSet<Message>(); |
| | | Set<Message> messages = new LinkedHashSet<Message>(); |
| | | messages.addAll(cache.getErrorMessages()); |
| | | if (!messages.isEmpty()) |
| | | { |
| | |
| | | */ |
| | | private void displayStatus( |
| | | List<Set<ReplicaDescriptor>> orderedReplicaLists, |
| | | boolean scriptFriendly, LinkedHashSet<PreferredConnection> cnx, |
| | | boolean scriptFriendly, Set<PreferredConnection> cnx, |
| | | Set<ServerDescriptor> servers, |
| | | Set<ReplicaDescriptor> replicasWithNoReplicationServer, |
| | | Set<ServerDescriptor> serversWithNoReplica) |
| | |
| | | * @param scriptFriendly wheter to display it on script-friendly mode or not. |
| | | */ |
| | | private void displayStatus(Set<ServerDescriptor> servers, |
| | | boolean scriptFriendly, LinkedHashSet<PreferredConnection> cnx) |
| | | boolean scriptFriendly, Set<PreferredConnection> cnx) |
| | | { |
| | | TableBuilder tableBuilder = new TableBuilder(); |
| | | tableBuilder.appendHeading(INFO_REPLICATION_STATUS_HEADER_SERVERPORT.get()); |
| | |
| | | */ |
| | | private void configureAsReplicationServer(InitialLdapContext ctx, |
| | | int replicationPort, boolean useSecureReplication, |
| | | LinkedHashSet<String> replicationServers, |
| | | Set<String> replicationServers, |
| | | Set<Integer> usedReplicationServerIds) throws OpenDsException |
| | | { |
| | | printProgress(formatter.getFormattedWithPoints( |
| | |
| | | private void removeReferencesInServer(ServerDescriptor server, |
| | | String replicationServer, String bindDn, String pwd, |
| | | Collection<String> baseDNs, boolean updateReplicationServers, |
| | | LinkedHashSet<PreferredConnection> cnx) |
| | | Set<PreferredConnection> cnx) |
| | | throws ReplicationCliException |
| | | { |
| | | TopologyCacheFilter filter = new TopologyCacheFilter(); |
| | |
| | | ReplicationUserData uData) |
| | | throws ArgumentException |
| | | { |
| | | LinkedList<String> baseDNs = uData.getBaseDNs(); |
| | | List<String> baseDNs = uData.getBaseDNs(); |
| | | StringArgument baseDNsArg = new StringArgument("baseDNs", |
| | | OPTION_SHORT_BASEDN, |
| | | OPTION_LONG_BASEDN, false, true, true, INFO_BASEDN_PLACEHOLDER.get(), |
| | |
| | | PointAdder pointAdder = new PointAdder(this); |
| | | try |
| | | { |
| | | LinkedHashSet<PreferredConnection> cnx = |
| | | Set<PreferredConnection> cnx = |
| | | new LinkedHashSet<PreferredConnection>(); |
| | | cnx.addAll(PreferredConnection.getPreferredConnections( |
| | | adsCtx1.getDirContext())); |