Search in sources :

Example 6 with ClusterReader

use of org.glassfish.loadbalancer.admin.cli.reader.api.ClusterReader in project Payara by payara.

the class LoadbalancerReaderImpl method getClustersDataFromLBConfig.

public ClusterReader[] getClustersDataFromLBConfig() throws LbReaderException {
    List<Ref> serverOrClusters = _lbConfig.getClusterRefOrServerRef();
    ClusterReader[] cls = new ClusterReader[serverOrClusters.size()];
    Iterator<Ref> iter = serverOrClusters.iterator();
    int i = 0;
    while (iter.hasNext()) {
        Ref ref = iter.next();
        if (ref instanceof ServerRef) {
            cls[i++] = new StandAloneClusterReaderImpl(_domain, _appRegistry, (ServerRef) ref);
        } else if (ref instanceof ClusterRef) {
            cls[i++] = new ClusterReaderImpl(_domain, _appRegistry, (ClusterRef) ref);
        } else {
            String msg = LbLogUtil.getStringManager().getString("UnableToDetermineType", ref.getRef());
            throw new LbReaderException(msg);
        }
    }
    return cls;
}
Also used : ClusterRef(com.sun.enterprise.config.serverbeans.ClusterRef) Ref(com.sun.enterprise.config.serverbeans.Ref) ServerRef(com.sun.enterprise.config.serverbeans.ServerRef) ClusterReader(org.glassfish.loadbalancer.admin.cli.reader.api.ClusterReader) ServerRef(com.sun.enterprise.config.serverbeans.ServerRef) ClusterRef(com.sun.enterprise.config.serverbeans.ClusterRef) LbReaderException(org.glassfish.loadbalancer.admin.cli.reader.api.LbReaderException)

Aggregations

ClusterReader (org.glassfish.loadbalancer.admin.cli.reader.api.ClusterReader)6 InstanceReader (org.glassfish.loadbalancer.admin.cli.reader.api.InstanceReader)3 WebModuleReader (org.glassfish.loadbalancer.admin.cli.reader.api.WebModuleReader)3 Properties (java.util.Properties)2 StringTokenizer (java.util.StringTokenizer)2 Loadbalancer (org.glassfish.loadbalancer.admin.cli.beans.Loadbalancer)2 LbReaderException (org.glassfish.loadbalancer.admin.cli.reader.api.LbReaderException)2 LoadbalancerVisitor (org.glassfish.loadbalancer.admin.cli.transform.LoadbalancerVisitor)2 Cluster (com.sun.enterprise.config.serverbeans.Cluster)1 ClusterRef (com.sun.enterprise.config.serverbeans.ClusterRef)1 Ref (com.sun.enterprise.config.serverbeans.Ref)1 Server (com.sun.enterprise.config.serverbeans.Server)1 ServerRef (com.sun.enterprise.config.serverbeans.ServerRef)1 Cluster (org.glassfish.loadbalancer.admin.cli.beans.Cluster)1 Property (org.glassfish.loadbalancer.admin.cli.beans.Property)1 WebModule (org.glassfish.loadbalancer.admin.cli.beans.WebModule)1 HealthCheckerReader (org.glassfish.loadbalancer.admin.cli.reader.api.HealthCheckerReader)1 LoadbalancerReader (org.glassfish.loadbalancer.admin.cli.reader.api.LoadbalancerReader)1 PropertyReader (org.glassfish.loadbalancer.admin.cli.reader.api.PropertyReader)1