use of io.undertow.server.handlers.proxy.mod_cluster.ModClusterStatus in project wildfly by wildfly.
the class ModClusterResource method getChildrenNames.
@Override
public Set<String> getChildrenNames(final String childType) {
if (BALANCER.equals(childType)) {
ModClusterService service = service(name);
if (service == null) {
return Collections.emptySet();
}
ModCluster modCluster = service.getModCluster();
if (modCluster == null) {
return Collections.emptySet();
}
ModClusterController controller = modCluster.getController();
if (controller == null) {
return Collections.emptySet();
}
ModClusterStatus status = controller.getStatus();
final Set<String> result = new LinkedHashSet<>();
for (ModClusterStatus.LoadBalancer balancer : status.getLoadBalancers()) {
result.add(balancer.getName());
}
return result;
}
return delegate.getChildrenNames(childType);
}
use of io.undertow.server.handlers.proxy.mod_cluster.ModClusterStatus in project wildfly by wildfly.
the class ModClusterBalancerResource method getChildrenNames.
@Override
public Set<String> getChildrenNames(final String childType) {
if (NODE.equals(childType)) {
ModClusterService service = ModClusterResource.service(modClusterName);
if (service == null) {
return Collections.emptySet();
}
ModCluster modCluster = service.getModCluster();
ModClusterStatus status = modCluster.getController().getStatus();
final Set<String> result = new LinkedHashSet<>();
ModClusterStatus.LoadBalancer balancer = status.getLoadBalancer(this.name);
for (ModClusterStatus.Node node : balancer.getNodes()) {
result.add(node.getName());
}
return result;
} else if (LOAD_BALANCING_GROUP.equals(childType)) {
ModClusterService service = ModClusterResource.service(modClusterName);
if (service == null) {
return Collections.emptySet();
}
ModCluster modCluster = service.getModCluster();
ModClusterStatus status = modCluster.getController().getStatus();
final Set<String> result = new LinkedHashSet<>();
ModClusterStatus.LoadBalancer balancer = status.getLoadBalancer(this.name);
for (ModClusterStatus.Node node : balancer.getNodes()) {
result.add(node.getDomain());
}
return result;
}
return null;
}
use of io.undertow.server.handlers.proxy.mod_cluster.ModClusterStatus in project wildfly by wildfly.
the class ModClusterNodeResource method getChildrenNames.
@Override
public Set<String> getChildrenNames(final String childType) {
if (CONTEXT.equals(childType)) {
ModClusterService service = ModClusterResource.service(modClusterName);
if (service == null) {
return Collections.emptySet();
}
ModCluster modCluster = service.getModCluster();
ModClusterStatus status = modCluster.getController().getStatus();
final Set<String> result = new LinkedHashSet<>();
ModClusterStatus.LoadBalancer balancer = status.getLoadBalancer(this.balancerName);
ModClusterStatus.Node node = balancer.getNode(this.name);
for (ModClusterStatus.Context context : node.getContexts()) {
result.add(context.getName());
}
return result;
}
return null;
}
Aggregations