X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cps-ncmp-service%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fcps%2Fncmp%2Fapi%2Finventory%2FInventoryPersistence.java;h=cbd30a8fef8aff6e59da827d5f5e6aaf339b40b7;hb=7d486385a46b8dfa3a72db27dc4f31bf74d035bb;hp=bfc3a9ac062a94e998e928c8bd298fff3a1aea5b;hpb=3f868bb136823103a7707d75020eb8208b31df0d;p=cps.git diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistence.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistence.java index bfc3a9ac0..cbd30a8fe 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistence.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistence.java @@ -1,6 +1,7 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2022 Nordix Foundation + * Copyright (C) 2022-2023 Nordix Foundation + * Modifications Copyright (C) 2023 TechMahindra Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +24,7 @@ package org.onap.cps.ncmp.api.inventory; import java.util.Collection; import java.util.Map; import org.onap.cps.ncmp.api.impl.yangmodels.YangModelCmHandle; -import org.onap.cps.spi.model.Anchor; +import org.onap.cps.spi.FetchDescendantsOption; import org.onap.cps.spi.model.DataNode; import org.onap.cps.spi.model.ModuleDefinition; import org.onap.cps.spi.model.ModuleReference; @@ -61,6 +62,14 @@ public interface InventoryPersistence { */ YangModelCmHandle getYangModelCmHandle(String cmHandleId); + /** + * This method retrieves DMI service name, DMI properties and the state for a given cm handle. + * + * @param cmHandleIds a list of the ids of the cm handles + * @return collection of yang model cm handles + */ + Collection getYangModelCmHandles(Collection cmHandleIds); + /** * Method to return module definitions by cmHandleId. * @@ -105,13 +114,46 @@ public interface InventoryPersistence { */ void deleteSchemaSetWithCascade(String schemaSetName); + /** + * Method to delete multiple schema sets. + * + * @param schemaSetNames schema set names + */ + void deleteSchemaSetsWithCascade(Collection schemaSetNames); + + /** + * Get data node via xpath. + * + * @param xpath xpath + * @return data node + */ + Collection getDataNode(String xpath); + /** * Get data node via xpath. * * @param xpath xpath + * @param fetchDescendantsOption fetch descendants option * @return data node */ - DataNode getDataNode(String xpath); + Collection getDataNode(String xpath, FetchDescendantsOption fetchDescendantsOption); + + /** + * Get collection of data nodes via xpaths. + * + * @param xpaths collection of xpaths + * @return collection of data nodes + */ + Collection getDataNodes(Collection xpaths); + + /** + * Get collection of data nodes via xpaths. + * + * @param xpaths collection of xpaths + * @param fetchDescendantsOption fetch descendants option + * @return collection of data nodes + */ + Collection getDataNodes(Collection xpaths, FetchDescendantsOption fetchDescendantsOption); /** * Get data node of given cm handle. @@ -119,22 +161,23 @@ public interface InventoryPersistence { * @param cmHandleId cmHandle ID * @return data node */ - DataNode getCmHandleDataNode(String cmHandleId); + Collection getCmHandleDataNode(String cmHandleId); /** - * Query anchors via module names. + * Get collection of data nodes of given cm handles. * - * @param moduleNamesForQuery module names - * @return Collection of anchors + * @param cmHandleIds collection of cmHandle IDs + * @return collection of data nodes */ - Collection queryAnchors(Collection moduleNamesForQuery); + Collection getCmHandleDataNodes(Collection cmHandleIds); /** - * Method to get all anchors. + * get CM handles that has given module names. * - * @return Collection of anchors + * @param moduleNamesForQuery module names + * @return Collection of CM handle Ids */ - Collection getAnchors(); + Collection getCmHandleIdsWithGivenModules(Collection moduleNamesForQuery); /** * Replaces list content by removing all existing elements and inserting the given new elements as data nodes. @@ -145,9 +188,16 @@ public interface InventoryPersistence { void replaceListContent(String parentNodeXpath, Collection dataNodes); /** - * Deletes data node for given anchor and dataspace. + * Deletes data node. * * @param dataNodeXpath data node xpath */ void deleteDataNode(String dataNodeXpath); + + /** + * Deletes multiple data nodes. + * + * @param dataNodeXpaths data node xpaths + */ + void deleteDataNodes(Collection dataNodeXpaths); }