From 9718417885caa9581a9115ba07e2060bd38ec9b8 Mon Sep 17 00:00:00 2001 From: mpriyank Date: Fri, 23 Aug 2024 16:33:44 +0100 Subject: Support for alternate-id CPS-E05 composite state - Added support for alternate id for the composite state API for CPS-E05#15 Issue-ID: CPS-2377 Change-Id: I1af41efb8cec762be68250cae7c1e98fbc61a4f5 Signed-off-by: mpriyank --- .../onap/cps/ncmp/api/inventory/NetworkCmProxyInventoryFacade.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cps-ncmp-service/src/main') diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/NetworkCmProxyInventoryFacade.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/NetworkCmProxyInventoryFacade.java index 6f51a8d011..1acd937a31 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/NetworkCmProxyInventoryFacade.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/NetworkCmProxyInventoryFacade.java @@ -44,6 +44,7 @@ import org.onap.cps.ncmp.impl.inventory.models.CmHandleQueryConditions; import org.onap.cps.ncmp.impl.inventory.models.InventoryQueryConditions; import org.onap.cps.ncmp.impl.inventory.models.YangModelCmHandle; import org.onap.cps.ncmp.impl.inventory.trustlevel.TrustLevelManager; +import org.onap.cps.ncmp.impl.utils.AlternateIdMatcher; import org.onap.cps.ncmp.impl.utils.YangDataConverter; import org.onap.cps.spi.model.ModuleDefinition; import org.onap.cps.spi.model.ModuleReference; @@ -61,6 +62,7 @@ public class NetworkCmProxyInventoryFacade { private final InventoryPersistence inventoryPersistence; private final JsonObjectMapper jsonObjectMapper; private final TrustLevelManager trustLevelManager; + private final AlternateIdMatcher alternateIdMatcher; /** * Registration of Created, Removed, Updated or Upgraded CM Handles. @@ -198,10 +200,11 @@ public class NetworkCmProxyInventoryFacade { /** * Get cm handle composite state for a given cm handle id. * - * @param cmHandleId cm handle identifier + * @param cmHandleReference cm handle or alternate identifier * @return cm handle state */ - public CompositeState getCmHandleCompositeState(final String cmHandleId) { + public CompositeState getCmHandleCompositeState(final String cmHandleReference) { + final String cmHandleId = alternateIdMatcher.getCmHandleId(cmHandleReference); return inventoryPersistence.getYangModelCmHandle(cmHandleId).getCompositeState(); } -- cgit 1.2.3-korg