summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/main
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-06-07 17:38:55 +0000
committerGerrit Code Review <gerrit@onap.org>2019-06-07 17:38:55 +0000
commit945d4522d6433c2a458975dcad867ee8c27ca2d9 (patch)
treeae8056acfb73ec980d67603acad5112d946a8a8a /mso-api-handlers/mso-api-handler-infra/src/main
parent1196db4be81e49b8282908e76c6f0f72a29ccb9f (diff)
parent65ca9cb2cc392dcd9793f7758d9d1fd0dd592fb7 (diff)
Merge "resume request support"
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java
index 4e910e5382..f88d244a88 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java
@@ -52,6 +52,7 @@ import org.onap.so.apihandler.common.RequestClientFactory;
import org.onap.so.apihandler.common.RequestClientParameter;
import org.onap.so.apihandler.common.ResponseBuilder;
import org.onap.so.apihandler.common.ResponseHandler;
+import org.onap.so.apihandlerinfra.TestApi;
import org.onap.so.apihandlerinfra.exceptions.ApiException;
import org.onap.so.apihandlerinfra.exceptions.BPMNFailureException;
import org.onap.so.apihandlerinfra.exceptions.ClientConnectionException;
@@ -638,7 +639,7 @@ public class RequestHandlerUtils {
request.setLastModifiedBy(Constants.MODIFIED_BY_APIHANDLER);
if (infraActiveRequest != null) {
request.setTenantId(infraActiveRequest.getTenantId());
- request.setRequestBody(infraActiveRequest.getRequestBody());
+ request.setRequestBody(updateRequestorIdInRequestBody(infraActiveRequest, requestorId));
request.setAicCloudRegion(infraActiveRequest.getAicCloudRegion());
request.setRequestScope(infraActiveRequest.getRequestScope());
request.setRequestAction(infraActiveRequest.getRequestAction());
@@ -707,4 +708,10 @@ public class RequestHandlerUtils {
}
}
+ protected String updateRequestorIdInRequestBody(InfraActiveRequests infraActiveRequest, String newRequestorId) {
+ String requestBody = infraActiveRequest.getRequestBody();
+ return requestBody.replaceAll(
+ "(?s)(\"requestInfo\"\\s*?:\\s*?\\{.*?\"requestorId\"\\s*?:\\s*?\")(.*?)(\"[ ]*(?:,|\\R|\\}))",
+ "$1" + newRequestorId + "$3");
+ }
}