diff options
Diffstat (limited to 'mso-catalog-db/src')
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); + } |