diff options
author | Arpit Singh <as00745003@techmahindra.com> | 2024-09-04 11:02:06 +0530 |
---|---|---|
committer | Arpit Singh <as00745003@techmahindra.com> | 2024-09-10 10:10:29 +0000 |
commit | 3c8539cf17b1698cadf08e6f3acc4a8b9273af85 (patch) | |
tree | 491c24c147e6a303fcb68bbdf5b27bb6ae69ffd8 /cps-service/src/main/java | |
parent | 3a4dcb5af00b85ae3f48709dfa0f9d797e02aabd (diff) |
Renaming Delta Operations as per RFC 9144
RFC 9144 recommends naming convention for operations that can be performed on any datastore.
The recommended names are:
- create
- remove
- replace
Whereas in CPS Delta feature these operaitions were named:
- add
- remove
- update
So, "add" and "update" operations have been changed to "create" and "replace" respectively.
Issue-ID: CPS-2393
Change-Id: Ie39f5f8ccc91e96cf484ca7fbc833a6be8758054
Signed-off-by: Arpit Singh <as00745003@techmahindra.com>
Diffstat (limited to 'cps-service/src/main/java')
3 files changed, 8 insertions, 8 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/api/impl/CpsDeltaServiceImpl.java b/cps-service/src/main/java/org/onap/cps/api/impl/CpsDeltaServiceImpl.java index 2f99dbf7bb..4df3a28145 100644 --- a/cps-service/src/main/java/org/onap/cps/api/impl/CpsDeltaServiceImpl.java +++ b/cps-service/src/main/java/org/onap/cps/api/impl/CpsDeltaServiceImpl.java @@ -179,7 +179,7 @@ public class CpsDeltaServiceImpl implements CpsDeltaService { final List<DeltaReport> updatedDeltaReportEntries) { for (final Map.Entry<Map<String, Serializable>, Map<String, Serializable>> entry: updatedLeavesAsSourceDataToTargetData.entrySet()) { - final DeltaReport updatedDataForDeltaReport = new DeltaReportBuilder().actionUpdate() + final DeltaReport updatedDataForDeltaReport = new DeltaReportBuilder().actionReplace() .withXpath(xpath).withSourceData(entry.getKey()).withTargetData(entry.getValue()).build(); updatedDeltaReportEntries.add(updatedDataForDeltaReport); } @@ -195,7 +195,7 @@ public class CpsDeltaServiceImpl implements CpsDeltaService { for (final Map.Entry<String, DataNode> entry: xpathToAddedNodes.entrySet()) { final String xpath = entry.getKey(); final DataNode dataNode = entry.getValue(); - final DeltaReport addedDataForDeltaReport = new DeltaReportBuilder().actionAdd().withXpath(xpath) + final DeltaReport addedDataForDeltaReport = new DeltaReportBuilder().actionCreate().withXpath(xpath) .withTargetData(dataNode.getLeaves()).build(); addedDeltaReportEntries.add(addedDataForDeltaReport); } diff --git a/cps-service/src/main/java/org/onap/cps/spi/model/DeltaReport.java b/cps-service/src/main/java/org/onap/cps/spi/model/DeltaReport.java index 34715e70b9..c6270a41d2 100644 --- a/cps-service/src/main/java/org/onap/cps/spi/model/DeltaReport.java +++ b/cps-service/src/main/java/org/onap/cps/spi/model/DeltaReport.java @@ -32,9 +32,9 @@ import lombok.Setter; @JsonInclude(JsonInclude.Include.NON_NULL) public class DeltaReport { - public static final String ADD_ACTION = "add"; + public static final String CREATE_ACTION = "create"; public static final String REMOVE_ACTION = "remove"; - public static final String UPDATE_ACTION = "update"; + public static final String REPLACE_ACTION = "replace"; DeltaReport() {} diff --git a/cps-service/src/main/java/org/onap/cps/spi/model/DeltaReportBuilder.java b/cps-service/src/main/java/org/onap/cps/spi/model/DeltaReportBuilder.java index 1e151eeb2d..a7e7aae215 100644 --- a/cps-service/src/main/java/org/onap/cps/spi/model/DeltaReportBuilder.java +++ b/cps-service/src/main/java/org/onap/cps/spi/model/DeltaReportBuilder.java @@ -48,8 +48,8 @@ public class DeltaReportBuilder { return this; } - public DeltaReportBuilder actionAdd() { - this.action = DeltaReport.ADD_ACTION; + public DeltaReportBuilder actionCreate() { + this.action = DeltaReport.CREATE_ACTION; return this; } @@ -58,8 +58,8 @@ public class DeltaReportBuilder { return this; } - public DeltaReportBuilder actionUpdate() { - this.action = DeltaReport.UPDATE_ACTION; + public DeltaReportBuilder actionReplace() { + this.action = DeltaReport.REPLACE_ACTION; return this; } |