diff options
author | 2022-12-15 16:06:20 +0000 | |
---|---|---|
committer | 2023-01-11 13:45:36 +0000 | |
commit | 9c56b3032222b57549aa17dd281e4794fd9e25b6 (patch) | |
tree | 5bb6dacf0c5c84463c4a8810609776069ce16d09 /cps-service/src/main | |
parent | b48469262c83dc1e88b12d162de88a05ce61159c (diff) |
Fetch CM handles by collection of xpaths
- Added FragmentRepositoryMultiPathQuery
- Removed Hibernate method for same
- Added perf. test
- Handle escaping of single qoutes in sql-data
- Increased timing for path paser performance test
Issue-ID: CPS-1422
Signed-off-by: seanbeirne <sean.beirne@est.tech>
Change-Id: Ibea12a44bffd29ed43cc1560b507d1fa7e968b8b
Diffstat (limited to 'cps-service/src/main')
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 012d7f825..6332f0910 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 65dfa7f5c..38fa92a09 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 b9da4af02..0989ccae2 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 |