adsServers.addAll(suffix.getReplicationServers());
h.add(getLocalReplicationServer());
adsServers.add(getLocalReplicationServer());
for (ReplicaDescriptor replica : suffix.getReplicas())
{
ServerDescriptor server = replica.getServer();
AuthenticationData repPort
= getUserData().getRemoteWithNoReplicationPort().get(server);
if (repPort != null)
{
h.add(server.getHostName()+":"+repPort.getPort());
adsServers.add(server.getHostName()+":"+repPort.getPort());
}
}
replicationServers.put(suffix.getDN(), h);
}
}
replicationServers.put(ADSContext.getAdministrationSuffixDN(), adsServers);
replicationServers.put(Constants.SCHEMA_DN,
new HashSet<String>(adsServers));
InitialLdapContext ctx = null;
long localTime = -1;
long localTimeMeasureTime = -1;
String localServerDisplay = null;
try
{
ctx = createLocalContext();
helper.configureReplication(ctx, replicationServers,
getUserData().getReplicationOptions().getReplicationPort(),
getUserData().getReplicationOptions().useSecureReplication(),
getLocalHostPort(),
knownReplicationServerIds, knownServerIds);
localTimeMeasureTime = System.currentTimeMillis();
localTime = Utils.getServerClock(ctx);
localServerDisplay = ConnectionUtils.getHostPort(ctx);
}
catch (ApplicationException ae)
{
throw ae;
}
catch (NamingException ne)
{
Message failedMsg = getThrowableMsg(
INFO_ERROR_CONNECTING_TO_LOCAL.get(), ne);
throw new ApplicationException(
ReturnCode.CONFIGURATION_ERROR, failedMsg, ne);
}
finally
{
try
{
if (ctx != null)
{
ctx.close();
}
}
catch (Throwable t)
{
}
}
notifyListeners(getFormattedDoneWithLineBreak());
checkAbort();
if (getUserData().getReplicationOptions().getType()
== DataReplicationOptions.Type.IN_EXISTING_TOPOLOGY)
{
Map<ServerDescriptor, Set<ReplicaDescriptor>> hm =
new HashMap<ServerDescriptor, Set<ReplicaDescriptor>>();
for (SuffixDescriptor suffix :
getUserData().getSuffixesToReplicateOptions().getSuffixes())
{
for (ReplicaDescriptor replica : suffix.getReplicas())
{
Set<ReplicaDescriptor> replicas = hm.get(replica.getServer());
if (replicas == null)
{
replicas = new HashSet<ReplicaDescriptor>();
hm.put(replica.getServer(), replicas);
}
replicas.add(replica);
}
}
for (ServerDescriptor server : hm.keySet())
{
notifyListeners(getFormattedWithPoints(
INFO_PROGRESS_CONFIGURING_REPLICATION_REMOTE.get(
getHostPort(server))));
Integer v = (Integer)server.getServerProperties().get(
ServerDescriptor.ServerProperty.REPLICATION_SERVER_PORT);
int replicationPort;
boolean enableSecureReplication;
if (v != null)
{