aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest/src/main/java/org/onap
diff options
context:
space:
mode:
Diffstat (limited to 'cps-ncmp-rest/src/main/java/org/onap')
-rwxr-xr-xcps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java14
-rwxr-xr-xcps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java17
-rw-r--r--cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/DataOperationRequestMapper.java4
-rw-r--r--cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/DeprecationHelper.java17
4 files changed, 34 insertions, 18 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
index 42f709dcf5..3676bb1393 100755
--- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
+++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
@@ -268,18 +268,20 @@ public class NetworkCmProxyController implements NetworkCmProxyApi {
}
/**
- * Query and return cm handle ids that match the given query parameters.
+ * Query and return cm handle ids or alternate ids that match the given query parameters.
*
- * @param cmHandleQueryParameters the cm handle query parameters
- * @return collection of cm handle ids
+ * @param cmHandleQueryParameters the cm handle query parameters
+ * @param outputAlternateId Boolean for cm handle reference type either
+ * cm handle id (false or null) or alternate id (true)
+ * @return collection of cm handle ids
*/
@Override
- public ResponseEntity<List<String>> searchCmHandleIds(
- final CmHandleQueryParameters cmHandleQueryParameters) {
+ public ResponseEntity<List<String>> searchCmHandleIds(final CmHandleQueryParameters cmHandleQueryParameters,
+ final Boolean outputAlternateId) {
final CmHandleQueryApiParameters cmHandleQueryApiParameters =
jsonObjectMapper.convertToValueType(cmHandleQueryParameters, CmHandleQueryApiParameters.class);
final Collection<String> cmHandleIds
- = networkCmProxyInventoryFacade.executeCmHandleIdSearch(cmHandleQueryApiParameters);
+ = networkCmProxyInventoryFacade.executeCmHandleIdSearch(cmHandleQueryApiParameters, outputAlternateId);
return ResponseEntity.ok(List.copyOf(cmHandleIds));
}
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 8aa86ade36..f76376991a 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
@@ -1,7 +1,7 @@
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021-2022 Bell Canada
- * Modifications Copyright (C) 2022-2023 Nordix Foundation
+ * Modifications Copyright (C) 2022-2024 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,13 +51,22 @@ public class NetworkCmProxyInventoryController implements NetworkCmProxyInventor
private final NetworkCmProxyInventoryFacade networkCmProxyInventoryFacade;
private final NcmpRestInputMapper ncmpRestInputMapper;
+ /**
+ * Get all cm handle references under a registered DMI plugin.
+ *
+ * @param cmHandleQueryParameters DMI plugin identifier
+ * @param outputAlternateId Boolean for cm handle reference type either
+ * cm handle id (False) or alternate id (True)
+ * @return list of cm handle IDs
+ */
@Override
- public ResponseEntity<List<String>> searchCmHandleIds(final CmHandleQueryParameters cmHandleQueryParameters) {
+ public ResponseEntity<List<String>> searchCmHandleIds(final CmHandleQueryParameters cmHandleQueryParameters,
+ final Boolean outputAlternateId) {
final CmHandleQueryServiceParameters cmHandleQueryServiceParameters = ncmpRestInputMapper
.toCmHandleQueryServiceParameters(cmHandleQueryParameters);
final Collection<String> cmHandleIds = networkCmProxyInventoryFacade
- .executeParameterizedCmHandleIdSearch(cmHandleQueryServiceParameters);
+ .executeParameterizedCmHandleIdSearch(cmHandleQueryServiceParameters, outputAlternateId);
return ResponseEntity.ok(List.copyOf(cmHandleIds));
}
@@ -85,7 +94,7 @@ public class NetworkCmProxyInventoryController implements NetworkCmProxyInventor
public ResponseEntity updateDmiPluginRegistration(
final @Valid RestDmiPluginRegistration restDmiPluginRegistration) {
final DmiPluginRegistrationResponse dmiPluginRegistrationResponse =
- networkCmProxyInventoryFacade.updateDmiRegistrationAndSyncModule(
+ networkCmProxyInventoryFacade.updateDmiRegistration(
ncmpRestInputMapper.toDmiPluginRegistration(restDmiPluginRegistration));
final DmiPluginRegistrationErrorResponse failedRegistrationErrorResponse =
getFailureRegistrationResponse(dmiPluginRegistrationResponse);
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/DataOperationRequestMapper.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/DataOperationRequestMapper.java
index 42622a2ca2..1e73aca158 100644
--- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/DataOperationRequestMapper.java
+++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/DataOperationRequestMapper.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2023 Nordix Foundation
+ * Copyright (C) 2023-2024 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@ public interface DataOperationRequestMapper {
DataOperationRequest toDataOperationRequest(
org.onap.cps.ncmp.rest.model.DataOperationRequest dataOperationRequest);
- @Mapping(source = "targetIds", target = "cmHandleIds")
+ @Mapping(source = "targetIds", target = "cmHandleReferences")
DataOperationDefinition toDataOperationDefinition(
org.onap.cps.ncmp.rest.model.DataOperationDefinition dataOperationDefinition);
}
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/DeprecationHelper.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/DeprecationHelper.java
index 7492c1fcac..f5804d73ad 100644
--- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/DeprecationHelper.java
+++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/util/DeprecationHelper.java
@@ -36,13 +36,19 @@ public class DeprecationHelper {
private final JsonObjectMapper jsonObjectMapper;
/**
- * Convert the old condition properties to the new schema.
- * !!! remove it after the old condition removed !!!
- * it only works for module names
+ * Converts the old condition properties from {@link CmHandleQueryParameters}
+ * to the new schema defined in {@link CmHandleQueryApiParameters}.
*
- * @deprecated this method will be removed in Release 12 (No Name know yet)
+ * <p>This method transforms the old module name-based condition properties to the new format.
+ * It should only be used for backward compatibility until the old conditions
+ * are removed in future releases.
*
- * @param cmHandleQueryParameters the original input parameter
+ * <p><b>Important:</b> This method will be removed in next release(release name not finalized yet).</p>
+ *
+ * @param cmHandleQueryParameters the original query parameters containing old condition properties
+ * @return an instance of {@link CmHandleQueryApiParameters} with the transformed condition properties
+ * @deprecated This method is deprecated and will be removed in Release 12.
+ * Use the new condition handling approach instead.
*/
@Deprecated
public CmHandleQueryApiParameters mapOldConditionProperties(
@@ -69,7 +75,6 @@ public class DeprecationHelper {
}
);
}
-
return cmHandleQueryApiParameters;
}
}