summaryrefslogtreecommitdiffstats
path: root/cps-service/src
diff options
context:
space:
mode:
authorSourabh Sourabh <sourabh.sourabh@est.tech>2023-01-16 08:40:23 +0000
committerGerrit Code Review <gerrit@onap.org>2023-01-16 08:40:23 +0000
commitecfce9d3e46410e1158c0f640fa833c101c4bda4 (patch)
tree8642f87d0c5b8961e847deab5f57d67cfc69c182 /cps-service/src
parentef2b1518cf984f34b0640eb16ed44b26c9192efe (diff)
parent9c56b3032222b57549aa17dd281e4794fd9e25b6 (diff)
Merge "Fetch CM handles by collection of xpaths"
Diffstat (limited to 'cps-service/src')
-rw-r--r--cps-service/src/main/java/org/onap/cps/api/CpsDataService.java13
-rwxr-xr-xcps-service/src/main/java/org/onap/cps/api/impl/CpsDataServiceImpl.java8
-rw-r--r--cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java13
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