Search in sources :

Example 1 with IIOPAddress

use of com.sun.corba.se.spi.ior.iiop.IIOPAddress 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;
}
Also used : TransportAddress(org.omg.CSIIOP.TransportAddress) IIOPAddress(com.sun.corba.se.spi.ior.iiop.IIOPAddress) ArrayList(java.util.ArrayList) IIOPProfileTemplate(com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate) IORToSocketInfo(com.sun.corba.se.spi.transport.IORToSocketInfo) SocketInfo(com.sun.corba.se.spi.transport.SocketInfo) ArrayList(java.util.ArrayList) List(java.util.List) CompoundSecMechList(org.omg.CSIIOP.CompoundSecMechList) SSL(org.omg.SSLIOP.SSL)

Aggregations

IIOPAddress (com.sun.corba.se.spi.ior.iiop.IIOPAddress)1 IIOPProfileTemplate (com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate)1 IORToSocketInfo (com.sun.corba.se.spi.transport.IORToSocketInfo)1 SocketInfo (com.sun.corba.se.spi.transport.SocketInfo)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 CompoundSecMechList (org.omg.CSIIOP.CompoundSecMechList)1 TransportAddress (org.omg.CSIIOP.TransportAddress)1 SSL (org.omg.SSLIOP.SSL)1