diff options
author | Smokowski, Steven <steve.smokowski@att.com> | 2019-05-15 14:19:49 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-05-15 14:19:58 -0400 |
commit | e4687eeb77d9fddf14935894026aec0b1c9e3ac9 (patch) | |
tree | 47c85cd95c71d36a404da6c83fbbb5d11fb0fb2c /mso-api-handlers | |
parent | f9c309fb9e789225ccd6b02ec9ab4777bbd4021c (diff) |
store openstack request status in requestdb
Openstack request status now stored in request db
Change-Id: Ida8f4f613d406c2b834ab190e01d5aaf2f16dd3d
Issue-ID: SO-1867
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-api-handlers')
2 files changed, 17 insertions, 1 deletions
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java index b1abda3b6f..1abc21dfc8 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java +++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java @@ -31,5 +31,8 @@ public interface RequestProcessingDataRepository extends JpaRepository<RequestPr RequestProcessingData findOneBySoRequestIdAndGroupingIdAndNameAndTag(@Param("SO_REQUEST_ID") String soRequestId, @Param("GROUPING_ID") String groupingId, @Param("NAME") String name, @Param("TAG") String tag); + RequestProcessingData findOneBySoRequestIdAndGroupingIdAndName(@Param("SO_REQUEST_ID") String soRequestId, + @Param("GROUPING_ID") String groupingId, @Param("NAME") String name); + List<RequestProcessingData> findBySoRequestIdOrderByGroupingIdDesc(@Param("SO_REQUEST_ID") String soRequestId); } 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 103410701c..ca2f52690c 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 @@ -67,6 +67,8 @@ public class RequestsDbClient { private static final String SERVICE_ID = "SERVICE_ID"; private static final String OPERATION_ID = "OPERATION_ID"; private static final String SO_REQUEST_ID = "SO_REQUEST_ID"; + private static final String NAME = "NAME"; + private static final String GROUPING_ID = "GROUPING_ID"; private static final String REQUEST_ID = "REQUEST_ID"; private static final String OPERATIONAL_ENVIRONMENT_ID = "OPERATIONAL_ENV_ID"; private static final String SERVICE_MODEL_VERSION_ID = "SERVICE_MODEL_VERSION_ID"; @@ -104,7 +106,10 @@ public class RequestsDbClient { private String requestProcessingDataURI = "/requestProcessingData"; - private final String findBySoRequestIdOrderByGroupingIdDesc = + private static final String findBySoRequestIdAndGroupIdAndName = + "/requestProcessingData/search/findOneBySoRequestIdAndGroupingIdAndName"; + + private static final String findBySoRequestIdOrderByGroupingIdDesc = "/requestProcessingData/search/findBySoRequestIdOrderByGroupingIdDesc"; @@ -339,6 +344,14 @@ public class RequestsDbClient { .queryParam(SO_REQUEST_ID, soRequestId).build().toString())); } + public RequestProcessingData getRequestProcessingDataBySoRequestIdAndNameAndGrouping(String soRequestId, + String name, String groupingId) { + return getClientFactory().create(RequestProcessingData.class) + .get(getUri(UriBuilder.fromUri(endpoint + findBySoRequestIdAndGroupIdAndName) + .queryParam(SO_REQUEST_ID, soRequestId).queryParam(NAME, name) + .queryParam(GROUPING_ID, groupingId).build().toString())); + } + private List<RequestProcessingData> getRequestProcessingData(URI uri) { Iterable<RequestProcessingData> requestProcessingDataIterator = getClientFactory().create(RequestProcessingData.class).getAll(uri); |