Interface Request
- 
- All Known Subinterfaces:
- ActionRequest,- CreateRequest,- DeleteRequest,- PatchRequest,- QueryRequest,- ReadRequest,- UpdateRequest
 
 public interface RequestCommon attributes of all JSON resource requests.
- 
- 
Field SummaryFields Modifier and Type Field Description static StringFIELD_ADDITIONAL_PARAMETERSThe name of the field which contains the additional query parameters in the JSON representation.static StringFIELD_FIELDSThe name of the field which contains the fields in the JSON representation.static StringFIELD_RESOURCE_PATHThe name of the field which contains the resource name in the JSON representation.static StringFIELD_VALUE_ALLThe value of the fields request parameter to request all fields.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description <R,P>
 Raccept(RequestVisitor<R,P> v, P p)Applies aRequestVisitorto thisRequest.RequestaddField(String... fields)Adds one or more fields which should be included with each JSON resource returned by this request.RequestaddField(JsonPointer... fields)Adds one or more fields which should be included with each JSON resource returned by this request.StringgetAdditionalParameter(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.PreferredLocalesgetPreferredLocales()Get the locale preference for the request.RequestTypegetRequestType()Returns the type of this request.StringgetResourcePath()Returns the non-nullpath of the JSON resource to which this request should be targeted.ResourcePathgetResourcePathObject()Returns the non-nullpath of the JSON resource to which this request should be targeted.org.forgerock.http.routing.VersiongetResourceVersion()Gets the requested API version of the resource.RequestsetAdditionalParameter(String name, String value)Sets an additional parameter which should be used to control the behavior of this action request.RequestsetPreferredLocales(PreferredLocales preferredLocales)Set the locale preference for the request.RequestsetResourcePath(String path)Sets the non-nullpath of the JSON resource to which this request should be targeted.RequestsetResourcePath(ResourcePath path)Sets the non-nullpath of the JSON resource to which this request should be targeted.RequestsetResourceVersion(org.forgerock.http.routing.Version resourceVersion)Sets the requested API version of the resource.JsonValuetoJsonValue()Return a JsonValue representation of this request.
 
- 
- 
- 
Field Detail- 
FIELD_ADDITIONAL_PARAMETERSstatic final String FIELD_ADDITIONAL_PARAMETERS The name of the field which contains the additional query parameters in the JSON representation.- See Also:
- Constant Field Values
 
 - 
FIELD_FIELDSstatic final String FIELD_FIELDS The name of the field which contains the fields in the JSON representation.- See Also:
- Constant Field Values
 
 - 
FIELD_VALUE_ALLstatic final String FIELD_VALUE_ALL The value of the fields request parameter to request all fields.- See Also:
- Constant Field Values
 
 - 
FIELD_RESOURCE_PATHstatic final String FIELD_RESOURCE_PATH The name of the field which contains the resource name in the JSON representation.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
accept<R,P> R accept(RequestVisitor<R,P> v, P p) Applies aRequestVisitorto thisRequest.- Type Parameters:
- R- The return type of the visitor's methods.
- P- The type of the additional parameters to the visitor's methods.
- Parameters:
- v- The request visitor.
- p- Optional additional visitor parameter.
- Returns:
- A result as specified by the visitor.
 
 - 
addFieldRequest addField(JsonPointer... fields) Adds one or more fields which should be included with each JSON resource returned by this request.- Parameters:
- fields- The fields which should be included with each JSON resource returned by this request.
- Returns:
- This request.
- Throws:
- UnsupportedOperationException- If this request does not permit changes to the fields.
 
 - 
addFieldRequest addField(String... fields) Adds one or more fields which should be included with each JSON resource returned by this request.- Parameters:
- fields- The fields which should be included with each JSON resource returned by this request.
- Returns:
- This request.
- Throws:
- 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.
 
 - 
getAdditionalParameterString getAdditionalParameter(String name) Returns the additional parameter which should be used to control the behavior of this action request.- Parameters:
- name- The name of the additional parameter.
- Returns:
- The additional parameter which should be used to control the behavior of this action request
 
 - 
getAdditionalParametersMap<String,String> getAdditionalParameters() 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.- Returns:
- The additional parameters which should be used to control the behavior of this action request (never
 null).
 
 - 
getFieldsList<JsonPointer> getFields() 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. - Returns:
- The list of fields which should be included with each JSON resource returned by this request (never
 null).
 
 - 
getPreferredLocalesPreferredLocales getPreferredLocales() Get the locale preference for the request.- Returns:
- The PreferredLocalesinstance for the request.
 
 - 
getRequestTypeRequestType getRequestType() Returns the type of this request.- Returns:
- The type of this request.
 
 - 
getResourcePathString getResourcePath() Returns the non-nullpath 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 UriRouterContextfor more information.- Returns:
- The non-nullpath of the JSON resource to which this request should be targeted, which may be the empty string.
 
 - 
getResourcePathObjectResourcePath getResourcePathObject() Returns the non-nullpath 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 UriRouterContextfor more information.- Returns:
- The non-nullpath of the JSON resource to which this request should be targeted, which may be the empty string.
 
 - 
getResourceVersionorg.forgerock.http.routing.Version getResourceVersion() Gets the requested API version of the resource.- Returns:
- The requested API version of the resource.
 
 - 
setAdditionalParameterRequest setAdditionalParameter(String name, String value) throws BadRequestException Sets an additional parameter which should be used to control the behavior of this action request.- 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.
- UnsupportedOperationException- If this request does not permit changes to the additional parameters.
 
 - 
setPreferredLocalesRequest setPreferredLocales(PreferredLocales preferredLocales) Set the locale preference for the request.- Parameters:
- preferredLocales- The- PreferredLocalesinstance for the request.
- Returns:
- This request.
 
 - 
setResourcePathRequest setResourcePath(String path) Sets the non-nullpath 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 UriRouterContextfor more information.- Parameters:
- path- The non-- nullpath 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.
- Throws:
- UnsupportedOperationException- If this request does not permit changes to the JSON resource path.
 
 - 
setResourcePathRequest setResourcePath(ResourcePath path) Sets the non-nullpath 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 UriRouterContextfor more information.- Parameters:
- path- The non-- nullpath of the JSON resource to which this request should be targeted, which may be the empty string.
- Returns:
- This request.
- Throws:
- UnsupportedOperationException- If this request does not permit changes to the JSON resource path.
 
 - 
setResourceVersionRequest setResourceVersion(org.forgerock.http.routing.Version resourceVersion) Sets the requested API version of the resource.- Parameters:
- resourceVersion- The requested API version of the resource.
- Returns:
- This request.
 
 - 
toJsonValueJsonValue toJsonValue() Return a JsonValue representation of this request.- Returns:
- this request as a JsonValue
 
 
- 
 
-