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;
}
Aggregations