diff options
author | DylanB95EST <dylan.byrne@est.tech> | 2021-10-29 17:33:06 +0100 |
---|---|---|
committer | DylanB95EST <dylan.byrne@est.tech> | 2021-11-02 11:59:14 +0000 |
commit | a79c9f1bdf335843c29a425da53c15b5e353e5a3 (patch) | |
tree | 4299454209e6187220728440160c7934db31c825 /cps-rest/src/main/java/org/onap | |
parent | 717215a36dde7bedb4257e693650c8728056b9d6 (diff) |
Clean Up Code around List Nodes
Make sure code refers clearly to List (whole) nodes or List elements
incl. method names, parameter names, test descriptions etc.
Issue-ID: CPS-756
Change-Id: Ic9dae6565c0e84c1ba4c2d6e891d3ea307f589da
Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
Diffstat (limited to 'cps-rest/src/main/java/org/onap')
-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 7db4e5a1b6..f29ead9e9f 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); |