X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cps-service%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fcps%2Fapi%2Fimpl%2FCpsQueryServiceImpl.java;h=7b9043a608e9a8aeb1b3377c6a96681b09d90a77;hb=e5254a7b007e4a0dc59003d94f43e688c25cf7d1;hp=c2003d6bf7b17c83fdb79d395a668dc480fb98be;hpb=1377bf984e9d3ae97b1dc58c7d62ff1cafe60bb9;p=cps.git 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 c2003d6bf..7b9043a60 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 @@ -1,6 +1,6 @@ /* - * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation + * ============LICENSE_START======================================================= + * Copyright (C) 2021-2022 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,24 +21,25 @@ package org.onap.cps.api.impl; import java.util.Collection; +import lombok.RequiredArgsConstructor; 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.onap.cps.utils.CpsValidator; -import org.springframework.beans.factory.annotation.Autowired; +import org.onap.cps.spi.utils.CpsValidator; import org.springframework.stereotype.Service; @Service +@RequiredArgsConstructor public class CpsQueryServiceImpl implements CpsQueryService { - @Autowired - private CpsDataPersistenceService cpsDataPersistenceService; + private final CpsDataPersistenceService cpsDataPersistenceService; + private final CpsValidator cpsValidator; @Override public Collection queryDataNodes(final String dataspaceName, final String anchorName, final String cpsPath, final FetchDescendantsOption fetchDescendantsOption) { - CpsValidator.validateNameCharacters(dataspaceName, anchorName); + cpsValidator.validateNameCharacters(dataspaceName, anchorName); return cpsDataPersistenceService.queryDataNodes(dataspaceName, anchorName, cpsPath, fetchDescendantsOption); } }