diff options
author | SunilB <sb00577584@techmahindra.com> | 2019-04-15 19:52:11 +0530 |
---|---|---|
committer | SunilB <sb00577584@techmahindra.com> | 2019-04-15 19:52:11 +0530 |
commit | c5d5e14f506a9be6e93003b88f0aed42e5030ebf (patch) | |
tree | 60d31ce74dd80deb4df0e82b4fb81a1eadfb1796 /mso-catalog-db/src/main/java/org | |
parent | 9c0663079469cb5a42c96ff990385c23be2f361e (diff) |
Conditional Macro Action Selection
Update orchestration_flow_reference table and changes in
WorkflowActionBBTasks to Conditionally trigger ConfigAssignVnfBB And
ConfigDeployVnfBB building block.
Change-Id: I1bdb8a77223aef6855e4e1c9aa80dd026892e6f6
Issue-ID: SO-1702
Signed-off-by: sunilb <sb00577584@techmahindra.com>
Diffstat (limited to 'mso-catalog-db/src/main/java/org')
2 files changed, 24 insertions, 1 deletions
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 a2ca4a3814..19200468ae 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 @@ -191,6 +191,7 @@ public class CatalogDbClient { private String findPnfResourceCustomizationByModelUuid = "/findPnfResourceCustomizationByModelUuid"; private String findWorkflowByArtifactUUID = "/findByArtifactUUID"; private String findWorkflowByModelUUID = "/findWorkflowByModelUUID"; + private String findVnfResourceCustomizationByModelUuid = "/findVnfResourceCustomizationByModelUuid"; private String serviceURI; private String vfModuleURI; @@ -333,6 +334,9 @@ public class CatalogDbClient { findWorkflowByArtifactUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByArtifactUUID; findWorkflowByModelUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByModelUUID; + findVnfResourceCustomizationByModelUuid = + endpoint + VNF_RESOURCE_CUSTOMIZATION + SEARCH + findVnfResourceCustomizationByModelUuid; + serviceURI = endpoint + SERVICE + URI_SEPARATOR; vfModuleURI = endpoint + VFMODULE + URI_SEPARATOR; vnfResourceURI = endpoint + VNF_RESOURCE + URI_SEPARATOR; @@ -503,6 +507,12 @@ public class CatalogDbClient { } } + public List<VnfResourceCustomization> getVnfResourceCustomizationByModelUuid(String modelUuid) { + return this.getMultipleResources(vnfResourceCustomizationClient, + getUri(UriBuilder.fromUri(findVnfResourceCustomizationByModelUuid) + .queryParam("SERVICE_MODEL_UUID", modelUuid).build().toString())); + } + public PnfResource getPnfResourceByModelUUID(String modelUUID) { PnfResource PnfResource = this.getSingleResource(pnfResourceClient, getUri(pnfResourceURI + modelUUID)); if (PnfResource != null) { @@ -816,7 +826,7 @@ public class CatalogDbClient { return vfModuleCust.getCvnfcCustomization().stream().collect(Collectors.toList()); } - private VnfResourceCustomization findVnfResourceCustomizationInList(String vnfCustomizationUUID, + public VnfResourceCustomization findVnfResourceCustomizationInList(String vnfCustomizationUUID, List<VnfResourceCustomization> vnfResourceCusts) { List<VnfResourceCustomization> filtered = vnfResourceCusts.stream() .filter(vnfCustRes -> vnfCustomizationUUID.equals(vnfCustRes.getModelCustomizationUUID())) diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepository.java index c72fade411..c38ffcbbf3 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepository.java @@ -40,4 +40,17 @@ public interface VnfCustomizationRepository extends JpaRepository<VnfResourceCus @Param("MODEL_INSTANCE_NAME") String modelInstanceName, @Param("VNF_RESOURCE_MODEL_UUID") String vnfResourceModelUUID); + /** + * Used to fetch the @{link VnfResourceCustomization} by the Model UUID. + * + * This operation is required by {@link org.onap.so.db.catalog.client.CatalogDbClient} to provide + * VnfResourceCustomization based on model UUID without projection. + * + * @param serviceModelUuid model UUID + * @return List of VnfResourceCustomization + */ + @Query(value = "select * from vnf_resource_customization where SERVICE_MODEL_UUID = ?1", nativeQuery = true) + List<VnfResourceCustomization> findVnfResourceCustomizationByModelUuid( + @Param("SERVICE_MODEL_UUID") String serviceModelUuid); + } |