public interface PatchRequest extends Request
PatchOperation
for more details regarding the various types of patch operation, and their semantics.Modifier and Type | Field and Description |
---|---|
static String |
FIELD_PATCH
The name of the field which contains the patch content in the JSON representation.
|
static String |
FIELD_PATCH_OPERATIONS
The name of the field which contains the patch operations in the JSON representation.
|
static String |
FIELD_REVISION
The name of the field which contains the resource version in the JSON representation.
|
FIELD_ADDITIONAL_PARAMETERS, FIELD_FIELDS, FIELD_RESOURCE_PATH, FIELD_VALUE_ALL
Modifier and Type | Method and Description |
---|---|
<R,P> R |
accept(RequestVisitor<R,P> v,
P p)
Applies a
RequestVisitor to this Request . |
PatchRequest |
addField(JsonPointer... fields)
Adds one or more fields which should be included with each JSON resource returned by this request.
|
PatchRequest |
addField(String... fields)
Adds one or more fields which should be included with each JSON resource returned by this request.
|
PatchRequest |
addPatchOperation(PatchOperation... operations)
Adds one or more patch operations which should be performed against the targeted resource.
|
PatchRequest |
addPatchOperation(String operation,
String field,
JsonValue value)
Adds a single patch operation which should be performed against the targeted resource.
|
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.
|
List<PatchOperation> |
getPatchOperations()
Returns the list of patch operations which should be performed against the targeted resource.
|
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.
|
String |
getRevision()
Returns the expected version information associated with the JSON resource to be patched.
|
PatchRequest |
setAdditionalParameter(String name,
String value)
Sets an additional parameter which should be used to control the behavior of this action request.
|
PatchRequest |
setPreferredLocales(PreferredLocales preferredLocales)
Set the locale preference for the request.
|
PatchRequest |
setResourcePath(ResourcePath path)
Sets the non-
null path of the JSON resource to which this request should be targeted. |
PatchRequest |
setResourcePath(String path)
Sets the non-
null path of the JSON resource to which this request should be targeted. |
PatchRequest |
setResourceVersion(Version resourceVersion)
Sets the requested API version of the resource.
|
PatchRequest |
setRevision(String version)
Sets the expected version information associated with the JSON resource to be patched.
|
JsonValue |
toJsonValue()
Return a JsonValue representation of this request.
|
static final String FIELD_PATCH
static final String FIELD_PATCH_OPERATIONS
static final String FIELD_REVISION
<R,P> R accept(RequestVisitor<R,P> v, P p)
Request
RequestVisitor
to this Request
.PatchRequest addField(JsonPointer... fields)
Request
PatchRequest addField(String... fields)
Request
PatchRequest addPatchOperation(PatchOperation... operations)
operations
- One or more patch operations which should be performed against the targeted resource.UnsupportedOperationException
- If this patch request does not permit changes to the patch operations.PatchRequest addPatchOperation(String operation, String field, JsonValue value)
operation
- The type of patch operation to be performed.field
- The field targeted by the patch operation.value
- The possibly null
value for the patch operation.UnsupportedOperationException
- If this patch request does not permit changes to the patch operations.String getAdditionalParameter(String name)
Request
getAdditionalParameter
in interface Request
name
- The name of the additional parameter.Map<String,String> getAdditionalParameters()
Request
getAdditionalParameters
in interface Request
null
).List<JsonPointer> getFields()
Request
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.
List<PatchOperation> getPatchOperations()
PreferredLocales getPreferredLocales()
Request
getPreferredLocales
in interface Request
PreferredLocales
instance for the request.RequestType getRequestType()
Request
getRequestType
in interface Request
String getResourcePath()
Request
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.
getResourcePath
in interface Request
null
path of the JSON resource to which this request should be targeted, which may be the
empty string.ResourcePath getResourcePathObject()
Request
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.
getResourcePathObject
in interface Request
null
path of the JSON resource to which this request should be targeted, which may be the
empty string.Version getResourceVersion()
Request
getResourceVersion
in interface Request
String getRevision()
The returned version information may be null
indicating 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 patch request will be rejected by the provider.
PatchRequest setAdditionalParameter(String name, String value) throws BadRequestException
Request
setAdditionalParameter
in interface Request
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.PatchRequest setPreferredLocales(PreferredLocales preferredLocales)
Request
setPreferredLocales
in interface Request
preferredLocales
- The PreferredLocales
instance for the request.PatchRequest setResourcePath(ResourcePath path)
Request
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.
setResourcePath
in interface Request
path
- The non-null
path of the JSON resource to which this request should be targeted, which may be the
empty string.PatchRequest setResourcePath(String path)
Request
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.
setResourcePath
in interface Request
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.PatchRequest setResourceVersion(Version resourceVersion)
Request
setResourceVersion
in interface Request
resourceVersion
- The requested API version of the resource.PatchRequest setRevision(String version)
The provided version information may be null
indicating 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 patch request will be rejected by the provider.
version
- The expected version information associated with the JSON resource to be patched.UnsupportedOperationException
- If this patch request does not permit changes to the version information.JsonValue toJsonValue()
Request
toJsonValue
in interface Request
Copyright © 2010-2018, ForgeRock All Rights Reserved.