}
private ClusterInstanceInfo convert(final String instanceName,
final List<IiopInfo> iiopInfoList)
{
ClusterInstanceInfo clusterInstanceInfo = null;
try {
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE,
"IiopFolbGmsClient.convert->: " + instanceName);
}
List<SocketInfo> listOfSocketInfo = new LinkedList<SocketInfo>();
int weight = -1;
// bug 6502567
// the list should never be null.
//Fix is already in Shoal workspace, but not integrated into 9.1FCS
if (iiopInfoList == null) {
_logger.fine("GMS did not return the list of members. list is empty.");
return null;
}
for (IiopInfo iiopInfo : iiopInfoList) {
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE,
"IiopFolbGmsClient.convert: " + instanceName
+ ": " + iiopInfo.toString());
}
// REVISIT
// Make sure all weights equal
if (weight == -1) {
weight = iiopInfo.getWeight();
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE,
"IiopFolbGmsClient.convert: "
+ instanceName
+ ": weight: " + Integer.toString(weight));
}
}
String type = iiopInfo.getID();
String host = iiopInfo.getAddress();
String port = iiopInfo.getPort();
// REVISIT - need to check all forms of "all interfaces"
if ("0.0.0.0".equals(host)) {
String hostname = iiopInfo.getHostName();
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE,
"IiopFolbGmsClient.convert: "
+ instanceName
+ ": host is: " + host
+ "; changing to: " + hostname);
}
host = hostname;
}
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE,
"IiopFolbGmsClient.convert: " + instanceName
+ ": type/host/port:"
+ " " + type + " " + host + " " + port);
}
listOfSocketInfo.add(
new SocketInfo(type, host, Integer.valueOf(port)));
}
// REVISIT - make orbutil utility
SocketInfo[] arrayOfSocketInfo =
new SocketInfo[listOfSocketInfo.size()];
int i = 0;
for (SocketInfo si : listOfSocketInfo) {
arrayOfSocketInfo[i++] = si;
}
clusterInstanceInfo =
new ClusterInstanceInfo(instanceName, weight,
arrayOfSocketInfo);
return clusterInstanceInfo;
} finally {