Interface ReadRequest
-
-
Field Summary
-
Fields inherited from interface org.forgerock.json.resource.Request
FIELD_ADDITIONAL_PARAMETERS, FIELD_FIELDS, FIELD_RESOURCE_PATH, FIELD_VALUE_ALL
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <R,P>
Raccept(RequestVisitor<R,P> v, P p)
Applies aRequestVisitor
to thisRequest
.ReadRequest
addField(String... fields)
Adds one or more fields which should be included with each JSON resource returned by this request.ReadRequest
addField(JsonPointer... 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.org.forgerock.http.routing.Version
getResourceVersion()
Gets the requested API version of the resource.ReadRequest
setAdditionalParameter(String name, String value)
Sets an additional parameter which should be used to control the behavior of this action request.ReadRequest
setPreferredLocales(PreferredLocales preferredLocales)
Set the locale preference for the request.ReadRequest
setResourcePath(String path)
Sets the non-null
path of the JSON resource to which this request should be targeted.ReadRequest
setResourcePath(ResourcePath path)
Sets the non-null
path of the JSON resource to which this request should be targeted.ReadRequest
setResourceVersion(org.forgerock.http.routing.Version resourceVersion)
Sets the requested API version of the resource.JsonValue
toJsonValue()
Return a JsonValue representation of this request.
-
-
-
Method Detail
-
accept
<R,P> R accept(RequestVisitor<R,P> v, P p)
Description copied from interface:Request
Applies aRequestVisitor
to thisRequest
.
-
addField
ReadRequest addField(JsonPointer... fields)
Description copied from interface:Request
Adds one or more fields which should be included with each JSON resource returned by this request.
-
addField
ReadRequest addField(String... fields)
Description copied from interface:Request
Adds one or more fields which should be included with each JSON resource returned by this request.
-
getAdditionalParameter
String getAdditionalParameter(String name)
Description copied from interface:Request
Returns the additional parameter which should be used to control the behavior of this action request.- Specified by:
getAdditionalParameter
in interfaceRequest
- Parameters:
name
- The name of the additional parameter.- Returns:
- The additional parameter which should be used to control the behavior of this action request
-
getAdditionalParameters
Map<String,String> getAdditionalParameters()
Description copied from interface:Request
Returns the additional parameters which should be used to control the behavior of this action request. The returned map may be modified if permitted by this action request.- Specified by:
getAdditionalParameters
in interfaceRequest
- Returns:
- The additional parameters which should be used to control the behavior of this action request (never
null
).
-
getFields
List<JsonPointer> getFields()
Description copied from interface:Request
Returns the list of fields which should be included with each JSON resource returned by this request. The returned list may be modified if permitted by this query request. An empty list indicates that all fields should be included.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.
-
getPreferredLocales
PreferredLocales getPreferredLocales()
Description copied from interface:Request
Get the locale preference for the request.- Specified by:
getPreferredLocales
in interfaceRequest
- Returns:
- The
PreferredLocales
instance for the request.
-
getRequestType
RequestType getRequestType()
Description copied from interface:Request
Returns the type of this request.- Specified by:
getRequestType
in interfaceRequest
- Returns:
- The type of this request.
-
getResourcePath
String getResourcePath()
Description copied from interface:Request
Returns the non-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.- Specified by:
getResourcePath
in interfaceRequest
- Returns:
- The non-
null
path of the JSON resource to which this request should be targeted, which may be the empty string.
-
getResourcePathObject
ResourcePath getResourcePathObject()
Description copied from interface:Request
Returns the non-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.- Specified by:
getResourcePathObject
in interfaceRequest
- Returns:
- The non-
null
path of the JSON resource to which this request should be targeted, which may be the empty string.
-
getResourceVersion
org.forgerock.http.routing.Version getResourceVersion()
Description copied from interface:Request
Gets the requested API version of the resource.- Specified by:
getResourceVersion
in interfaceRequest
- Returns:
- The requested API version of the resource.
-
setAdditionalParameter
ReadRequest setAdditionalParameter(String name, String value) throws BadRequestException
Description copied from interface:Request
Sets an additional parameter which should be used to control the behavior of this action request.- Specified by:
setAdditionalParameter
in interfaceRequest
- Parameters:
name
- The name of the additional parameter.value
- The additional parameter's value.- Returns:
- This request.
- Throws:
BadRequestException
- If this request does not permit the additional parameter to be set.
-
setPreferredLocales
ReadRequest setPreferredLocales(PreferredLocales preferredLocales)
Description copied from interface:Request
Set the locale preference for the request.- Specified by:
setPreferredLocales
in interfaceRequest
- Parameters:
preferredLocales
- ThePreferredLocales
instance for the request.- Returns:
- This request.
-
setResourcePath
ReadRequest setResourcePath(ResourcePath path)
Description copied from interface:Request
Sets the non-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.- Specified by:
setResourcePath
in interfaceRequest
- Parameters:
path
- The non-null
path of the JSON resource to which this request should be targeted, which may be the empty string.- Returns:
- This request.
-
setResourcePath
ReadRequest setResourcePath(String path)
Description copied from interface:Request
Sets the non-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.- Specified by:
setResourcePath
in interfaceRequest
- Parameters:
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.- Returns:
- This request.
-
setResourceVersion
ReadRequest setResourceVersion(org.forgerock.http.routing.Version resourceVersion)
Description copied from interface:Request
Sets the requested API version of the resource.- Specified by:
setResourceVersion
in interfaceRequest
- Parameters:
resourceVersion
- The requested API version of the resource.- Returns:
- This request.
-
toJsonValue
JsonValue toJsonValue()
Description copied from interface:Request
Return a JsonValue representation of this request.- Specified by:
toJsonValue
in interfaceRequest
- Returns:
- this request as a JsonValue
-
-