summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/main
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2024-08-29 20:00:40 +0100
committerdanielhanrahan <daniel.hanrahan@est.tech>2024-09-04 17:21:40 +0100
commit0f225618ab5a5d918c6b1d58afcad17c99d7aad8 (patch)
tree1d1092a596a7150044b39567137f89f570c98111 /cps-ncmp-service/src/main
parentd196932c3ed2edbc3f0a0ce0fb097b40715ad0bb (diff)
[Cps Path Parser] Move NCMP-specific logic to NCMP
Some special case code to disable ancestor-axis was added for CM-handle search (see CPS-2308). It is now relocated to NCMP. This makes other needed improvements of Cps Path Parser easier. - Move special case code into NCMP - Add integration test to ensure CM-handle search works Issue-ID: CPS-2365 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I168d6156be559166f115aa42e21cd987d98b7d41
Diffstat (limited to 'cps-ncmp-service/src/main')
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImpl.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImpl.java
index e36477f8c8..a07954d5a9 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImpl.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/CmHandleQueryServiceImpl.java
@@ -34,6 +34,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
+import org.onap.cps.cpspath.parser.CpsPathUtil;
import org.onap.cps.ncmp.api.inventory.models.TrustLevel;
import org.onap.cps.ncmp.impl.inventory.models.CmHandleState;
import org.onap.cps.ncmp.impl.inventory.models.ModelledDmiServiceLeaves;
@@ -96,6 +97,9 @@ public class CmHandleQueryServiceImpl implements CmHandleQueryService {
@Override
public List<DataNode> queryCmHandleAncestorsByCpsPath(final String cpsPath,
final FetchDescendantsOption fetchDescendantsOption) {
+ if (CpsPathUtil.getCpsPathQuery(cpsPath).getXpathPrefix().endsWith("/cm-handles")) {
+ return queryNcmpRegistryByCpsPath(cpsPath, fetchDescendantsOption);
+ }
return queryNcmpRegistryByCpsPath(cpsPath + ANCESTOR_CM_HANDLES, fetchDescendantsOption);
}