summaryrefslogtreecommitdiffstats
path: root/mso-catalog-db
diff options
context:
space:
mode:
authorMarcus Williams <marcus.williams@intel.com>2019-04-15 22:24:44 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-15 22:24:44 +0000
commit05d3535dd55d07bc30b2562e075f7da102e3d63b (patch)
treedf7278dfb5ac44dce17de114f91e5f75af91efbf /mso-catalog-db
parent57d0aa50ca07497fee884fd6e505695e24f046ac (diff)
parentc5d5e14f506a9be6e93003b88f0aed42e5030ebf (diff)
Merge "Conditional Macro Action Selection"
Diffstat (limited to 'mso-catalog-db')
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java12
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepository.java13
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);
+
}