Interface UpdateRequest
- All Superinterfaces:
Request
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the field which contains the resource content in the JSON representation.static final StringThe name of the field which contains the resource version in the JSON representation.Fields inherited from interface org.forgerock.json.resource.Request
FIELD_ADDITIONAL_PARAMETERS, FIELD_FIELDS, FIELD_RESOURCE_PATH, FIELD_VALUE_ALL -
Method Summary
Modifier and TypeMethodDescription<R,P> R accept(RequestVisitor<R, P> v, P p) Applies aRequestVisitorto thisRequest.Adds one or more fields which should be included with each JSON resource returned by this request.addField(JsonPointer... fields) Adds one or more fields which should be included with each JSON resource returned by this request.getAdditionalParameter(String name) Returns the additional parameter which should be used to control the behavior of this action request.Returns the additional parameters which should be used to control the behavior of this action request.Returns the content of the JSON resource to be replaced.Returns the list of fields which should be included with each JSON resource returned by this request.Get the locale preference for the request.Returns the type of this request.Returns the non-nullpath of the JSON resource to which this request should be targeted.Returns the non-nullpath of the JSON resource to which this request should be targeted.Gets the requested API version of the resource.Returns the expected version information associated with the JSON resource to be updated.setAdditionalParameter(String name, String value) Sets an additional parameter which should be used to control the behavior of this action request.setContent(JsonValue content) Sets the content of the JSON resource to be replaced.setPreferredLocales(PreferredLocales preferredLocales) Set the locale preference for the request.setResourcePath(String path) Sets the non-nullpath of the JSON resource to which this request should be targeted.setResourcePath(ResourcePath path) Sets the non-nullpath of the JSON resource to which this request should be targeted.setResourceVersion(Version resourceVersion) Sets the requested API version of the resource.setRevision(String version) Sets the expected version information associated with the JSON resource to be updated.Return a JsonValue representation of this request.
-
Field Details
-
FIELD_CONTENT
The name of the field which contains the resource content in the JSON representation.- See Also:
-
FIELD_REVISION
The name of the field which contains the resource version in the JSON representation.- See Also:
-
-
Method Details
-
accept
Description copied from interface:RequestApplies aRequestVisitorto thisRequest. -
addField
Description copied from interface:RequestAdds one or more fields which should be included with each JSON resource returned by this request. -
addField
Description copied from interface:RequestAdds one or more fields which should be included with each JSON resource returned by this request. -
getAdditionalParameter
Description copied from interface:RequestReturns the additional parameter which should be used to control the behavior of this action request.- Specified by:
getAdditionalParameterin 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
Description copied from interface:RequestReturns 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:
getAdditionalParametersin interfaceRequest- Returns:
- The additional parameters which should be used to control the behavior of this action request (never
null).
-
getContent
JsonValue getContent()Returns the content of the JSON resource to be replaced.- Returns:
- the content of the JSON resource to be replaced
-
getFields
List<JsonPointer> getFields()Description copied from interface:RequestReturns 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:RequestGet the locale preference for the request.- Specified by:
getPreferredLocalesin interfaceRequest- Returns:
- The
PreferredLocalesinstance for the request.
-
getRequestType
RequestType getRequestType()Description copied from interface:RequestReturns the type of this request.- Specified by:
getRequestTypein interfaceRequest- Returns:
- the type of this request
-
getResourcePath
String getResourcePath()Description copied from interface:RequestReturns 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.- Specified by:
getResourcePathin interfaceRequest- Returns:
- The non-
nullpath of the JSON resource to which this request should be targeted, which may be the empty string.
-
getResourcePathObject
ResourcePath getResourcePathObject()Description copied from interface:RequestReturns 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.- Specified by:
getResourcePathObjectin interfaceRequest- Returns:
- The non-
nullpath of the JSON resource to which this request should be targeted, which may be the empty string.
-
getResourceVersion
Version getResourceVersion()Description copied from interface:RequestGets the requested API version of the resource.- Specified by:
getResourceVersionin interfaceRequest- Returns:
- The requested API version of the resource.
-
getRevision
String getRevision()Returns the expected version information associated with the JSON resource to be updated. Version information can be used in order to implement multi-version concurrency control (MVCC).The returned version information may be
nullindicating that the client does not care if the resource has been modified concurrently. If the version information is non-null, and it does not match the current version of the targeted JSON resource, then the update request will be rejected by the provider.- Returns:
- The expected version information associated with the JSON resource to be updated.
-
setAdditionalParameter
Description copied from interface:RequestSets an additional parameter which should be used to control the behavior of this action request.- Specified by:
setAdditionalParameterin 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.
-
setContent
Sets the content of the JSON resource to be replaced.- Parameters:
content- The content of the JSON resource to be replaced.- Returns:
- This update request.
- Throws:
UnsupportedOperationException- If this update request does not permit changes to the content.
-
setPreferredLocales
Description copied from interface:RequestSet the locale preference for the request.- Specified by:
setPreferredLocalesin interfaceRequest- Parameters:
preferredLocales- ThePreferredLocalesinstance for the request.- Returns:
- This request.
-
setResourcePath
Description copied from interface:RequestSets 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.- Specified by:
setResourcePathin interfaceRequest- 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.
-
setResourcePath
Description copied from interface:RequestSets 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.- Specified by:
setResourcePathin interfaceRequest- 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.
-
setResourceVersion
Description copied from interface:RequestSets the requested API version of the resource.- Specified by:
setResourceVersionin interfaceRequest- Parameters:
resourceVersion- The requested API version of the resource.- Returns:
- This request.
-
setRevision
Sets the expected version information associated with the JSON resource to be updated. Version information can be used in order to implement multi-version concurrency control (MVCC).The provided version information may be
nullindicating that the client does not care if the resource has been modified concurrently. If the version information is non-null, and it does not match the current version of the targeted JSON resource, then the update request will be rejected by the provider.- Parameters:
version- The expected version information associated with the JSON resource to be updated.- Returns:
- This patch request.
- Throws:
UnsupportedOperationException- If this update request does not permit changes to the version information.
-
toJsonValue
JsonValue toJsonValue()Description copied from interface:RequestReturn a JsonValue representation of this request.- Specified by:
toJsonValuein interfaceRequest- Returns:
- this request as a JsonValue
-