Class PatchTargetHandler
- java.lang.Object
-
- de.captaingoldfish.scim.sdk.server.patch.AbstractPatch
-
- de.captaingoldfish.scim.sdk.server.patch.PatchTargetHandler
-
public class PatchTargetHandler extends AbstractPatch
author Pascal Knueppel
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
Constructors Constructor Description PatchTargetHandler(ResourceType resourceType, PatchOp patchOp, String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddOperationValues(ResourceNode resource, List<String> values)will add the specified values into the specified pathprotected 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 operation-
Methods inherited from class de.captaingoldfish.scim.sdk.server.patch.AbstractPatch
getAttributeFromObject, getSchemaAttribute
-
-
-
-
Constructor Detail
-
PatchTargetHandler
public PatchTargetHandler(ResourceType resourceType, PatchOp patchOp, String path)
-
-
Method Detail
-
addOperationValues
public boolean addOperationValues(ResourceNode resource, List<String> values)
will add the specified values into the specified path- 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
-
-