Map<String,LBConfig> result = new HashMap<String,LBConfig>();
Map<String,LBConfig> lbConfigMap = mDomainConfig.getLBConfigMap();
if (isCluster) {
for (String lbConfigName : lbConfigMap.keySet()) {
LBConfig lbConfig = lbConfigMap.get(lbConfigName);
Map<String,ClusterRefConfig> lbClusterRefConfigMap =
lbConfig.getClusterRefConfigMap();
for (String clusterRef : lbClusterRefConfigMap.keySet()) {
if (clusterRef.equals(targetName)) {
result.put(lbConfigName, lbConfig);
break;
}
}
}
} else if (isStandaloneServer(targetName)) {
/*its a serverName which means you have to find LBConfigs containing
1. standalone server references with the same name
2. clustered server references with the same name */
for (String lbConfigName : lbConfigMap.keySet()) {
LBConfig lbConfig = lbConfigMap.get(lbConfigName);
Map<String,ServerRefConfig> lbServerRefConfigMap =
lbConfig.getServerRefConfigMap();
for (String serverRef : lbServerRefConfigMap.keySet()) {
if (serverRef.equals(targetName)) {
result.put(lbConfigName, lbConfig);
break;
}
}
}
} else {//we assume that its a clustered instance name
for (String lbConfigName : lbConfigMap.keySet()) {
LBConfig lbConfig = lbConfigMap.get(lbConfigName);
Map<String,ClusterRefConfig> lbClusterRefConfigMap =
lbConfig.getClusterRefConfigMap();
Map<String,ClusterConfig> clusterConfigMap =
mDomainConfig.getClusterConfigMap();
Map<String,ClusterConfig> relevantClusterConfigMap = new HashMap<String,ClusterConfig>();
for (String clusterRef : lbClusterRefConfigMap.keySet())
relevantClusterConfigMap.put(clusterRef,