Search in sources :

Example 1 with ModClusterController

use of io.undertow.server.handlers.proxy.mod_cluster.ModClusterController 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);
}
Also used : LinkedHashSet(java.util.LinkedHashSet) ModCluster(io.undertow.server.handlers.proxy.mod_cluster.ModCluster) ModClusterController(io.undertow.server.handlers.proxy.mod_cluster.ModClusterController) ModClusterStatus(io.undertow.server.handlers.proxy.mod_cluster.ModClusterStatus)

Aggregations

ModCluster (io.undertow.server.handlers.proxy.mod_cluster.ModCluster)1 ModClusterController (io.undertow.server.handlers.proxy.mod_cluster.ModClusterController)1 ModClusterStatus (io.undertow.server.handlers.proxy.mod_cluster.ModClusterStatus)1 LinkedHashSet (java.util.LinkedHashSet)1