Set<ServerDescriptor> serversToUpdate =
new LinkedHashSet<ServerDescriptor>();
Set<String> baseDNsToUpdate = new HashSet<String>(suffixesToDisable);
for (String baseDN : baseDNsToUpdate)
{
SuffixDescriptor suffix = getSuffix(baseDN, cache, server);
if (suffix != null)
{
for (ReplicaDescriptor replica : suffix.getReplicas())
{
serversToUpdate.add(replica.getServer());
}
}
}
if (disableReplicationServer)
{
// Find references in all servers.
Set<SuffixDescriptor> suffixes = cache.getSuffixes();
for (SuffixDescriptor suffix : suffixes)
{
boolean found = false;
for (String repServer : suffix.getReplicationServers())
{
found = repServer.equalsIgnoreCase(replicationServerHostPort);
if (found)
{
break;
}
}
if (found)
{
baseDNsToUpdate.add(suffix.getDN());
for (ReplicaDescriptor replica : suffix.getReplicas())
{
serversToUpdate.add(replica.getServer());
}
}
}