diff options
author | Sourabh Sourabh <sourabh.sourabh@est.tech> | 2024-05-29 14:14:37 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2024-05-29 14:14:37 +0000 |
commit | c97bed8797bf9f16a019d8fdf25e2191b6854136 (patch) | |
tree | d6f3a2e680a31e830a3c72de471a7228b39f3e9a /cps-ncmp-service/src/main | |
parent | acff577c5abef548b1234d88b9a4f284f7fdef60 (diff) | |
parent | 45d3b6194e4feaaed14f5b57d54813d3c6c8bd62 (diff) |
Merge "CPS-2187 - Move Module Set Tag into request body for dmi data access passthrough calls"
Diffstat (limited to 'cps-ncmp-service/src/main')
2 files changed, 7 insertions, 15 deletions
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<String, String> uriQueryParamsMap = getUriQueryParamsMap( - cmResourceAddress.resourceIdentifier(), optionsParamInQuery, - topicParamInQuery, yangModelCmHandle.getModuleSetTag()); + cmResourceAddress.resourceIdentifier(), optionsParamInQuery, topicParamInQuery); final Map<String, Object> 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<String, String> uriQueryParamsMap = getUriQueryParamsMap("/", null, - null, yangModelCmHandle.getModuleSetTag()); + final MultiValueMap<String, String> uriQueryParamsMap = getUriQueryParamsMap("/", null, null); final Map<String, Object> 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<String, String> uriQueryParamsMap = getUriQueryParamsMap(resourceId, null, - null, yangModelCmHandle.getModuleSetTag()); + final MultiValueMap<String, String> uriQueryParamsMap = getUriQueryParamsMap(resourceId, null, null); final Map<String, Object> 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<String, String> 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<String, Object> 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<String, String> populateQueryParams(final String resourceId, final String optionsParamInQuery, - final String topicParamInQuery, - final String moduleSetTag) { + final String topicParamInQuery) { final MultiValueMap<String, String> 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; } |