summaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/main/java
diff options
context:
space:
mode:
authorpwielebs <piotr.wielebski@nokia.com>2021-02-25 07:52:17 +0100
committerpwielebs <piotr.wielebski@nokia.com>2021-02-26 12:18:57 +0100
commit8a7d4d34355a5ac93415e2511e83fa3fca7cd584 (patch)
treeae17056969e8b56801119a463baf5ab22283aeb2 /asdc-controller/src/main/java
parent16b4369694a865a1c4bfaa6b562562ecbd102ed3 (diff)
Store the type of VF module orchestration template (HEAT or HELM) during distribution
Issue-ID: SO-3484 Signed-off-by: pwielebs <piotr.wielebski@nokia.com> Change-Id: I3152d2d75584d50493a8ea2229090cdfc6a1fcec
Diffstat (limited to 'asdc-controller/src/main/java')
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java126
1 files changed, 101 insertions, 25 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
index d57b305902..a07c0a49f6 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
@@ -75,8 +75,68 @@ import org.onap.so.asdc.installer.VfModuleStructure;
import org.onap.so.asdc.installer.VfResourceStructure;
import org.onap.so.asdc.installer.bpmn.WorkflowResource;
import org.onap.so.asdc.util.YamlEditor;
-import org.onap.so.db.catalog.beans.*;
-import org.onap.so.db.catalog.data.repository.*;
+import org.onap.so.db.catalog.beans.AllottedResource;
+import org.onap.so.db.catalog.beans.AllottedResourceCustomization;
+import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization;
+import org.onap.so.db.catalog.beans.CollectionResource;
+import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization;
+import org.onap.so.db.catalog.beans.ConfigurationResource;
+import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization;
+import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization;
+import org.onap.so.db.catalog.beans.CvnfcCustomization;
+import org.onap.so.db.catalog.beans.HeatEnvironment;
+import org.onap.so.db.catalog.beans.HeatFiles;
+import org.onap.so.db.catalog.beans.HeatTemplate;
+import org.onap.so.db.catalog.beans.HeatTemplateParam;
+import org.onap.so.db.catalog.beans.InstanceGroup;
+import org.onap.so.db.catalog.beans.InstanceGroupType;
+import org.onap.so.db.catalog.beans.NetworkCollectionResourceCustomization;
+import org.onap.so.db.catalog.beans.NetworkInstanceGroup;
+import org.onap.so.db.catalog.beans.NetworkResource;
+import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
+import org.onap.so.db.catalog.beans.OrchTemplateArtifactType;
+import org.onap.so.db.catalog.beans.OrchTemplateArtifactType;
+import org.onap.so.db.catalog.beans.PnfResource;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
+import org.onap.so.db.catalog.beans.Service;
+import org.onap.so.db.catalog.beans.ServiceArtifact;
+import org.onap.so.db.catalog.beans.ServiceInfo;
+import org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization;
+import org.onap.so.db.catalog.beans.SubType;
+import org.onap.so.db.catalog.beans.TempNetworkHeatTemplateLookup;
+import org.onap.so.db.catalog.beans.ToscaCsar;
+import org.onap.so.db.catalog.beans.VFCInstanceGroup;
+import org.onap.so.db.catalog.beans.VfModule;
+import org.onap.so.db.catalog.beans.VfModuleCustomization;
+import org.onap.so.db.catalog.beans.VnfResource;
+import org.onap.so.db.catalog.beans.VnfResourceCustomization;
+import org.onap.so.db.catalog.beans.VnfcCustomization;
+import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
+import org.onap.so.db.catalog.data.repository.AllottedResourceCustomizationRepository;
+import org.onap.so.db.catalog.data.repository.AllottedResourceRepository;
+import org.onap.so.db.catalog.data.repository.CollectionResourceCustomizationRepository;
+import org.onap.so.db.catalog.data.repository.CollectionResourceRepository;
+import org.onap.so.db.catalog.data.repository.ConfigurationResourceCustomizationRepository;
+import org.onap.so.db.catalog.data.repository.ConfigurationResourceRepository;
+import org.onap.so.db.catalog.data.repository.CvnfcCustomizationRepository;
+import org.onap.so.db.catalog.data.repository.ExternalServiceToInternalServiceRepository;
+import org.onap.so.db.catalog.data.repository.HeatEnvironmentRepository;
+import org.onap.so.db.catalog.data.repository.HeatFilesRepository;
+import org.onap.so.db.catalog.data.repository.HeatTemplateRepository;
+import org.onap.so.db.catalog.data.repository.InstanceGroupRepository;
+import org.onap.so.db.catalog.data.repository.NetworkResourceCustomizationRepository;
+import org.onap.so.db.catalog.data.repository.NetworkResourceRepository;
+import org.onap.so.db.catalog.data.repository.PnfCustomizationRepository;
+import org.onap.so.db.catalog.data.repository.PnfResourceRepository;
+import org.onap.so.db.catalog.data.repository.ServiceProxyResourceCustomizationRepository;
+import org.onap.so.db.catalog.data.repository.ServiceRepository;
+import org.onap.so.db.catalog.data.repository.TempNetworkHeatTemplateRepository;
+import org.onap.so.db.catalog.data.repository.ToscaCsarRepository;
+import org.onap.so.db.catalog.data.repository.VFModuleCustomizationRepository;
+import org.onap.so.db.catalog.data.repository.VFModuleRepository;
+import org.onap.so.db.catalog.data.repository.VnfResourceRepository;
+import org.onap.so.db.catalog.data.repository.VnfcCustomizationRepository;
+import org.onap.so.db.catalog.data.repository.VnfcInstanceGroupCustomizationRepository;
import org.onap.so.db.request.beans.WatchdogComponentDistributionStatus;
import org.onap.so.db.request.beans.WatchdogDistributionStatus;
import org.onap.so.db.request.beans.WatchdogServiceModVerIdLookup;
@@ -2457,30 +2517,46 @@ public class ToscaResourceInstaller {
protected void checkVfModuleArtifactType(VfModule vfModule, VfModuleCustomization vfModuleCustomization,
List<HeatFiles> heatFilesList, VfModuleArtifact vfModuleArtifact, List<HeatTemplate> nestedHeatTemplates,
HeatTemplate parentHeatTemplate, VfResourceStructure vfResourceStructure) {
- if (vfModuleArtifact.getArtifactInfo().getArtifactType().equals(ASDCConfiguration.HEAT)) {
- vfModuleArtifact.incrementDeployedInDB();
- vfModule.setModuleHeatTemplate(vfModuleArtifact.getHeatTemplate());
- } else if (vfModuleArtifact.getArtifactInfo().getArtifactType().equals(ASDCConfiguration.HEAT_VOL)) {
- vfModule.setVolumeHeatTemplate(vfModuleArtifact.getHeatTemplate());
- VfModuleArtifact volVfModuleArtifact =
- this.getHeatEnvArtifactFromGeneratedArtifact(vfResourceStructure, vfModuleArtifact);
- vfModuleCustomization.setVolumeHeatEnv(volVfModuleArtifact.getHeatEnvironment());
- vfModuleArtifact.incrementDeployedInDB();
- } else if (vfModuleArtifact.getArtifactInfo().getArtifactType().equals(ASDCConfiguration.HEAT_ENV)) {
- if (vfModuleArtifact.getHeatEnvironment() != null) {
- if (vfModuleArtifact.getHeatEnvironment().getName().contains("volume")) {
- vfModuleCustomization.setVolumeHeatEnv(vfModuleArtifact.getHeatEnvironment());
- } else {
- vfModuleCustomization.setHeatEnvironment(vfModuleArtifact.getHeatEnvironment());
+
+ switch (vfModuleArtifact.getArtifactInfo().getArtifactType()) {
+ case ASDCConfiguration.HEAT:
+ vfModuleArtifact.incrementDeployedInDB();
+ vfModule.setModuleHeatTemplate(vfModuleArtifact.getHeatTemplate());
+ vfModule.setOrchTemplateArtifactType(OrchTemplateArtifactType.HEAT);
+ break;
+ case ASDCConfiguration.HEAT_VOL:
+ vfModule.setVolumeHeatTemplate(vfModuleArtifact.getHeatTemplate());
+ VfModuleArtifact volVfModuleArtifact =
+ this.getHeatEnvArtifactFromGeneratedArtifact(vfResourceStructure, vfModuleArtifact);
+ vfModuleCustomization.setVolumeHeatEnv(volVfModuleArtifact.getHeatEnvironment());
+ vfModuleArtifact.incrementDeployedInDB();
+ vfModule.setOrchTemplateArtifactType(OrchTemplateArtifactType.HEAT);
+ break;
+ case ASDCConfiguration.HEAT_ENV:
+ if (vfModuleArtifact.getHeatEnvironment() != null) {
+ if (vfModuleArtifact.getHeatEnvironment().getName().contains("volume")) {
+ vfModuleCustomization.setVolumeHeatEnv(vfModuleArtifact.getHeatEnvironment());
+ } else {
+ vfModuleCustomization.setHeatEnvironment(vfModuleArtifact.getHeatEnvironment());
+ }
}
- }
- vfModuleArtifact.incrementDeployedInDB();
- } else if (vfModuleArtifact.getArtifactInfo().getArtifactType().equals(ASDCConfiguration.HEAT_ARTIFACT)) {
- heatFilesList.add(vfModuleArtifact.getHeatFiles());
- vfModuleArtifact.incrementDeployedInDB();
- } else if (vfModuleArtifact.getArtifactInfo().getArtifactType().equals(ASDCConfiguration.HEAT_NESTED)) {
- nestedHeatTemplates.add(vfModuleArtifact.getHeatTemplate());
- vfModuleArtifact.incrementDeployedInDB();
+ vfModuleArtifact.incrementDeployedInDB();
+ vfModule.setOrchTemplateArtifactType(OrchTemplateArtifactType.HEAT);
+ break;
+ case ASDCConfiguration.HEAT_ARTIFACT:
+ heatFilesList.add(vfModuleArtifact.getHeatFiles());
+ vfModuleArtifact.incrementDeployedInDB();
+ vfModule.setOrchTemplateArtifactType(OrchTemplateArtifactType.HEAT);
+ break;
+ case ASDCConfiguration.HEAT_NESTED:
+ nestedHeatTemplates.add(vfModuleArtifact.getHeatTemplate());
+ vfModuleArtifact.incrementDeployedInDB();
+ vfModule.setOrchTemplateArtifactType(OrchTemplateArtifactType.HEAT);
+ break;
+ case ASDCConfiguration.HELM:
+ vfModuleArtifact.incrementDeployedInDB();
+ vfModule.setOrchTemplateArtifactType(OrchTemplateArtifactType.HELM);
+ break;
}
}