diff options
author | Steve Smokowski <ss835w@att.com> | 2019-04-04 17:31:43 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-04 17:31:43 +0000 |
commit | f81920304c7b62637d32473e672a1e51275ce54b (patch) | |
tree | 35332de491929d0b278a4698f530f512ce28d46c /mso-catalog-db/src/main/java | |
parent | 5f78643c42dd12588a1688f658ca6e134674ea29 (diff) | |
parent | 88c47a23b9428188ff5dd0b46941f8856465376b (diff) |
Merge "PNF WF post instantiation configuration"
Diffstat (limited to 'mso-catalog-db/src/main/java')
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 28b77cde79..df1c947bde 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 @@ -175,7 +175,7 @@ public class CatalogDbClient { private String findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = "/findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep"; private String findByClliAndCloudVersion = "/findByClliAndCloudVersion"; private String findServiceByServiceInstanceId = "/findServiceByServiceInstanceId"; - + private String findPnfResourceCustomizationByModelUuid = "/findPnfResourceCustomizationByModelUuid"; private String serviceURI; private String vfModuleURI; @@ -288,6 +288,9 @@ public class CatalogDbClient { findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = endpoint + RAINY_DAY_HANDLER_MACRO + SEARCH + findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep; findByClliAndCloudVersion = endpoint + CLOUD_SITE + SEARCH + findByClliAndCloudVersion; + findPnfResourceCustomizationByModelUuid = + endpoint + PNF_RESOURCE_CUSTOMIZATION + SEARCH + findPnfResourceCustomizationByModelUuid; + serviceURI = endpoint + SERVICE + URI_SEPARATOR; vfModuleURI = endpoint + VFMODULE + URI_SEPARATOR; vnfResourceURI = endpoint + VNF_RESOURCE + URI_SEPARATOR; @@ -458,6 +461,12 @@ public class CatalogDbClient { return pnfResourceCustomization; } + public List<PnfResourceCustomization> getPnfResourceCustomizationByModelUuid(String modelUuid) { + return this.getMultipleResources(pnfResourceCustomizationClient, getUri( + UriBuilder.fromUri(findPnfResourceCustomizationByModelUuid).queryParam("SERVICE_MODEL_UUID", modelUuid) + .build().toString())); + } + public CollectionNetworkResourceCustomization getCollectionNetworkResourceCustomizationByID(String modelCustomizationUUID) { CollectionNetworkResourceCustomization collectionNetworkResourceCustomization = this.getSingleResource(collectionNetworkResourceCustomizationClient,getUri(UriBuilder diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepository.java index 7527a79842..f64311a561 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepository.java @@ -19,11 +19,25 @@ package org.onap.so.db.catalog.data.repository; +import java.util.List; import org.onap.so.db.catalog.beans.PnfResourceCustomization; 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; @RepositoryRestResource(collectionResourceRel = "pnfResourceCustomization", path = "pnfResourceCustomization") public interface PnfCustomizationRepository extends JpaRepository<PnfResourceCustomization, String> { + /** + * Used to fetch the @{link PnfResourceCustomization} by the Model UUID. + * + * This operation is required by {@link org.onap.so.db.catalog.client.CatalogDbClient} to provide PnfResourceCustomization based on model UUID without projection. + * + * @param serviceModelUuid model UUID + * @return List of PnfResourceCustomization + */ + @Query(value = "select b.* from pnf_resource_customization_to_service a join pnf_resource_customization b where a.RESOURCE_MODEL_CUSTOMIZATION_UUID = b.MODEL_CUSTOMIZATION_UUID and a.SERVICE_MODEL_UUID = ?1", nativeQuery = true) + List<PnfResourceCustomization> findPnfResourceCustomizationByModelUuid( + @Param("SERVICE_MODEL_UUID") String serviceModelUuid); }
\ No newline at end of file |