aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
diff options
context:
space:
mode:
authorleventecsanyi <levente.csanyi@est.tech>2022-10-26 10:44:08 +0200
committerleventecsanyi <levente.csanyi@est.tech>2022-12-01 21:32:44 +0100
commit37d72855721caa646144ad323fe51ae78af15507 (patch)
tree0d4494c83572f779aded34a7de3b03774c19873c /cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
parent94d77dd3430bf504b1fe1209760cfeedb47752a7 (diff)
Filter on private properties of CM Handles
- Moved cm handle query validation to cps-ncmp-service (where it belongs!) - Added new enum type for private/public field types - Created new methods for private and public queries - Added new REST endpoint - Created service methods for filtering on different types of properties - Refactored getPublicPropertyPairs and queryCmHandleAnyProperties - Added unit test for the controller layer - Fixed refactoring suggestions - Imporved code coverage with unit tests - Refactoring - Added new functionality to NcmpRestInputMapper - Updated version number to 3.2.1-SNAPSHOT and updated release-notes.rst Issue-ID: CPS-1236 Change-Id: I0ddf6866473f7c3c6b8507d222d441bf97ca6bdc Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
Diffstat (limited to 'cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java')
-rwxr-xr-xcps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
index 0c428e442..98da15093 100755
--- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
+++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
@@ -27,10 +27,12 @@ import java.util.stream.Collectors;
import javax.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.onap.cps.ncmp.api.NetworkCmProxyDataService;
+import org.onap.cps.ncmp.api.models.CmHandleQueryServiceParameters;
import org.onap.cps.ncmp.api.models.CmHandleRegistrationResponse;
import org.onap.cps.ncmp.api.models.CmHandleRegistrationResponse.Status;
import org.onap.cps.ncmp.api.models.DmiPluginRegistrationResponse;
import org.onap.cps.ncmp.rest.api.NetworkCmProxyInventoryApi;
+import org.onap.cps.ncmp.rest.model.CmHandleQueryParameters;
import org.onap.cps.ncmp.rest.model.CmHandlerRegistrationErrorResponse;
import org.onap.cps.ncmp.rest.model.DmiPluginRegistrationErrorResponse;
import org.onap.cps.ncmp.rest.model.RestDmiPluginRegistration;
@@ -47,6 +49,16 @@ public class NetworkCmProxyInventoryController implements NetworkCmProxyInventor
private final NetworkCmProxyDataService networkCmProxyDataService;
private final NcmpRestInputMapper ncmpRestInputMapper;
+ @Override
+ public ResponseEntity<List<String>> searchCmHandleIds(final CmHandleQueryParameters cmHandleQueryParameters) {
+ final CmHandleQueryServiceParameters cmHandleQueryServiceParameters = ncmpRestInputMapper
+ .toCmHandleQueryServiceParameters(cmHandleQueryParameters);
+
+ final Set<String> cmHandleIds = networkCmProxyDataService
+ .executeCmHandleIdSearchForInventory(cmHandleQueryServiceParameters);
+ return ResponseEntity.ok(List.copyOf(cmHandleIds));
+ }
+
/**
* Get all cm-handle IDs under a registered DMI plugin.
*