diff options
author | 2021-11-02 14:15:17 +0000 | |
---|---|---|
committer | 2021-11-02 14:15:17 +0000 | |
commit | 6fda688fa63ea7ccd450002fb94a18b07095bea9 (patch) | |
tree | 10948449183a46e790e06c1973aa7c6d455b8158 /cps-rest/src/main | |
parent | 5ae0e346118103b31f409188c4c3010933f6bde2 (diff) | |
parent | a79c9f1bdf335843c29a425da53c15b5e353e5a3 (diff) |
Merge "Clean Up Code around List Nodes"
Diffstat (limited to 'cps-rest/src/main')
-rwxr-xr-x | cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java index 7db4e5a1b..f29ead9e9 100755 --- a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java +++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java @@ -60,9 +60,9 @@ public class DataRestController implements CpsDataApi { } @Override - public ResponseEntity<String> addListNodeElements(final String parentNodeXpath, + public ResponseEntity<String> addListElements(final String parentNodeXpath, final String dataspaceName, final String anchorName, final String jsonData, final String observedTimestamp) { - cpsDataService.saveListNodeData(dataspaceName, anchorName, parentNodeXpath, jsonData, + cpsDataService.saveListElements(dataspaceName, anchorName, parentNodeXpath, jsonData, toOffsetDateTime(observedTimestamp)); return new ResponseEntity<>(HttpStatus.CREATED); } @@ -94,19 +94,19 @@ public class DataRestController implements CpsDataApi { } @Override - public ResponseEntity<String> replaceListNodeElements(final String parentNodeXpath, + public ResponseEntity<String> replaceListContent(final String parentNodeXpath, final String dataspaceName, final String anchorName, final String jsonData, final String observedTimestamp) { - cpsDataService.replaceListNodeData(dataspaceName, anchorName, parentNodeXpath, jsonData, + cpsDataService.replaceListContent(dataspaceName, anchorName, parentNodeXpath, jsonData, toOffsetDateTime(observedTimestamp)); return new ResponseEntity<>(HttpStatus.OK); } @Override - public ResponseEntity<Void> deleteListNodeElements(final String dataspaceName, final String anchorName, - final String listNodeXpath, final String observedTimestamp) { + public ResponseEntity<Void> deleteListOrListElement(final String dataspaceName, final String anchorName, + final String listElementXpath, final String observedTimestamp) { cpsDataService - .deleteListNodeData(dataspaceName, anchorName, listNodeXpath, toOffsetDateTime(observedTimestamp)); + .deleteListOrListElement(dataspaceName, anchorName, listElementXpath, toOffsetDateTime(observedTimestamp)); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -114,7 +114,7 @@ public class DataRestController implements CpsDataApi { return ROOT_XPATH.equals(xpath); } - private OffsetDateTime toOffsetDateTime(final String datetTimestamp) { + private static OffsetDateTime toOffsetDateTime(final String datetTimestamp) { try { return StringUtils.isEmpty(datetTimestamp) ? null : OffsetDateTime.parse(datetTimestamp, ISO_TIMESTAMP_FORMATTER); |