diff options
author | 2023-05-03 18:21:46 +0100 | |
---|---|---|
committer | 2023-05-03 18:33:11 +0100 | |
commit | 08a47195fb3882e396b2dd01b01afa5da42255fb (patch) | |
tree | 3b908f35e297184dd2ea197ff82e302a09d956e6 /cps-ncmp-service/src/main | |
parent | 436b75b129263fbf6e81d3c9097ad066bc865695 (diff) |
Refactor datatrore handling in API requests
- Fully parameterized datastore(name)
- Improved controler testing to verify all parameter handling
- Simplified service inject (alwasy using contructors instead of @AutoWire)
- Added delay to fix isuse with intermitting failign test
that tests invocation of a method that is executed on a separate thread
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Change-Id: Iba5d118d2484badee9c7c90ec7694882f6557d16
Diffstat (limited to 'cps-ncmp-service/src/main')
2 files changed, 19 insertions, 19 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java index 03737bc51..05490d8fc 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java @@ -53,7 +53,7 @@ public interface NetworkCmProxyDataService { /** * Get resource data for given data store using dmi. * - * @param dataStoreName data store name + * @param datastoreName datastore name * @param cmHandleId cm handle identifier * @param resourceIdentifier resource identifier * @param optionsParamInQuery options query @@ -61,7 +61,7 @@ public interface NetworkCmProxyDataService { * @param requestId unique requestId for async request * @return {@code Object} resource data */ - Object getResourceDataForCmHandle(String dataStoreName, + Object getResourceDataForCmHandle(String datastoreName, String cmHandleId, String resourceIdentifier, String optionsParamInQuery, @@ -71,13 +71,13 @@ public interface NetworkCmProxyDataService { /** * Get resource data for operational. * - * @param dataStoreName data store name - * @param cmHandleId cm handle identifier + * @param datastoreName datastore name + * @param cmHandleId cm handle identifier * @param resourceIdentifier resource identifier * @Link FetchDescendantsOption fetch descendants option * @return {@code Object} resource data */ - Object getResourceDataForCmHandle(String dataStoreName, + Object getResourceDataForCmHandle(String datastoreName, String cmHandleId, String resourceIdentifier, FetchDescendantsOption fetchDescendantsOption); @@ -85,7 +85,7 @@ public interface NetworkCmProxyDataService { /** * Get resource data for given batch of cm handles using dmi. * - * @param dataStoreName data store name + * @param datastoreName datastore name * @param cmHandleIds cm handle identifiers * @param resourceIdentifier resource identifier * @param optionsParamInQuery options query @@ -93,7 +93,7 @@ public interface NetworkCmProxyDataService { * @param requestId unique requestId for async request * @return {@code Object} resource data */ - Object getResourceDataForCmHandleBatch(String dataStoreName, + Object getResourceDataForCmHandleBatch(String datastoreName, List<String> cmHandleIds, String resourceIdentifier, String optionsParamInQuery, @@ -102,13 +102,13 @@ public interface NetworkCmProxyDataService { /** - * Write resource data for data store pass-through running - * using dmi for given cm-handle. - * @param cmHandleId cm handle identifier + * Write resource data for data store pass-through running using dmi for given cm-handle. + * + * @param cmHandleId cm handle identifier * @param resourceIdentifier resource identifier - * @param operation required operation - * @param requestBody request body to create resource - * @param contentType content type in body + * @param operation required operation + * @param requestBody request body to create resource + * @param contentType content type in body * @return {@code Object} return data */ Object writeResourceDataPassThroughRunningForCmHandle(String cmHandleId, diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java index 1b1997f23..e478b0053 100755 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java @@ -114,13 +114,13 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService } @Override - public Object getResourceDataForCmHandle(final String dataStoreName, + public Object getResourceDataForCmHandle(final String datastoreName, final String cmHandleId, final String resourceIdentifier, final String optionsParamInQuery, final String topicParamInQuery, final String requestId) { - final ResponseEntity<?> responseEntity = dmiDataOperations.getResourceDataFromDmi(dataStoreName, cmHandleId, + final ResponseEntity<?> responseEntity = dmiDataOperations.getResourceDataFromDmi(datastoreName, cmHandleId, resourceIdentifier, optionsParamInQuery, topicParamInQuery, @@ -129,22 +129,22 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService } @Override - public Object getResourceDataForCmHandle(final String dataStoreName, + public Object getResourceDataForCmHandle(final String datastoreName, final String cmHandleId, final String resourceIdentifier, final FetchDescendantsOption fetchDescendantsOption) { - return cpsDataService.getDataNodes(dataStoreName, cmHandleId, resourceIdentifier, + return cpsDataService.getDataNodes(datastoreName, cmHandleId, resourceIdentifier, fetchDescendantsOption).iterator().next(); } @Override - public Object getResourceDataForCmHandleBatch(final String dataStoreName, + public Object getResourceDataForCmHandleBatch(final String datastoreName, final List<String> cmHandleIds, final String resourceIdentifier, final String optionsParamInQuery, final String topicParamInQuery, final String requestId) { - final ResponseEntity<?> responseEntity = dmiDataOperations.getResourceDataFromDmi(dataStoreName, cmHandleIds, + final ResponseEntity<?> responseEntity = dmiDataOperations.getResourceDataFromDmi(datastoreName, cmHandleIds, resourceIdentifier, optionsParamInQuery, topicParamInQuery, |