From 32446dce35b5bf9d2c84751718cb4ece7f96fa72 Mon Sep 17 00:00:00 2001 From: niamhcore Date: Mon, 1 Mar 2021 13:25:13 +0000 Subject: CPS-265 - updating cps path to support include-descendants option. Issue-ID: CPS-265 Signed-off-by: niamhcore Change-Id: I9e9b84760dbc8b5eb4b31ab972fdb2d186c6bb48 --- .../java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cps-ri/src/main') diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java index 2d9588e8f3..0c61c99094 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java @@ -21,7 +21,6 @@ package org.onap.cps.spi.impl; import static org.onap.cps.spi.FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS; -import static org.onap.cps.spi.FetchDescendantsOption.OMIT_DESCENDANTS; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet.Builder; @@ -127,7 +126,8 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService } @Override - public List queryDataNodes(final String dataspaceName, final String anchorName, final String cpsPath) { + public List queryDataNodes(final String dataspaceName, final String anchorName, final String cpsPath, + final FetchDescendantsOption fetchDescendantsOption) { final DataspaceEntity dataspaceEntity = dataspaceRepository.getByName(dataspaceName); final AnchorEntity anchorEntity = anchorRepository.getByDataspaceAndName(dataspaceEntity, anchorName); final CpsPathQuery cpsPathQuery = CpsPathQuery.createFrom(cpsPath); @@ -135,7 +135,7 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService .getByAnchorAndXpathAndLeafAttributes(anchorEntity.getId(), cpsPathQuery .getXpathPrefix(), cpsPathQuery.getLeafName(), cpsPathQuery.getLeafValue()); return fragmentEntities.stream() - .map(fragmentEntity -> toDataNode(fragmentEntity, OMIT_DESCENDANTS)) + .map(fragmentEntity -> toDataNode(fragmentEntity, fetchDescendantsOption)) .collect(Collectors.toUnmodifiableList()); } -- cgit 1.2.3-korg