summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/main/java/org
diff options
context:
space:
mode:
authorlukegleeson <luke.gleeson@est.tech>2023-02-23 14:08:10 +0000
committerlukegleeson <luke.gleeson@est.tech>2023-02-23 14:08:59 +0000
commit003de55a8e6c53643032731e68edc43c0698fd81 (patch)
tree426f55c257c2b7283004ffa69f2fef49c91e8cfb /cps-ncmp-service/src/main/java/org
parent60cff5c74886d5bd31657d292cc23ac45455b0d9 (diff)
Revert "Omit descendants when not need in ncmp inventory queries"
This reverts commit eba77598601a7e3430f9582dfe433495ded3244c. Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I76a0d1252177c4115de9190ee7f3bb6d15c4e19a
Diffstat (limited to 'cps-ncmp-service/src/main/java/org')
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceImpl.java11
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/CmHandleQueriesImpl.java2
2 files changed, 5 insertions, 8 deletions
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 ecb6e522f7..a98c6008cf 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
@@ -26,7 +26,6 @@ import static org.onap.cps.ncmp.api.impl.utils.RestQueryParametersValidator.vali
import static org.onap.cps.ncmp.api.impl.utils.YangDataConverter.convertYangModelCmHandleToNcmpServiceCmHandle;
import static org.onap.cps.spi.FetchDescendantsOption.FETCH_DIRECT_CHILDREN_ONLY;
import static org.onap.cps.spi.FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS;
-import static org.onap.cps.spi.FetchDescendantsOption.OMIT_DESCENDANTS;
import java.util.ArrayList;
import java.util.Collection;
@@ -50,7 +49,6 @@ import org.onap.cps.ncmp.api.inventory.InventoryPersistence;
import org.onap.cps.ncmp.api.inventory.enums.PropertyType;
import org.onap.cps.ncmp.api.models.CmHandleQueryServiceParameters;
import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle;
-import org.onap.cps.spi.FetchDescendantsOption;
import org.onap.cps.spi.exceptions.DataValidationException;
import org.onap.cps.spi.model.ConditionProperties;
import org.onap.cps.spi.model.DataNode;
@@ -80,7 +78,7 @@ public class NetworkCmProxyCmHandlerQueryServiceImpl implements NetworkCmProxyCm
}
final Map<String, NcmpServiceCmHandle> combinedQueryResult = executeInventoryQueries(
- cmHandleQueryServiceParameters, INCLUDE_ALL_DESCENDANTS);
+ cmHandleQueryServiceParameters);
return new HashSet<>(combineWithModuleNameQuery(cmHandleQueryServiceParameters, combinedQueryResult).values());
}
@@ -100,7 +98,7 @@ public class NetworkCmProxyCmHandlerQueryServiceImpl implements NetworkCmProxyCm
}
final Map<String, NcmpServiceCmHandle> combinedQueryResult = executeInventoryQueries(
- cmHandleQueryServiceParameters, OMIT_DESCENDANTS);
+ cmHandleQueryServiceParameters);
final Collection<String> moduleNamesForQuery =
getModuleNamesForQuery(cmHandleQueryServiceParameters.getCmHandleQueryParameters());
@@ -231,8 +229,7 @@ public class NetworkCmProxyCmHandlerQueryServiceImpl implements NetworkCmProxyCm
}
private Map<String, NcmpServiceCmHandle> executeInventoryQueries(
- final CmHandleQueryServiceParameters cmHandleQueryServiceParameters,
- final FetchDescendantsOption fetchDescendantsOption) {
+ final CmHandleQueryServiceParameters cmHandleQueryServiceParameters) {
final Map<String, String> cpsPath = getCpsPath(cmHandleQueryServiceParameters.getCmHandleQueryParameters());
if (!validateCpsPathConditionProperties(cpsPath)) {
return Collections.emptyMap();
@@ -243,7 +240,7 @@ public class NetworkCmProxyCmHandlerQueryServiceImpl implements NetworkCmProxyCm
} else {
try {
cpsPathQueryResult = cmHandleQueries.queryCmHandleDataNodesByCpsPath(
- cpsPath.get("cpsPath"), fetchDescendantsOption)
+ cpsPath.get("cpsPath"), INCLUDE_ALL_DESCENDANTS)
.stream().map(this::createNcmpServiceCmHandle)
.collect(Collectors.toMap(NcmpServiceCmHandle::getCmHandleId,
Function.identity()));
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/CmHandleQueriesImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/CmHandleQueriesImpl.java
index 6ca716c270..0f86cb7be6 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/CmHandleQueriesImpl.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/CmHandleQueriesImpl.java
@@ -78,7 +78,7 @@ public class CmHandleQueriesImpl implements CmHandleQueries {
+ publicPropertyQueryPair.getKey()
+ "\" and @value=\"" + publicPropertyQueryPair.getValue() + "\"]";
- final Collection<DataNode> dataNodes = queryCmHandleDataNodesByCpsPath(cpsPath, OMIT_DESCENDANTS);
+ final Collection<DataNode> dataNodes = queryCmHandleDataNodesByCpsPath(cpsPath, INCLUDE_ALL_DESCENDANTS);
if (cmHandleIdToNcmpServiceCmHandles == null) {
cmHandleIdToNcmpServiceCmHandles = collectDataNodesToNcmpServiceCmHandles(dataNodes);
} else {