From 0b57f077accd7cf7fa58a8cf69f3e4111f805822 Mon Sep 17 00:00:00 2001 From: lukegleeson Date: Thu, 28 Jul 2022 17:00:46 +0100 Subject: Incorrect response to {} for cmhandle id-searches An empty body for the CmHandles id-searches api returns an anchor instead of all cm-handles Now returns all childnode ids for the dmi-registry Issue-ID: CPS-1175 Signed-off-by: lukegleeson Change-Id: I358970170a4eb7905e9646605f0f373fbcd78945 --- .../cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cps-ncmp-service/src/main') diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceImpl.java index d784bcdeac..6696f8e5ad 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceImpl.java @@ -217,7 +217,9 @@ public class NetworkCmProxyCmHandlerQueryServiceImpl implements NetworkCmProxyCm } private Set getAllCmHandleIds() { - return inventoryPersistence.getAnchors().parallelStream().map(Anchor::getName).collect(Collectors.toSet()); + return inventoryPersistence.getDataNode("/dmi-registry") + .getChildDataNodes().stream().map(dataNode -> dataNode.getLeaves().get("id").toString()) + .collect(Collectors.toSet()); } private NcmpServiceCmHandle createNcmpServiceCmHandle(final DataNode dataNode) { -- cgit 1.2.3-korg