Search in sources :

Example 1 with UndertowListener

use of org.wildfly.extension.undertow.UndertowListener in project wildfly by wildfly.

the class ServerConfigImpl method getVirtualHostPort.

@Override
public Integer getVirtualHostPort(String hostname, boolean securePort) {
    ServerHostInfo hostInfo = new ServerHostInfo(hostname);
    Host undertowHost = getUndertowHost(hostInfo);
    if (undertowHost != null && !undertowHost.getServer().getListeners().isEmpty()) {
        for (UndertowListener listener : undertowHost.getServer().getListeners()) {
            if (listener.isSecure() == securePort) {
                return listener.getSocketBinding().getAbsolutePort();
            }
        }
    }
    return null;
}
Also used : Host(org.wildfly.extension.undertow.Host) UndertowListener(org.wildfly.extension.undertow.UndertowListener)

Aggregations

Host (org.wildfly.extension.undertow.Host)1 UndertowListener (org.wildfly.extension.undertow.UndertowListener)1