From 45d3b6194e4feaaed14f5b57d54813d3c6c8bd62 Mon Sep 17 00:00:00 2001 From: "david.mcweeney" Date: Tue, 28 May 2024 12:48:38 +0100 Subject: CPS-2187 - Move Module Set Tag into request body for dmi data access passthrough calls Change-Id: I9c807d2ef5b3712bf3f8ee5db7663d9628eef3bb Signed-off-by: david.mcweeney Issue-ID: CPS-2187 --- .../cps/ncmp/api/impl/operations/DmiDataOperations.java | 15 ++++++--------- .../cps/ncmp/api/impl/utils/DmiServiceUrlBuilder.java | 7 +------ 2 files changed, 7 insertions(+), 15 deletions(-) (limited to 'cps-ncmp-service/src/main') diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperations.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperations.java index 1e92bfe425..49894dedbd 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperations.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperations.java @@ -90,8 +90,7 @@ public class DmiDataOperations extends DmiOperations { final String jsonRequestBody = getDmiRequestBody(READ, requestId, null, null, yangModelCmHandle); final MultiValueMap uriQueryParamsMap = getUriQueryParamsMap( - cmResourceAddress.resourceIdentifier(), optionsParamInQuery, - topicParamInQuery, yangModelCmHandle.getModuleSetTag()); + cmResourceAddress.resourceIdentifier(), optionsParamInQuery, topicParamInQuery); final Map uriVariableParamsMap = getUriVariableParamsMap(cmResourceAddress.datastoreName(), yangModelCmHandle.resolveDmiServiceName(RequiredDmiService.DATA), cmResourceAddress.cmHandleId()); final String dmiResourceDataUrl = getDmiRequestUrl(uriQueryParamsMap, uriVariableParamsMap); @@ -115,8 +114,7 @@ public class DmiDataOperations extends DmiOperations { final String jsonRequestBody = getDmiRequestBody(READ, requestId, null, null, yangModelCmHandle); - final MultiValueMap uriQueryParamsMap = getUriQueryParamsMap("/", null, - null, yangModelCmHandle.getModuleSetTag()); + final MultiValueMap uriQueryParamsMap = getUriQueryParamsMap("/", null, null); final Map uriVariableParamsMap = getUriVariableParamsMap(dataStoreName, yangModelCmHandle.resolveDmiServiceName(RequiredDmiService.DATA), cmHandleId); final String dmiResourceDataUrl = getDmiRequestUrl(uriQueryParamsMap, uriVariableParamsMap); @@ -176,8 +174,7 @@ public class DmiDataOperations extends DmiOperations { final String jsonRequestBody = getDmiRequestBody(operationType, null, requestData, dataType, yangModelCmHandle); - final MultiValueMap uriQueryParamsMap = getUriQueryParamsMap(resourceId, null, - null, yangModelCmHandle.getModuleSetTag()); + final MultiValueMap uriQueryParamsMap = getUriQueryParamsMap(resourceId, null, null); final Map uriVariableParamsMap = getUriVariableParamsMap(PASSTHROUGH_RUNNING.getDatastoreName(), yangModelCmHandle.resolveDmiServiceName(RequiredDmiService.DATA), cmHandleId); final String dmiUrl = getDmiRequestUrl(uriQueryParamsMap, uriVariableParamsMap); @@ -201,6 +198,7 @@ public class DmiDataOperations extends DmiOperations { .requestId(requestId) .data(requestData) .dataType(dataType) + .moduleSetTag(yangModelCmHandle.getModuleSetTag()) .build(); dmiRequestBody.asDmiProperties(yangModelCmHandle.getDmiProperties()); return jsonObjectMapper.asJsonString(dmiRequestBody); @@ -213,10 +211,9 @@ public class DmiDataOperations extends DmiOperations { private MultiValueMap getUriQueryParamsMap(final String resourceId, final String optionsParamInQuery, - final String topicParamInQuery, - final String moduleSetTagParamInQuery) { + final String topicParamInQuery) { return dmiServiceUrlBuilder.populateQueryParams(resourceId, optionsParamInQuery, - topicParamInQuery, moduleSetTagParamInQuery); + topicParamInQuery); } private Map getUriVariableParamsMap(final String dataStoreName, diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilder.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilder.java index 9234d3c2f1..15f1effdd6 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilder.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DmiServiceUrlBuilder.java @@ -136,22 +136,17 @@ public class DmiServiceUrlBuilder { * @param resourceId unique id of response for valid topic * @param optionsParamInQuery options as provided by client * @param topicParamInQuery topic as provided by client - * @param moduleSetTag module set tag associated with the given cm handle * @return all valid query params as map */ public MultiValueMap populateQueryParams(final String resourceId, final String optionsParamInQuery, - final String topicParamInQuery, - final String moduleSetTag) { + final String topicParamInQuery) { final MultiValueMap queryParams = new LinkedMultiValueMap<>(); getQueryParamConsumer().accept("resourceIdentifier", resourceId, queryParams); getQueryParamConsumer().accept("options", optionsParamInQuery, queryParams); if (Strings.isNotEmpty(topicParamInQuery)) { getQueryParamConsumer().accept("topic", topicParamInQuery, queryParams); } - if (Strings.isNotEmpty(moduleSetTag)) { - getQueryParamConsumer().accept("moduleSetTag", moduleSetTag, queryParams); - } return queryParams; } -- cgit 1.2.3-korg