public interface Request
Modifier and Type | Field and Description |
---|---|
static String |
FIELD_ADDITIONAL_PARAMETERS
The name of the field which contains the additional query parameters in the JSON representation.
|
static String |
FIELD_FIELDS
The name of the field which contains the fields in the JSON representation.
|
static String |
FIELD_RESOURCE_PATH
The name of the field which contains the resource name in the JSON representation.
|
static String |
FIELD_VALUE_ALL
The value of the fields request parameter to request all fields.
|
Modifier and Type | Method and Description |
---|---|
<R,P> R |
accept(RequestVisitor<R,P> v,
P p)
Applies a
RequestVisitor to this Request . |
Request |
addField(JsonPointer... fields)
Adds one or more fields which should be included with each JSON resource returned by this request.
|
Request |
addField(String... fields)
Adds one or more fields which should be included with each JSON resource returned by this request.
|
String |
getAdditionalParameter(String name)
Returns the additional parameter which should be used to control the behavior of this action request.
|
Map<String,String> |
getAdditionalParameters()
Returns the additional parameters which should be used to control the behavior of this action request.
|
List<JsonPointer> |
getFields()
Returns the list of fields which should be included with each JSON resource returned by this request.
|
PreferredLocales |
getPreferredLocales()
Get the locale preference for the request.
|
RequestType |
getRequestType()
Returns the type of this request.
|
String |
getResourcePath()
Returns the non-
null path of the JSON resource to which this request should be targeted. |
ResourcePath |
getResourcePathObject()
Returns the non-
null path of the JSON resource to which this request should be targeted. |
Version |
getResourceVersion()
Gets the requested API version of the resource.
|
Request |
setAdditionalParameter(String name,
String value)
Sets an additional parameter which should be used to control the behavior of this action request.
|
Request |
setPreferredLocales(PreferredLocales preferredLocales)
Set the locale preference for the request.
|
Request |
setResourcePath(ResourcePath path)
Sets the non-
null path of the JSON resource to which this request should be targeted. |
Request |
setResourcePath(String path)
Sets the non-
null path of the JSON resource to which this request should be targeted. |
Request |
setResourceVersion(Version resourceVersion)
Sets the requested API version of the resource.
|
JsonValue |
toJsonValue()
Return a JsonValue representation of this request.
|
static final String FIELD_ADDITIONAL_PARAMETERS
static final String FIELD_FIELDS
static final String FIELD_VALUE_ALL
static final String FIELD_RESOURCE_PATH
<R,P> R accept(RequestVisitor<R,P> v, P p)
RequestVisitor
to this Request
.R
- The return type of the visitor's methods.P
- The type of the additional parameters to the visitor's methods.v
- The request visitor.p
- Optional additional visitor parameter.Request addField(JsonPointer... fields)
fields
- The fields which should be included with each JSON resource returned by this request.UnsupportedOperationException
- If this request does not permit changes to the fields.Request addField(String... fields)
fields
- The fields which should be included with each JSON resource returned by this request.IllegalArgumentException
- If one or more of the provided field identifiers could not be parsed as a JSON pointer.UnsupportedOperationException
- If this request does not permit changes to the fields.String getAdditionalParameter(String name)
name
- The name of the additional parameter.Map<String,String> getAdditionalParameters()
null
).List<JsonPointer> getFields()
NOTE: field filtering alters the structure of a JSON resource and MUST only be performed once while processing a request. It is therefore the responsibility of front-end implementations (e.g. HTTP listeners, Servlets, etc) to perform field filtering. Request handler and resource provider implementations SHOULD NOT filter fields, but MAY choose to optimise their processing in order to return a resource containing only the fields targeted by the field filters.
null
).PreferredLocales getPreferredLocales()
PreferredLocales
instance for the request.RequestType getRequestType()
String getResourcePath()
null
path of the JSON resource to which this request should be targeted. The resource
path is relative and never begins or ends with a forward slash, but may be empty.
NOTE: for resource provider implementations the resource path is relative to the current resource being
accessed. See the description of UriRouterContext
for more information.
null
path of the JSON resource to which this request should be targeted, which may be the
empty string.ResourcePath getResourcePathObject()
null
path of the JSON resource to which this request should be targeted. The resource
path is relative and never begins or ends with a forward slash, but may be empty.
NOTE: for resource provider implementations the resource path is relative to the current resource being
accessed. See the description of UriRouterContext
for more information.
null
path of the JSON resource to which this request should be targeted, which may be the
empty string.Version getResourceVersion()
Request setAdditionalParameter(String name, String value) throws BadRequestException
name
- The name of the additional parameter.value
- The additional parameter's value.BadRequestException
- If this request does not permit the additional parameter to be set.UnsupportedOperationException
- If this request does not permit changes to the additional parameters.Request setPreferredLocales(PreferredLocales preferredLocales)
preferredLocales
- The PreferredLocales
instance for the request.Request setResourcePath(String path)
null
path of the JSON resource to which this request should be targeted. The resource path
is relative and never begins or ends with a forward slash, but may be empty.
NOTE: for resource provider implementations the resource path is relative to the current resource being
accessed. See the description of UriRouterContext
for more information.
path
- The non-null
path of the JSON resource to which this request should be targeted, which may be the
empty string. The path should be URL-encoded.UnsupportedOperationException
- If this request does not permit changes to the JSON resource path.Request setResourcePath(ResourcePath path)
null
path of the JSON resource to which this request should be targeted. The resource path
is relative and never begins or ends with a forward slash, but may be empty.
NOTE: for resource provider implementations the resource path is relative to the current resource being
accessed. See the description of UriRouterContext
for more information.
path
- The non-null
path of the JSON resource to which this request should be targeted, which may be the
empty string.UnsupportedOperationException
- If this request does not permit changes to the JSON resource path.Request setResourceVersion(Version resourceVersion)
resourceVersion
- The requested API version of the resource.JsonValue toJsonValue()
Copyright © 2010-2018, ForgeRock All Rights Reserved.