diff options
author | sblimkie <steven.blimkie@amdocs.com> | 2018-01-23 09:56:05 -0500 |
---|---|---|
committer | sblimkie <steven.blimkie@amdocs.com> | 2018-01-23 09:57:42 -0500 |
commit | d8b5c7ec53e0ae80c7aecd4c33e0c63e172b2544 (patch) | |
tree | 33f59ad1d5a78748e0f47001d4487875d2cda5c2 /src/main/java | |
parent | c8d962ad88da4403ae9186e7213a7ce28b82aaa1 (diff) |
Fix issue patching edges
Fix an issue where edge patch fails
Change-Id: Ia6987b5ced127bb2d475c3c13dcf9dabf2242ff0
Issue-ID: AAI-685
Signed-off-by: sblimkie <steven.blimkie@amdocs.com>
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/onap/schema/RelationshipSchemaValidator.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/onap/schema/RelationshipSchemaValidator.java b/src/main/java/org/onap/schema/RelationshipSchemaValidator.java index 53048be..73e8445 100644 --- a/src/main/java/org/onap/schema/RelationshipSchemaValidator.java +++ b/src/main/java/org/onap/schema/RelationshipSchemaValidator.java @@ -31,6 +31,7 @@ import org.onap.crud.entity.Vertex; import org.onap.crud.exception.CrudException; import org.onap.crud.service.EdgePayload; import org.onap.crud.util.CrudServiceUtil; +import org.onap.schema.OxmModelValidator.Metadata; import org.radeox.util.logging.Logger; import java.util.HashMap; @@ -179,6 +180,17 @@ public class RelationshipSchemaValidator { throw new CrudException("Target can't be updated", Status.BAD_REQUEST); } } + + // Remove the timestamp properties from the existing edge, as these should be managed by Champ. + Map<String,Object> existingProps = edge.getProperties(); + + if (existingProps.containsKey(Metadata.CREATED_TS.propertyName())) { + existingProps.remove(Metadata.CREATED_TS.propertyName()); + } + if (existingProps.containsKey(Metadata.UPDATED_TS.propertyName())) { + existingProps.remove(Metadata.UPDATED_TS.propertyName()); + } + // create key based on source:target:relationshipType String key = edge.getSource().getType() + ":" + edge.getTarget().getType() |