T - Type of API Request this RequestMapper will work onpublic class RoleBasedRoutingRequestMapper<T extends ApiRequest> extends RequestMapper<T>
| Constructor and Description |
|---|
RoleBasedRoutingRequestMapper(ResourceDictionaries resourceDictionaries,
LinkedHashMap<String,RequestMapper<T>> prioritizedRoleBasedMappers,
RequestMapper<T> defaultMapper)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
T |
apply(T request,
javax.ws.rs.container.ContainerRequestContext context)
Rewrite and Validate the ApiRequest(e.g.
|
getResourceDictionariespublic RoleBasedRoutingRequestMapper(ResourceDictionaries resourceDictionaries, LinkedHashMap<String,RequestMapper<T>> prioritizedRoleBasedMappers, @NotNull RequestMapper<T> defaultMapper)
resourceDictionaries - The dictionaries to use for request mapping.prioritizedRoleBasedMappers - A map of roles to mappers for each role, with a deterministic entry order.defaultMapper - The default mapper to apply if no other roles match. (should not be null to avoid default
access by all)public T apply(T request, javax.ws.rs.container.ContainerRequestContext context) throws RequestValidationException
RequestMapperThis should throw an exception if the given/converted request is not valid.
apply in class RequestMapper<T extends ApiRequest>request - the apiRequest to rewritecontext - the ContainerRequestContextRequestValidationException - with the HTTP status and user-facing error msg to abort with
if the request is not validCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.