diff options
Diffstat (limited to 'cps-service/src/main')
3 files changed, 10 insertions, 4 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/api/CpsQueryService.java b/cps-service/src/main/java/org/onap/cps/api/CpsQueryService.java index b432af8009..0f4bf2dc4c 100644 --- a/cps-service/src/main/java/org/onap/cps/api/CpsQueryService.java +++ b/cps-service/src/main/java/org/onap/cps/api/CpsQueryService.java @@ -21,6 +21,7 @@ package org.onap.cps.api; import java.util.Collection; import org.checkerframework.checker.nullness.qual.NonNull; +import org.onap.cps.spi.FetchDescendantsOption; import org.onap.cps.spi.model.DataNode; /* @@ -34,9 +35,11 @@ public interface CpsQueryService { * @param dataspaceName dataspace name * @param anchorName anchor name * @param cpsPath cps path + * @param fetchDescendantsOption defines whether the descendants of the node(s) found by the query should be + * included in the output * @return a collection of data nodes */ Collection<DataNode> queryDataNodes(@NonNull String dataspaceName, @NonNull String anchorName, - @NonNull String cpsPath); + @NonNull String cpsPath, @NonNull FetchDescendantsOption fetchDescendantsOption); } diff --git a/cps-service/src/main/java/org/onap/cps/api/impl/CpsQueryServiceImpl.java b/cps-service/src/main/java/org/onap/cps/api/impl/CpsQueryServiceImpl.java index 63d0a0fbb9..79fa6c717e 100644 --- a/cps-service/src/main/java/org/onap/cps/api/impl/CpsQueryServiceImpl.java +++ b/cps-service/src/main/java/org/onap/cps/api/impl/CpsQueryServiceImpl.java @@ -22,6 +22,7 @@ package org.onap.cps.api.impl; import java.util.Collection; import org.onap.cps.api.CpsQueryService; import org.onap.cps.spi.CpsDataPersistenceService; +import org.onap.cps.spi.FetchDescendantsOption; import org.onap.cps.spi.model.DataNode; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -34,7 +35,7 @@ public class CpsQueryServiceImpl implements CpsQueryService { @Override public Collection<DataNode> queryDataNodes(final String dataspaceName, final String anchorName, - final String cpsPath) { - return cpsDataPersistenceService.queryDataNodes(dataspaceName, anchorName, cpsPath); + final String cpsPath, final FetchDescendantsOption fetchDescendantsOption) { + return cpsDataPersistenceService.queryDataNodes(dataspaceName, anchorName, cpsPath, fetchDescendantsOption); } }
\ No newline at end of file diff --git a/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java b/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java index d2b6d45d66..48f9763eeb 100644 --- a/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java +++ b/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java @@ -94,8 +94,10 @@ public interface CpsDataPersistenceService { * @param dataspaceName dataspace name * @param anchorName anchor name * @param cpsPath cps path + * @param fetchDescendantsOption defines whether the descendants of the node(s) found by the query should be + * included in the output * @return the data nodes found i.e. 0 or more data nodes */ Collection<DataNode> queryDataNodes(@NonNull String dataspaceName, @NonNull String anchorName, - @NonNull String cpsPath); + @NonNull String cpsPath, @NonNull FetchDescendantsOption fetchDescendantsOption); } |