diff options
author | 2025-03-10 16:46:22 +0000 | |
---|---|---|
committer | 2025-03-13 10:06:38 +0000 | |
commit | 4f002a7da4001e2fc00d1ed37154112d9c13a828 (patch) | |
tree | 0ca1c891c4e9dde2a071eceac339791462f23efe /cps-ncmp-service | |
parent | 00e49d680dec96a6aebcbb01b17317b6615232b2 (diff) |
Move CPS REST business logic to CPS-Service Layer
(scope limited to methods using PrefixResolver)
- Introduced CPSFacade (for methods invoking multiple CPS Services related to Prefix insertion)
- Introduced DataMapper to combine PrefixResolver & DataMapUtils
- Moved includeDecendants boolean to Enum conversion to Enum class
- Removed redundant tests from DataRestControllerSpec
- Removed redundant tests from QueryRestControllerSpec
- Cleaned up some legacy testware (adding assert etc)
Issue-ID: CPS-2428
Change-Id: Ib3b4dae941ada441be0dc76aaa5cd14e48685cf7
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Diffstat (limited to 'cps-ncmp-service')
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/NcmpCachedResourceRequestHandler.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/NcmpCachedResourceRequestHandler.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/NcmpCachedResourceRequestHandler.java index 2d33234478..1b5dd2f853 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/NcmpCachedResourceRequestHandler.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/NcmpCachedResourceRequestHandler.java @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2022-2024 Nordix Foundation + * Copyright (C) 2022-2025 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,8 @@ public class NcmpCachedResourceRequestHandler extends NcmpDatastoreRequestHandle */ public Collection<DataNode> executeRequest(final String cmHandleId, final String resourceIdentifier, final boolean includeDescendants) { - final FetchDescendantsOption fetchDescendantsOption = getFetchDescendantsOption(includeDescendants); + final FetchDescendantsOption fetchDescendantsOption + = FetchDescendantsOption.getFetchDescendantsOption(includeDescendants); return networkCmProxyQueryService.queryResourceDataOperational(cmHandleId, resourceIdentifier, fetchDescendantsOption); } @@ -59,7 +60,8 @@ public class NcmpCachedResourceRequestHandler extends NcmpDatastoreRequestHandle final String requestId, final boolean includeDescendants, final String authorization) { - final FetchDescendantsOption fetchDescendantsOption = getFetchDescendantsOption(includeDescendants); + final FetchDescendantsOption fetchDescendantsOption + = FetchDescendantsOption.getFetchDescendantsOption(includeDescendants); final DataNode dataNode = cpsDataService.getDataNodes(cmResourceAddress.getDatastoreName(), cmResourceAddress.resolveCmHandleReferenceToId(), @@ -68,8 +70,4 @@ public class NcmpCachedResourceRequestHandler extends NcmpDatastoreRequestHandle return Mono.justOrEmpty(dataNode); } - private static FetchDescendantsOption getFetchDescendantsOption(final boolean includeDescendants) { - return includeDescendants ? FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS - : FetchDescendantsOption.OMIT_DESCENDANTS; - } } |