Class PatchTargetHandler
java.lang.Object
de.captaingoldfish.scim.sdk.server.patch.AbstractPatch
de.captaingoldfish.scim.sdk.server.patch.PatchTargetHandler
author Pascal Knueppel
created at: 30.10.2019 - 09:07
this class will handle the patch-add operation if a target is specified
created at: 30.10.2019 - 09:07
this class will handle the patch-add operation if a target is specified
The result of the add operation depends upon what the target location
indicated by "path" references:
o If the target location does not exist, the attribute and value are
added.
o If the target location specifies a complex attribute, a set of
sub-attributes SHALL be specified in the "value" parameter.
o If the target location specifies a multi-valued attribute, a new
value is added to the attribute.
o If the target location specifies a single-valued attribute, the
existing value is replaced.
o If the target location specifies an attribute that does not exist
(has no value), the attribute is added with the new value.
o If the target location exists, the value is replaced.
o If the target location already contains the value specified, no
changes SHOULD be made to the resource, and a success response
SHOULD be returned. Unless other operations change the resource,
this operation SHALL NOT change the modify timestamp of the
resource.
-
Field Summary
Fields inherited from class de.captaingoldfish.scim.sdk.server.patch.AbstractPatch
resourceType -
Constructor Summary
ConstructorsConstructorDescriptionPatchTargetHandler(PatchConfig patchConfig, ResourceType resourceType, PatchOp patchOp, String path) -
Method Summary
Modifier and TypeMethodDescriptionprotected AttributePathRootgetPath()the specified path where the value should be addedbooleanhandleOperationValues(ResourceNode resource, List<String> values) will add, replace or remove the specified values based on the given path-attributeprotected booleanhandleSimpleNode(SchemaAttribute schemaAttribute, com.fasterxml.jackson.databind.node.ObjectNode objectNode, List<String> values) adds or replaces a simple node in the given object nodeprotected voidvalidateRequest(List<String> values) will check that the expressions are correctly written for the defined patch operationMethods inherited from class de.captaingoldfish.scim.sdk.server.patch.AbstractPatch
getAttributeFromObject, getSchemaAttribute
-
Constructor Details
-
PatchTargetHandler
public PatchTargetHandler(PatchConfig patchConfig, ResourceType resourceType, PatchOp patchOp, String path)
-
-
Method Details
-
handleOperationValues
will add, replace or remove the specified values based on the given path-attribute- Parameters:
resource- the resource to which the values should be addedvalues- the values that should be added into the resource- Returns:
- true if an effective change was made, false else
-
handleSimpleNode
protected boolean handleSimpleNode(SchemaAttribute schemaAttribute, com.fasterxml.jackson.databind.node.ObjectNode objectNode, List<String> values) adds or replaces a simple node in the given object node- Parameters:
schemaAttribute- the attribute schema definitionobjectNode- the object node into which the new node should be added or replacedvalues- the values that should be added to the node. This list must not contain more than a single entry- Returns:
- true if an effective change was made, false else
-
validateRequest
will check that the expressions are correctly written for the defined patch operation- Parameters:
values- the values of the request
-
getPath
the specified path where the value should be added
-