summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers
diff options
context:
space:
mode:
authorKULESHOV, ELENA <evn@att.com>2021-03-24 09:46:59 -0400
committerAT&T Open Source <g22940@att.com>2021-03-24 09:46:59 -0400
commit82358726fc0c37adcd426a41cdca4f3b4ddf2c56 (patch)
tree4672b358077c90d2447f785ef97b37d1bc7a6762 /mso-api-handlers
parent7eb4f55f7cd81e25557e97e82049e6a3be137fd2 (diff)
request db endpoint and bpmn cleanup
added new request db adapter endpoint use bpmn constants when available allow bpmn input setup parameter to be extended Issue-ID: SO-3606 Signed-off-by: AT&T Open Source <g22940@att.com> Change-Id: Ibde4d82cc7432ea3cdd9a75aef0dc695ebbf9a1b
Diffstat (limited to 'mso-api-handlers')
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java4
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java12
2 files changed, 16 insertions, 0 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 21bc2a697a..9ec214fc6d 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
@@ -23,6 +23,7 @@ package org.onap.so.db.request.data.repository;
import java.util.List;
import org.onap.so.db.request.beans.RequestProcessingData;
import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
@@ -44,4 +45,7 @@ public interface RequestProcessingDataRepository extends JpaRepository<RequestPr
RequestProcessingData[] findByGroupingIdAndNameAndTag(@Param("GROUPING_ID") String groupingId,
@Param("NAME") String name, @Param("TAG") String tag);
+
+ RequestProcessingData[] findBySoRequestIdAndNameAndTagOrderByCreatedDesc(@Param("SO_REQUEST_ID") String soRequestId,
+ @Param("NAME") String name, @Param("TAG") String tag);
}
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 9b42eacfc2..806d347582 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
@@ -127,6 +127,9 @@ public class RequestsDbClient {
private static final String findByGroupingIdAndNameAndTag =
"/requestProcessingData/search/findByGroupingIdAndNameAndTag";
+ private static final String findBySoRequestIdAndNameAndTagOrderByCreateTimeDesc =
+ "/requestProcessingData/search/findBySoRequestIdAndNameAndTagOrderByCreatedDesc";
+
@Autowired
protected RestTemplate restTemplate;
@@ -403,6 +406,15 @@ public class RequestsDbClient {
RequestProcessingData.class);
}
+ public List<RequestProcessingData> getRequestProcessingDataBySoRequestIdAndNameAndTagOrderByCreateTimeDesc(
+ String soRequestId, String name, String tag) {
+
+ return getMultipleResponse(getUri(UriBuilder
+ .fromUri(endpoint + findBySoRequestIdAndNameAndTagOrderByCreateTimeDesc)
+ .queryParam(SO_REQUEST_ID, soRequestId).queryParam(NAME, name).queryParam(TAG, tag).build().toString()),
+ new ParameterizedTypeReference<List<RequestProcessingData>>() {});
+ }
+
public void persistProcessingData(String flowExecutionPath, String requestId) {