public ModClusterProxyTarget findTarget ( final HttpServerExchange exchange ) { // There is an option to disable the virtual host check, probably a default virtual host final PathMatcher . PathMatch < VirtualHost . HostEntry > entry = mapVirtualHost ( exchange ) ; if ( entry == null ) { return null ; } for ( final Balancer balancer : balancers . values ( ) ) { final Map < String , Cookie > cookies = exchange . getRequestCookies ( ) ; if ( balancer . isStickySession ( ) ) { if ( cookies . containsKey ( balancer . getStickySessionCookie ( ) ) ) { String sessionId = cookies . get ( balancer . getStickySessionCookie ( ) ) . getValue ( ) ; Iterator < CharSequence > routes = parseRoutes ( sessionId ) ; if ( routes . hasNext ( ) ) { return new ModClusterProxyTarget . ExistingSessionTarget ( sessionId , routes , entry . getValue ( ) , this , balancer . isStickySessionForce ( ) ) ; } } if ( exchange . getPathParameters ( ) . containsKey ( balancer . getStickySessionPath ( ) ) ) { String sessionId = exchange . getPathParameters ( ) . get ( balancer . getStickySessionPath ( ) ) . getFirst ( ) ; Iterator < CharSequence > jvmRoute = parseRoutes ( sessionId ) ; if ( jvmRoute . hasNext ( ) ) { return new ModClusterProxyTarget . ExistingSessionTarget ( sessionId , jvmRoute , entry . getValue ( ) , this , balancer . isStickySessionForce ( ) ) ; } } } } return new ModClusterProxyTarget . BasicTarget ( entry . getValue ( ) , this ) ; }
Get the mod_cluster proxy target .