T
- request handler type.@Contract(threading=IMMUTABLE) public class RequestRouter<T> extends Object implements HttpRequestMapper<T>
Modifier and Type | Class and Description |
---|---|
static class |
RequestRouter.Builder<T> |
static class |
RequestRouter.Entry<T> |
Modifier and Type | Field and Description |
---|---|
static BiFunction<String,URIAuthority,URIAuthority> |
IGNORE_PORT_AUTHORITY_RESOLVER |
static URIAuthority |
LOCAL_AUTHORITY |
static BiFunction<String,URIAuthority,URIAuthority> |
LOCAL_AUTHORITY_RESOLVER |
Modifier and Type | Method and Description |
---|---|
static <T> RequestRouter.Builder<T> |
builder() |
static <T> RequestRouter.Builder<T> |
builder(UriPatternType patternType) |
static <T> RequestRouter<T> |
create(URIAuthority primaryAuthority,
UriPatternType patternType,
List<RequestRouter.Entry<T>> handlerEntries,
BiFunction<String,URIAuthority,URIAuthority> authorityResolver,
HttpRequestMapper<T> downstream) |
T |
resolve(HttpRequest request,
HttpContext context)
Resolves a handler matching the given request.
|
public static final URIAuthority LOCAL_AUTHORITY
public static final BiFunction<String,URIAuthority,URIAuthority> LOCAL_AUTHORITY_RESOLVER
public static final BiFunction<String,URIAuthority,URIAuthority> IGNORE_PORT_AUTHORITY_RESOLVER
@Internal public static <T> RequestRouter<T> create(URIAuthority primaryAuthority, UriPatternType patternType, List<RequestRouter.Entry<T>> handlerEntries, BiFunction<String,URIAuthority,URIAuthority> authorityResolver, HttpRequestMapper<T> downstream)
public static <T> RequestRouter.Builder<T> builder(UriPatternType patternType)
public static <T> RequestRouter.Builder<T> builder()
public T resolve(HttpRequest request, HttpContext context) throws HttpException
HttpRequestMapper
resolve
in interface HttpRequestMapper<T>
request
- the request to map to a handlernull
if no match is found.HttpException
- in case of an HTTP protocol violation.Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.