Search in sources :

Example 11 with ClusterInstanceInfo

use of com.sun.corba.ee.spi.folb.ClusterInstanceInfo in project Payara by payara.

the class RoundRobinPolicy method filterClusterInfo.

private List<ClusterInstanceInfo> filterClusterInfo(List<ClusterInstanceInfo> info) {
    boolean isw = isWeighted();
    ArrayList<ClusterInstanceInfo> newList = new ArrayList<ClusterInstanceInfo>();
    totalWeight = 0;
    for (ClusterInstanceInfo clinfo : info) {
        final int newWeight = isw ? clinfo.weight() : default_weight;
        final List<SocketInfo> newEndpoints = filterSocketInfos(clinfo.endpoints());
        final ClusterInstanceInfo newClinfo = new ClusterInstanceInfo(clinfo.name(), newWeight, newEndpoints);
        newList.add(newClinfo);
        totalWeight += newWeight;
    }
    return newList;
}
Also used : ArrayList(java.util.ArrayList) SocketInfo(com.sun.corba.ee.spi.folb.SocketInfo) ClusterInstanceInfo(com.sun.corba.ee.spi.folb.ClusterInstanceInfo)

Example 12 with ClusterInstanceInfo

use of com.sun.corba.ee.spi.folb.ClusterInstanceInfo in project Payara by payara.

the class RoundRobinPolicy method toString.

@Override
public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("RoundRobinPolicy[");
    boolean first = true;
    for (ClusterInstanceInfo endpoint : endpointsList) {
        if (first) {
            first = false;
        } else {
            sb.append(' ');
        }
        sb.append(endpoint.toString());
    }
    sb.append(']');
    return sb.toString();
}
Also used : ClusterInstanceInfo(com.sun.corba.ee.spi.folb.ClusterInstanceInfo)

Example 13 with ClusterInstanceInfo

use of com.sun.corba.ee.spi.folb.ClusterInstanceInfo in project Payara by payara.

the class CSIv2SSLTaggedComponentHandlerImpl method insert.

// //////////////////////////////////////////////////
// 
// CSIv2SSLTaggedComponentHandler
// 
@Override
public TaggedComponent insert(IORInfo iorInfo, List<ClusterInstanceInfo> clusterInstanceInfo) {
    TaggedComponent result = null;
    try {
        if (_logger.isLoggable(Level.FINE)) {
            _logger.log(Level.FINE, "{0}.insert->:", baseMsg);
        }
        List<com.sun.corba.ee.spi.folb.SocketInfo> socketInfos = new ArrayList<com.sun.corba.ee.spi.folb.SocketInfo>();
        for (ClusterInstanceInfo clInstInfo : clusterInstanceInfo) {
            for (com.sun.corba.ee.spi.folb.SocketInfo sinfo : clInstInfo.endpoints()) {
                if (sinfo.type().equals("SSL") || sinfo.type().equals("SSL_MUTUALAUTH")) {
                    socketInfos.add(sinfo);
                }
            }
        }
        IIOPSSLUtil sslUtil = null;
        if (Globals.getDefaultHabitat() != null) {
            sslUtil = Globals.getDefaultHabitat().getService(IIOPSSLUtil.class);
            return sslUtil.createSSLTaggedComponent(iorInfo, socketInfos);
        } else {
            return null;
        }
    } finally {
        if (_logger.isLoggable(Level.FINE)) {
            _logger.log(Level.FINE, "{0}.insert<-: {1}", new Object[] { baseMsg, result });
        }
    }
}
Also used : SocketInfo(com.sun.corba.ee.spi.transport.SocketInfo) ArrayList(java.util.ArrayList) IIOPSSLUtil(org.glassfish.enterprise.iiop.api.IIOPSSLUtil) TaggedComponent(org.omg.IOP.TaggedComponent) ClusterInstanceInfo(com.sun.corba.ee.spi.folb.ClusterInstanceInfo)

Aggregations

ClusterInstanceInfo (com.sun.corba.ee.spi.folb.ClusterInstanceInfo)13 ArrayList (java.util.ArrayList)6 SocketInfo (com.sun.corba.ee.spi.folb.SocketInfo)5 Config (com.sun.enterprise.config.serverbeans.Config)2 Server (com.sun.enterprise.config.serverbeans.Server)2 LinkedList (java.util.LinkedList)2 GroupInfoService (com.sun.corba.ee.spi.folb.GroupInfoService)1 SocketInfo (com.sun.corba.ee.spi.transport.SocketInfo)1 Cluster (com.sun.enterprise.config.serverbeans.Cluster)1 Node (com.sun.enterprise.config.serverbeans.Node)1 Servers (com.sun.enterprise.config.serverbeans.Servers)1 PayaraCluster (fish.payara.nucleus.cluster.PayaraCluster)1 UnknownHostException (java.net.UnknownHostException)1 HashMap (java.util.HashMap)1 IIOPSSLUtil (org.glassfish.enterprise.iiop.api.IIOPSSLUtil)1 IiopListener (org.glassfish.orb.admin.config.IiopListener)1 IiopService (org.glassfish.orb.admin.config.IiopService)1 InvalidName (org.omg.CORBA.ORBPackage.InvalidName)1 TaggedComponent (org.omg.IOP.TaggedComponent)1