diff options
author | Rudrangi Anupriya <ra00745022@techmahindra.com> | 2024-07-19 20:20:26 +0530 |
---|---|---|
committer | Sourabh Sourabh <sourabh.sourabh@est.tech> | 2024-08-01 08:57:23 +0000 |
commit | d0d4b973536730744279f176f5bac870b114cf78 (patch) | |
tree | 558696ef4295d72c6ccec9e006b043053ff37a08 /cps-service/src/main/java | |
parent | 523f3ff8cc25c1b45b5aa5c3b4ad9efd46bba14a (diff) |
XML content support on add list element
Issue-ID: CPS-2287
Change-Id: Ibb7ffb66ccbb03703266132c6d5c2eade0e7cb4a
Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
Diffstat (limited to 'cps-service/src/main/java')
-rw-r--r-- | cps-service/src/main/java/org/onap/cps/api/CpsDataService.java | 7 | ||||
-rw-r--r-- | cps-service/src/main/java/org/onap/cps/api/impl/CpsDataServiceImpl.java | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/api/CpsDataService.java b/cps-service/src/main/java/org/onap/cps/api/CpsDataService.java index cfa5f2de20..68e1880d77 100644 --- a/cps-service/src/main/java/org/onap/cps/api/CpsDataService.java +++ b/cps-service/src/main/java/org/onap/cps/api/CpsDataService.java @@ -93,11 +93,12 @@ public interface CpsDataService { * @param dataspaceName dataspace name * @param anchorName anchor name * @param parentNodeXpath parent node xpath - * @param jsonData json data representing list element(s) + * @param nodeData node data representing list element(s) * @param observedTimestamp observedTimestamp + * @param contentType JSON/XML content type */ - void saveListElements(String dataspaceName, String anchorName, String parentNodeXpath, String jsonData, - OffsetDateTime observedTimestamp); + void saveListElements(String dataspaceName, String anchorName, String parentNodeXpath, String nodeData, + OffsetDateTime observedTimestamp, ContentType contentType); /** * Retrieves all the datanodes by XPath for given dataspace and anchor. diff --git a/cps-service/src/main/java/org/onap/cps/api/impl/CpsDataServiceImpl.java b/cps-service/src/main/java/org/onap/cps/api/impl/CpsDataServiceImpl.java index c65bc5e0e9..165d62cede 100644 --- a/cps-service/src/main/java/org/onap/cps/api/impl/CpsDataServiceImpl.java +++ b/cps-service/src/main/java/org/onap/cps/api/impl/CpsDataServiceImpl.java @@ -119,12 +119,13 @@ public class CpsDataServiceImpl implements CpsDataService { @Override @Timed(value = "cps.data.service.list.element.save", description = "Time taken to save list elements") - public void saveListElements(final String dataspaceName, final String anchorName, final String parentNodeXpath, - final String jsonData, final OffsetDateTime observedTimestamp) { + public void saveListElements(final String dataspaceName, final String anchorName, + final String parentNodeXpath, final String nodeData, + final OffsetDateTime observedTimestamp, final ContentType contentType) { cpsValidator.validateNameCharacters(dataspaceName, anchorName); final Anchor anchor = cpsAnchorService.getAnchor(dataspaceName, anchorName); final Collection<DataNode> listElementDataNodeCollection = - buildDataNodesWithParentNodeXpath(anchor, parentNodeXpath, jsonData, ContentType.JSON); + buildDataNodesWithParentNodeXpath(anchor, parentNodeXpath, nodeData, contentType); if (isRootNodeXpath(parentNodeXpath)) { cpsDataPersistenceService.storeDataNodes(dataspaceName, anchorName, listElementDataNodeCollection); } else { |