ClusterManagerImpl.log.warn("Must specify an address for each cluster connection. This one will not be deployed.");
return;
}
ClusterConnection clusterConnection;
List<Pair<TransportConfiguration, TransportConfiguration>> connectors = new ArrayList<Pair<TransportConfiguration, TransportConfiguration>>();
if (config.getStaticConnectorNamePairs() != null)
{
for (Pair<String, String> connectorNamePair : config.getStaticConnectorNamePairs())
{
TransportConfiguration connector = configuration.getConnectorConfigurations().get(connectorNamePair.a);
if (connector == null)
{
ClusterManagerImpl.log.warn("No connector defined with name '" + connectorNamePair.a +
"'. The cluster connection will not be deployed.");
return;
}
TransportConfiguration backupConnector = null;
if (connectorNamePair.b != null)
{
backupConnector = configuration.getConnectorConfigurations().get(connectorNamePair.b);
if (backupConnector == null)
{
ClusterManagerImpl.log.warn("No connector defined with name '" + connectorNamePair.b +
"'. The cluster connection will not be deployed.");
return;
}
}
Pair<TransportConfiguration, TransportConfiguration> pair = new Pair<TransportConfiguration, TransportConfiguration>(connector,
backupConnector);
connectors.add(pair);
}
clusterConnection = new ClusterConnectionImpl(new SimpleString(config.getName()),
new SimpleString(config.getAddress()),
config.getRetryInterval(),
config.isDuplicateDetection(),
config.isForwardWhenNoConsumers(),
config.getConfirmationWindowSize(),
executorFactory,
server,
postOffice,
managementService,
scheduledExecutor,
connectors,
config.getMaxHops(),
nodeUUID,
backup,
server.getConfiguration().getClusterUser(),
server.getConfiguration().getClusterPassword());
}
else
{
DiscoveryGroup dg = discoveryGroups.get(config.getDiscoveryGroupName());
if (dg == null)
{
ClusterManagerImpl.log.warn("No discovery group with name '" + config.getDiscoveryGroupName() +
"'. The cluster connection will not be deployed.");
}
clusterConnection = new ClusterConnectionImpl(new SimpleString(config.getName()),
new SimpleString(config.getAddress()),
config.getRetryInterval(),
config.isDuplicateDetection(),
config.isForwardWhenNoConsumers(),
config.getConfirmationWindowSize(),
executorFactory,
server,
postOffice,
managementService,
scheduledExecutor,
dg,
config.getMaxHops(),
nodeUUID,
backup,
server.getConfiguration().getClusterUser(),
server.getConfiguration().getClusterPassword());
}
managementService.registerCluster(clusterConnection, config);
clusters.put(config.getName(), clusterConnection);
clusterConnection.start();
}