public static class RequestRouter.Builder<T> extends Object
Modifier and Type | Method and Description |
---|---|
RequestRouter.Builder<T> |
addRoute(String hostname,
String pathPattern,
T handler)
Adds a route with given hostname and path pattern.
|
RequestRouter.Builder<T> |
addRoute(URIAuthority authority,
String pathPattern,
T handler)
Adds a route with given authority and path pattern.
|
RequestRouter<T> |
build() |
RequestRouter.Builder<T> |
downstream(HttpRequestMapper<T> downstream)
Sets a downstream request mapper that can be used as a fallback in case no authoritative service can be found
to handle an incoming request.
|
RequestRouter.Builder<T> |
resolveAuthority(BiFunction<String,URIAuthority,URIAuthority> authorityResolver)
Sets custom
URIAuthority resolution Function that can be used to normalize or re-write
the authority specified in incoming requests prior to request routing. |
public RequestRouter.Builder<T> addRoute(URIAuthority authority, String pathPattern, T handler)
public RequestRouter.Builder<T> addRoute(String hostname, String pathPattern, T handler)
public RequestRouter.Builder<T> resolveAuthority(BiFunction<String,URIAuthority,URIAuthority> authorityResolver)
URIAuthority
resolution Function
that can be used to normalize or re-write
the authority specified in incoming requests prior to request routing. The function can return
a new URIAuthority
instance representing an identity of the service authoritative to handle
the request or null
if an authoritative service cannot be found or is unknown.public RequestRouter.Builder<T> downstream(HttpRequestMapper<T> downstream)
public RequestRouter<T> build()
Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.