From eee110cb38b47745cadc65ca7cbb5c64a1965418 Mon Sep 17 00:00:00 2001 From: Elena Kuleshov Date: Sun, 5 May 2019 07:51:49 -0400 Subject: Fix deployment of workflows on start Fix deployment of workflows on start Change-Id: Iaa5cb96020da20c96bedb81e0829f73c7461b67f Issue-ID: SO-1837 Signed-off-by: Kuleshov, Elena --- .../main/java/org/onap/so/db/catalog/client/CatalogDbClient.java | 8 ++++++++ .../onap/so/db/catalog/data/repository/WorkflowRepository.java | 2 ++ 2 files changed, 10 insertions(+) (limited to 'mso-catalog-db/src/main/java/org/onap') diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java index 19200468ae..ab5fdb939c 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java @@ -145,6 +145,7 @@ public class CatalogDbClient { private static final String CLOUD_VERSION = "cloudVersion"; private static final String HOMING_INSTANCE = "/homingInstance"; private static final String ARTIFACT_UUID = "artifactUUID"; + private static final String SOURCE = "source"; private static final String TARGET_ENTITY = "SO:CatalogDB"; private static final String ASTERISK = "*"; @@ -191,6 +192,7 @@ public class CatalogDbClient { private String findPnfResourceCustomizationByModelUuid = "/findPnfResourceCustomizationByModelUuid"; private String findWorkflowByArtifactUUID = "/findByArtifactUUID"; private String findWorkflowByModelUUID = "/findWorkflowByModelUUID"; + private String findWorkflowBySource = "/findBySource"; private String findVnfResourceCustomizationByModelUuid = "/findVnfResourceCustomizationByModelUuid"; private String serviceURI; @@ -333,6 +335,7 @@ public class CatalogDbClient { findWorkflowByArtifactUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByArtifactUUID; findWorkflowByModelUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByModelUUID; + findWorkflowBySource = endpoint + WORKFLOW + SEARCH + findWorkflowBySource; findVnfResourceCustomizationByModelUuid = endpoint + VNF_RESOURCE_CUSTOMIZATION + SEARCH + findVnfResourceCustomizationByModelUuid; @@ -889,4 +892,9 @@ public class CatalogDbClient { return this.getMultipleResources(workflowClient, getUri(UriBuilder.fromUri(findWorkflowByModelUUID) .queryParam(VNF_RESOURCE_MODEL_UUID, vnfResourceModelUUID).build().toString())); } + + public List findWorkflowBySource(String source) { + return this.getMultipleResources(workflowClient, + getUri(UriBuilder.fromUri(findWorkflowBySource).queryParam(SOURCE, source).build().toString())); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java index 89df52182c..8bcc60c8be 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java @@ -31,6 +31,8 @@ public interface WorkflowRepository extends JpaRepository { Workflow findByArtifactUUID(String artifactUUID); + List findBySource(String source); + /** * Used to fetch the @{link Workflow} by the Model UUID. * -- cgit 1.2.3-korg