diff options
Diffstat (limited to 'cps-service')
3 files changed, 11 insertions, 13 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 3044fe0a90..30c8bbbdf3 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 @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2020-2024 Nordix Foundation + * Copyright (C) 2020-2025 Nordix Foundation * Modifications Copyright (C) 2022-2023 TechMahindra Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,7 +32,7 @@ import org.onap.cps.api.parameters.PaginationOption; */ public interface CpsQueryService { - public static int NO_LIMIT = 0; + int NO_LIMIT = 0; /** * Get data nodes for the given dataspace and anchor by cps path. diff --git a/cps-service/src/main/java/org/onap/cps/impl/CpsQueryServiceImpl.java b/cps-service/src/main/java/org/onap/cps/impl/CpsQueryServiceImpl.java index f27445f7c9..a3884820c7 100644 --- a/cps-service/src/main/java/org/onap/cps/impl/CpsQueryServiceImpl.java +++ b/cps-service/src/main/java/org/onap/cps/impl/CpsQueryServiceImpl.java @@ -52,12 +52,12 @@ public class CpsQueryServiceImpl implements CpsQueryService { @Override @Timed(value = "cps.data.service.datanode.query", description = "Time taken to query data nodes with a limit on results") - public Collection<DataNode> queryDataNodes(final String dataSpaceName, final String anchorName, + public Collection<DataNode> queryDataNodes(final String dataspaceName, final String anchorName, final String cpsPath, final FetchDescendantsOption fetchDescendantsOption, final int queryResultLimit) { - cpsValidator.validateNameCharacters(dataSpaceName, anchorName); - return cpsDataPersistenceService.queryDataNodes(dataSpaceName, + cpsValidator.validateNameCharacters(dataspaceName, anchorName); + return cpsDataPersistenceService.queryDataNodes(dataspaceName, anchorName, cpsPath, fetchDescendantsOption, diff --git a/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java b/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java index ab7a095572..04b491692a 100644 --- a/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java +++ b/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java @@ -33,6 +33,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; import lombok.NoArgsConstructor; @@ -77,7 +78,7 @@ public final class YangTextSchemaSourceSetBuilder { * @return the YangTextSchemaSourceSet */ public YangTextSchemaSourceSet build() { - final var schemaContext = generateSchemaContext(yangModelMap.build()); + final SchemaContext schemaContext = generateSchemaContext(yangModelMap.build()); return new YangTextSchemaSourceSetImpl(schemaContext); } @@ -113,9 +114,7 @@ public final class YangTextSchemaSourceSetBuilder { @Override public List<ModuleReference> getModuleReferences() { - return schemaContext.getModules().stream() - .map(YangTextSchemaSourceSetImpl::toModuleReference) - .collect(Collectors.toList()); + return schemaContext.getModules().stream().map(YangTextSchemaSourceSetImpl::toModuleReference).toList(); } private static ModuleReference toModuleReference(final Module module) { @@ -164,12 +163,11 @@ public final class YangTextSchemaSourceSetBuilder { private static List<YangTextSchemaSource> forResources(final Map<String, String> yangResourceNameToContent) { return yangResourceNameToContent.entrySet().stream() - .map(entry -> toYangTextSchemaSource(entry.getKey(), entry.getValue())) - .collect(Collectors.toList()); + .map(entry -> toYangTextSchemaSource(entry.getKey(), entry.getValue())).toList(); } private static YangTextSchemaSource toYangTextSchemaSource(final String sourceName, final String source) { - final var revisionSourceIdentifier = + final RevisionSourceIdentifier revisionSourceIdentifier = createIdentifierFromSourceName(checkNotNull(sourceName)); return new YangTextSchemaSource(revisionSourceIdentifier) { @@ -192,7 +190,7 @@ public final class YangTextSchemaSourceSetBuilder { } private static RevisionSourceIdentifier createIdentifierFromSourceName(final String sourceName) { - final var matcher = RFC6020_RECOMMENDED_FILENAME_PATTERN.matcher(sourceName); + final Matcher matcher = RFC6020_RECOMMENDED_FILENAME_PATTERN.matcher(sourceName); if (matcher.matches()) { return RevisionSourceIdentifier.create(matcher.group(1), Revision.of(matcher.group(2))); } |