public final class UriRouterContext extends AbstractContext
Context
which is created when a request has been routed. The
context includes:
data
Constructor and Description |
---|
UriRouterContext(Context parent,
String matchedUri,
String remainingUri,
Map<String,String> uriTemplateVariables)
Creates a new routing context having the provided parent, URI template
variables, and an ID automatically generated using
UUID.randomUUID() . |
UriRouterContext(Context parent,
String matchedUri,
String remainingUri,
Map<String,String> uriTemplateVariables,
URI originalUri)
Creates a new routing context having the provided parent, URI template
variables, and an ID automatically generated using
UUID.randomUUID() . |
UriRouterContext(JsonValue savedContext,
ClassLoader classLoader)
Restore from JSON representation.
|
Modifier and Type | Method and Description |
---|---|
String |
getBaseUri()
Returns the portion of the request URI which has been routed so far.
|
String |
getMatchedUri()
Returns the portion of the request URI which matched the URI template.
|
URI |
getOriginalUri()
Get the original URI.
|
String |
getRemainingUri()
Returns the portion of the request URI which is remaining to be matched
be the next router.
|
Map<String,String> |
getUriTemplateVariables()
Returns an unmodifiable
Map containing the parsed URI template
variables, keyed on the URI template variable name. |
asContext, containsContext, containsContext, getContext, getContextName, getId, getParent, isRootContext, toJsonValue, toString
public UriRouterContext(Context parent, String matchedUri, String remainingUri, Map<String,String> uriTemplateVariables)
UUID.randomUUID()
.parent
- The parent server context.matchedUri
- The matched URIremainingUri
- The remaining URI to be matched.uriTemplateVariables
- A Map
containing the parsed URI template variables,
keyed on the URI template variable name.public UriRouterContext(Context parent, String matchedUri, String remainingUri, Map<String,String> uriTemplateVariables, URI originalUri)
UUID.randomUUID()
.parent
- The parent server context.matchedUri
- The matched URIremainingUri
- The remaining URI to be matched.uriTemplateVariables
- A Map
containing the parsed URI template variables,
keyed on the URI template variable name.originalUri
- The original URIpublic UriRouterContext(JsonValue savedContext, ClassLoader classLoader)
savedContext
- The JSON representation from which this context's attributes
should be parsed.classLoader
- The ClassLoader which can properly resolve the persisted class-name.public String getBaseUri()
null
but may be "" (empty string).null
portion of the request URI which has been
routed so far.public String getMatchedUri()
null
but may be "" (empty string).null
portion of the request URI which matched the
URI template.public String getRemainingUri()
null
but may be
"" (empty string).null
portion of the request URI which is
remaining to be matched.public Map<String,String> getUriTemplateVariables()
Map
containing the parsed URI template
variables, keyed on the URI template variable name.Map
containing the parsed URI template
variables, keyed on the URI template variable name.public URI getOriginalUri()
Copyright 2011-2015 ForgeRock AS.