use of com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate in project wildfly by wildfly.
the class CSIV2IORToSocketInfo method getSocketInfo.
public List getSocketInfo(IOR ior) {
List result = new ArrayList();
IIOPProfileTemplate iiopProfileTemplate = (IIOPProfileTemplate) ior.getProfile().getTaggedProfileTemplate();
IIOPAddress primary = iiopProfileTemplate.getPrimaryAddress();
String hostname = primary.getHost().toLowerCase(Locale.ENGLISH);
int primaryPort = primary.getPort();
// NOTE: we could check for 0 (i.e., CSIv2) but, for a
// non-CSIv2-configured client ORB talking to a CSIv2 configured
// server ORB you might end up with an empty contact info list
// which would then report a failure which would not be as
// instructive as leaving a ContactInfo with a 0 port in the list.
SocketInfo socketInfo;
TransportAddress sslAddress = selectSSLTransportAddress(ior);
SSL ssl = getSSL(ior);
if (sslAddress != null) {
socketInfo = createSSLSocketInfo(hostname, sslAddress.port);
} else if (ssl != null) {
socketInfo = createSSLSocketInfo(hostname, ssl.port);
} else {
// FIXME not all corba object export ssl port
// if (clientRequiresSsl) {
// throw new RuntimeException("Client requires SSL but target does not support it");
// }
socketInfo = createSocketInfo(hostname, primaryPort);
}
result.add(socketInfo);
addAlternateSocketInfos(iiopProfileTemplate, result);
return result;
}
Aggregations