diff options
author | Sourabh Sourabh <sourabh.sourabh@est.tech> | 2023-01-16 08:40:23 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2023-01-16 08:40:23 +0000 |
commit | ecfce9d3e46410e1158c0f640fa833c101c4bda4 (patch) | |
tree | 8642f87d0c5b8961e847deab5f57d67cfc69c182 /cps-service/src | |
parent | ef2b1518cf984f34b0640eb16ed44b26c9192efe (diff) | |
parent | 9c56b3032222b57549aa17dd281e4794fd9e25b6 (diff) |
Merge "Fetch CM handles by collection of xpaths"
Diffstat (limited to 'cps-service/src')
3 files changed, 34 insertions, 0 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 012d7f8259..6332f09109 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 @@ -123,6 +123,19 @@ public interface CpsDataService { FetchDescendantsOption fetchDescendantsOption); /** + * Retrieves datanodes by XPath for given dataspace and anchor. + * + * @param dataspaceName dataspace name + * @param anchorName anchor name + * @param xpaths collection of xpath + * @param fetchDescendantsOption defines the scope of data to fetch: either single node or all the descendant nodes + * (recursively) as well + * @return data node object + */ + Collection<DataNode> getDataNodes(String dataspaceName, String anchorName, Collection<String> xpaths, + FetchDescendantsOption fetchDescendantsOption); + + /** * Updates data node for given dataspace and anchor using xpath to parent node. * * @param dataspaceName dataspace name 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 65dfa7f5c6..38fa92a09d 100755 --- 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 @@ -130,6 +130,14 @@ public class CpsDataServiceImpl implements CpsDataService { } @Override + public Collection<DataNode> getDataNodes(final String dataspaceName, final String anchorName, + final Collection<String> xpaths, + final FetchDescendantsOption fetchDescendantsOption) { + cpsValidator.validateNameCharacters(dataspaceName, anchorName); + return cpsDataPersistenceService.getDataNodes(dataspaceName, anchorName, xpaths, fetchDescendantsOption); + } + + @Override public void updateNodeLeaves(final String dataspaceName, final String anchorName, final String parentNodeXpath, final String jsonData, final OffsetDateTime observedTimestamp) { cpsValidator.validateNameCharacters(dataspaceName, anchorName); diff --git a/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java b/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java index b9da4af025..0989ccae2d 100644 --- a/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java +++ b/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java @@ -112,6 +112,19 @@ public interface CpsDataPersistenceService { FetchDescendantsOption fetchDescendantsOption); /** + * Retrieves datanode by XPath for given dataspace and anchor. + * + * @param dataspaceName dataspace name + * @param anchorName anchor name + * @param xpaths collection of xpaths + * @param fetchDescendantsOption defines the scope of data to fetch: either single node or all the descendant nodes + * (recursively) as well + * @return data node object + */ + Collection<DataNode> getDataNodes(String dataspaceName, String anchorName, Collection<String> xpaths, + FetchDescendantsOption fetchDescendantsOption); + + /** * Updates leaves for existing data node. * * @param dataspaceName dataspace name |