Merge "Migrate CPS to Spring-boot 3.0"
[cps.git] / cps-ncmp-rest / src / main / java / org / onap / cps / ncmp / rest / controller / NetworkCmProxyInventoryController.java
index 98da150..87f9d83 100755 (executable)
@@ -1,7 +1,7 @@
 /*
  *  ============LICENSE_START=======================================================
  *  Copyright (C) 2021-2022 Bell Canada
- *  Modifications Copyright (C) 2022 Nordix Foundation
+ *  Modifications Copyright (C) 2022-2023 Nordix Foundation
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
 
 package org.onap.cps.ncmp.rest.controller;
 
+import io.micrometer.core.annotation.Timed;
+import jakarta.validation.Valid;
+import java.util.Collection;
 import java.util.List;
-import java.util.Set;
 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;
@@ -54,7 +55,7 @@ public class NetworkCmProxyInventoryController implements NetworkCmProxyInventor
         final CmHandleQueryServiceParameters cmHandleQueryServiceParameters = ncmpRestInputMapper
                 .toCmHandleQueryServiceParameters(cmHandleQueryParameters);
 
-        final Set<String> cmHandleIds = networkCmProxyDataService
+        final Collection<String> cmHandleIds = networkCmProxyDataService
                 .executeCmHandleIdSearchForInventory(cmHandleQueryServiceParameters);
         return ResponseEntity.ok(List.copyOf(cmHandleIds));
     }
@@ -67,7 +68,7 @@ public class NetworkCmProxyInventoryController implements NetworkCmProxyInventor
      */
     @Override
     public ResponseEntity<List<String>> getAllCmHandleIdsForRegisteredDmi(final String dmiPluginIdentifier) {
-        final Set<String> cmHandleIds =
+        final Collection<String> cmHandleIds =
                 networkCmProxyDataService.getAllCmHandleIdsByDmiPluginIdentifier(dmiPluginIdentifier);
         return ResponseEntity.ok(List.copyOf(cmHandleIds));
     }
@@ -78,6 +79,8 @@ public class NetworkCmProxyInventoryController implements NetworkCmProxyInventor
      * @param restDmiPluginRegistration the registration data
      */
     @Override
+    @Timed(value = "cps.ncmp.inventory.controller.update",
+        description = "Time taken to handle registration request")
     public ResponseEntity updateDmiPluginRegistration(
         final @Valid RestDmiPluginRegistration restDmiPluginRegistration) {
         final DmiPluginRegistrationResponse dmiPluginRegistrationResponse =