From 88953d4f6c0ae360e6fb5d6967fc71dcc3652b4a Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Wed, 13 Mar 2019 15:43:33 -0400 Subject: Added param requestId to query 1 row Added param requestId to uniquely query 1 row from model distribution status db. Change-Id: Ice8db174166e6a00d211f191dcf5537eef729127 Issue-ID: SO-1651 Signed-off-by: Benjamin, Max (mb388a) --- .../java/org/onap/so/db/request/client/RequestsDbClient.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'mso-api-handlers/mso-requests-db/src/main/java') diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java index b809691b31..5958397851 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java @@ -96,7 +96,7 @@ public class RequestsDbClient { private String findOneByServiceIdAndOperationIdURI = "/findOneByServiceIdAndOperationId"; - private String findOneByOperationalEnvIdAndServiceModelVersionIdURI = "/findOneByOperationalEnvIdAndServiceModelVersionId"; + private String findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestIdURI = "/findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId"; private String findAllByOperationalEnvIdAndRequestIdURI = "/findAllByOperationalEnvIdAndRequestId"; @@ -123,7 +123,7 @@ public class RequestsDbClient { findOneByServiceIdAndOperationIdURI = endpoint + OPERATION_STATUS_SEARCH + findOneByServiceIdAndOperationIdURI; requestProcessingDataURI = endpoint + requestProcessingDataURI; operationalEnvDistributionStatusURI = endpoint + operationalEnvDistributionStatusURI; - findOneByOperationalEnvIdAndServiceModelVersionIdURI = endpoint + OPERATIONAL_ENV_SERVICE_MODEL_STATUS_SEARCH + findOneByOperationalEnvIdAndServiceModelVersionIdURI; + findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestIdURI = endpoint + OPERATIONAL_ENV_SERVICE_MODEL_STATUS_SEARCH + findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestIdURI; findAllByOperationalEnvIdAndRequestIdURI = endpoint + OPERATIONAL_ENV_SERVICE_MODEL_STATUS_SEARCH + findAllByOperationalEnvIdAndRequestIdURI; } @@ -227,16 +227,18 @@ public class RequestsDbClient { } } - public OperationalEnvServiceModelStatus findOneByOperationalEnvIdAndServiceModelVersionId(String operationalEnvironmentId, String serviceModelVersionId) { + public OperationalEnvServiceModelStatus findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId(String operationalEnvironmentId, String serviceModelVersionId, String requestId) { try { HttpEntity entity = getHttpEntity(); - OperationalEnvServiceModelStatus modelStatus = restTemplate.exchange(getUri(UriBuilder.fromUri(findOneByOperationalEnvIdAndServiceModelVersionIdURI) + OperationalEnvServiceModelStatus modelStatus = restTemplate.exchange(getUri(UriBuilder.fromUri(findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestIdURI) .queryParam(OPERATIONAL_ENVIRONMENT_ID, operationalEnvironmentId) .queryParam(SERVICE_MODEL_VERSION_ID, serviceModelVersionId) + .queryParam(REQUEST_ID, requestId) .build().toString()), HttpMethod.GET, entity, OperationalEnvServiceModelStatus.class).getBody(); if (null != modelStatus) { modelStatus.setOperationalEnvId(operationalEnvironmentId); modelStatus.setServiceModelVersionId(serviceModelVersionId); + modelStatus.setRequestId(requestId); } return modelStatus; }catch(HttpClientErrorException e){ -- cgit 1.2.3-korg