From 1baf48d05be1cd32e22c065ebfec218da100d1f2 Mon Sep 17 00:00:00 2001 From: Ruslan Kashapov Date: Fri, 7 May 2021 10:46:27 +0300 Subject: Create list-node elements (part3): NCMP REST and service layers Issue-ID: CPS-360 Change-Id: Id8be89f19750d72bae334491aea4a59f21c7ecd6 Signed-off-by: Ruslan Kashapov --- .../java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java | 10 ++++++++++ .../onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java | 5 +++++ 2 files changed, 15 insertions(+) (limited to 'cps-ncmp-service/src/main') diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java index 8176ea50fa..ccc4e44ccb 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java @@ -67,6 +67,16 @@ public interface NetworkCmProxyDataService { */ void createDataNode(@NonNull String cmHandle, @NonNull String parentNodeXpath, @NonNull String jsonData); + /** + * Creates one or more child node elements with descendants under existing node from list-node data fragment. + * + * @param cmHandle The identifier for a network function, network element, subnetwork or any other cm + * object managed by Network CM Proxy + * @param parentNodeXpath xpath to parent node + * @param jsonData data as JSON string + */ + void addListNodeElements(@NonNull String cmHandle, @NonNull String parentNodeXpath, @NonNull String jsonData); + /** * Updates data node for given cm handle using xpath to parent node. * diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java index 56f4cf8dce..bdb71bf625 100755 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java @@ -67,6 +67,11 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService } } + @Override + public void addListNodeElements(final String cmHandle, final String parentNodeXpath, final String jsonData) { + cpsDataService.saveListNodeData(getDataspaceName(), cmHandle, parentNodeXpath, jsonData); + } + @Override public void updateNodeLeaves(final String cmHandle, final String parentNodeXpath, final String jsonData) { cpsDataService.updateNodeLeaves(getDataspaceName(), cmHandle, parentNodeXpath, jsonData); -- cgit 1.2.3-korg