if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, baseMsg + ".getSocketInfo->:");
}
List result = new ArrayList();
SecurityMechanismSelector selector = new SecurityMechanismSelector();
IIOPProfileTemplate iiopProfileTemplate = (IIOPProfileTemplate)ior.
getProfile().getTaggedProfileTemplate();
IIOPAddress primary = iiopProfileTemplate.getPrimaryAddress() ;
String host = primary.getHost().toLowerCase();
String type = null;
int port = 0;
ConnectionContext ctx = new ConnectionContext();
SocketInfo socketInfo = selector.getSSLPort(ior, ctx);
selector.setClientConnectionContext(ctx);
if (socketInfo == null) {
type = SocketInfo.IIOP_CLEAR_TEXT;
port = primary.getPort();
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, baseMsg
+ ".getSocketInfo: did not find SSL SocketInfo");
}
} else {
type = socketInfo.getType();
port = socketInfo.getPort();
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, baseMsg
+ ".getSocketInfo: found SSL socketInfo");
}
}
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, baseMsg
+ ".getSocketInfo: Connection Context:" + ctx);
_logger.log(Level.FINE, baseMsg
+ ".getSocketInfo: ENDPOINT INFO:type=" + type + ",host=" +host + ", port=" + port);
}
// for SSL
if (socketInfo != null ) {
result.add(socketInfo);
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, baseMsg
+ ".getSocketInfo: returning SSL socketInfo:"
+ " " + socketInfo.getType()
+ " " + socketInfo.getHost()
+ " " + socketInfo.getPort());
}
// REVISIT: should call IIOPPrimaryToContactInfo.reset
// right here to invalidate sticky for this result.
// However, SSL and IIOP-FO is not a supported feature.
return result;
}
////////////////////////////////////////////////////
//
// The remainder of this code is non-SSL.
// Author: Harold Carr
// Please contact author is changes needed.
//
// for non-SSL
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, baseMsg
+ ".getSocketInfo: returning non SSL socketInfo");
}
if (! previous.isEmpty()) {
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, baseMsg
+ ".getSocketInfo: returning previous socketInfo: "
+ previous);
}
return previous;
}
//
// Save and add primary address
//
SocketInfo primarySocketInfo =
createSocketInfo("primary", type, host, port);
result.add(primarySocketInfo);
//
// List alternate addresses.
//
Iterator iterator = iiopProfileTemplate.iteratorById(
org.omg.IOP.TAG_ALTERNATE_IIOP_ADDRESS.value
);
while (iterator.hasNext()) {
AlternateIIOPAddressComponent alternate =