diff options
author | niamhcore <niamh.core@est.tech> | 2021-03-01 13:25:13 +0000 |
---|---|---|
committer | Niamh Core <niamh.core@est.tech> | 2021-03-02 11:13:25 +0000 |
commit | 32446dce35b5bf9d2c84751718cb4ece7f96fa72 (patch) | |
tree | 03a0fb6b16c6c6e692bc54db74440d005c501573 /cps-ri/src/main | |
parent | 7c981df521c9d8eb6f340b2b118491eeeb21ae59 (diff) |
CPS-265 - updating cps path to support include-descendants option.
Issue-ID: CPS-265
Signed-off-by: niamhcore <niamh.core@est.tech>
Change-Id: I9e9b84760dbc8b5eb4b31ab972fdb2d186c6bb48
Diffstat (limited to 'cps-ri/src/main')
-rw-r--r-- | cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java | 6 |
1 files changed, 3 insertions, 3 deletions
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<DataNode> queryDataNodes(final String dataspaceName, final String anchorName, final String cpsPath) { + public List<DataNode> 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()); } |