diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-03-13 16:10:16 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-03-13 16:10:34 -0400 |
commit | b40239e4b926793ab17caac4660eb5ab8f43ee62 (patch) | |
tree | e138de10bb338f20486967a7a37c9b4f79da3e64 /asdc-controller/src/main | |
parent | 7321d01bda3524066d5a76276a4511554b7a4062 (diff) |
Remove skipping of the Fabric config code
Merged the FabricConfig and TestCvnfc tests together.
Remove skipping of the Fabric config code if the Cvnfc already exist.
Instead use the existing cvnfc/vfc object.
Change-Id: Ica648b98a803a54636e0e451590ec94b51f17949
Issue-ID: SO-1653
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'asdc-controller/src/main')
2 files changed, 52 insertions, 29 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/NotificationDataImpl.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/NotificationDataImpl.java index a1c660f75f..cbe16d864a 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/NotificationDataImpl.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/NotificationDataImpl.java @@ -30,19 +30,31 @@ import org.onap.sdc.api.notification.INotificationData; import org.onap.sdc.api.notification.IResourceInstance; import org.springframework.stereotype.Component; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; @Component +@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) public class NotificationDataImpl implements INotificationData { + @JsonProperty("distributionID") private String distributionID; + @JsonProperty("serviceName") private String serviceName; + @JsonProperty("serviceVersion") private String serviceVersion; + @JsonProperty("serviceUUID") private String serviceUUID; + @JsonProperty("serviceDescription") private String serviceDescription; + @JsonProperty("serviceInvariantUUID") private String serviceInvariantUUID; + @JsonProperty("resources") private List<ResourceInfoImpl> resources; + @JsonProperty("serviceArtifacts") private List<ArtifactInfoImpl> serviceArtifacts; + @JsonProperty("workloadContext") private String workloadContext; @Override @@ -118,7 +130,6 @@ public class NotificationDataImpl implements INotificationData { return ret; } - @JsonIgnore public List<ResourceInfoImpl> getResourcesImpl(){ return resources; } 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 892a96eb4e..6d9e2fbb0c 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 @@ -1483,7 +1483,6 @@ public class ToscaResourceInstaller { vfModuleMemberName = node.getName(); } - // Extract CVFC lists List<NodeTemplate> cvfcList = toscaResourceStructure.getSdcCsarHelper().getNodeTemplateBySdcType(vfTemplate, SdcTypes.CVFC); @@ -1491,7 +1490,7 @@ public class ToscaResourceInstaller { CvnfcCustomization existingCvnfcCustomization = findExistingCvfc(existingCvnfcSet, cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)); - if(existingCvnfcCustomization == null && (vfModuleMemberName != null && vfModuleMemberName.equalsIgnoreCase(cvfcTemplate.getName()))){ + if(vfModuleMemberName != null && vfModuleMemberName.equalsIgnoreCase(cvfcTemplate.getName())){ //Extract associated VFC - Should always be just one List<NodeTemplate> vfcList = toscaResourceStructure.getSdcCsarHelper().getNodeTemplateBySdcType(cvfcTemplate, SdcTypes.VFC); @@ -1502,6 +1501,12 @@ public class ToscaResourceInstaller { VnfcCustomization existingVnfcCustomization = null; existingVnfcCustomization = findExistingVfc(existingVnfcSet, vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)); + + if(existingVnfcCustomization == null){ + vnfcCustomization = new VnfcCustomization(); + } else { + vnfcCustomization = existingVnfcCustomization; + } // Only Add Abstract VNFC's to our DB, ignore all others if(existingVnfcCustomization == null && vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY).equalsIgnoreCase("Abstract")){ @@ -1524,32 +1529,40 @@ public class ToscaResourceInstaller { // This check is needed incase the VFC subcategory is something other than Abstract. In that case we want to skip adding that record to our DB. if(vnfcCustomization.getModelCustomizationUUID() != null){ - CvnfcCustomization cvnfcCustomization = new CvnfcCustomization(); - cvnfcCustomization.setModelCustomizationUUID(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)); - cvnfcCustomization.setModelInstanceName(cvfcTemplate.getName()); - cvnfcCustomization.setModelInvariantUUID(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); - cvnfcCustomization.setModelName(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)); - cvnfcCustomization.setModelUUID(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)); - - cvnfcCustomization.setModelVersion( - testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION))); - cvnfcCustomization.setDescription( - testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION))); - cvnfcCustomization.setToscaNodeType(testNull(cvfcTemplate.getType())); + CvnfcCustomization cvnfcCustomization = null; - if(existingVnfcCustomization != null){ - cvnfcCustomization.setVnfcCustomization(existingVnfcCustomization); - }else{ - cvnfcCustomization.setVnfcCustomization(vnfcCustomization); + if(existingCvnfcCustomization != null){ + cvnfcCustomization = existingCvnfcCustomization; } + else{ - cvnfcCustomization.setNfcFunction(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(cvfcTemplate, "nfc_function")); - cvnfcCustomization.setNfcNamingCode(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(cvfcTemplate, "nfc_naming_code")); - cvnfcCustomization.setVfModuleCustomization(vfModuleCustomization); - cvnfcCustomization.setVnfResourceCustomization(vnfResource); - - cvnfcCustomizations.add(cvnfcCustomization); - existingCvnfcSet.add(cvnfcCustomization); + cvnfcCustomization = new CvnfcCustomization(); + cvnfcCustomization.setModelCustomizationUUID(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)); + cvnfcCustomization.setModelInstanceName(cvfcTemplate.getName()); + cvnfcCustomization.setModelInvariantUUID(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); + cvnfcCustomization.setModelName(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)); + cvnfcCustomization.setModelUUID(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)); + + cvnfcCustomization.setModelVersion( + testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION))); + cvnfcCustomization.setDescription( + testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION))); + cvnfcCustomization.setToscaNodeType(testNull(cvfcTemplate.getType())); + + if(existingVnfcCustomization != null){ + cvnfcCustomization.setVnfcCustomization(existingVnfcCustomization); + }else{ + cvnfcCustomization.setVnfcCustomization(vnfcCustomization); + } + + cvnfcCustomization.setNfcFunction(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(cvfcTemplate, "nfc_function")); + cvnfcCustomization.setNfcNamingCode(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(cvfcTemplate, "nfc_naming_code")); + cvnfcCustomization.setVfModuleCustomization(vfModuleCustomization); + cvnfcCustomization.setVnfResourceCustomization(vnfResource); + + cvnfcCustomizations.add(cvnfcCustomization); + existingCvnfcSet.add(cvnfcCustomization); + } //***************************************************************************************************************************************** //* Extract Fabric Configuration @@ -1595,8 +1608,7 @@ public class ToscaResourceInstaller { VnfResourceCustomization vnfResource, VfModuleCustomization vfModuleCustomization, CvnfcCustomization cvnfcCustomization, ConfigurationResource configResource, NodeTemplate vfTemplate, String vfModuleMemberName) { - Metadata fabricMetadata = fabricTemplate.getMetaData(); - + Metadata fabricMetadata = fabricTemplate.getMetaData(); VnfVfmoduleCvnfcConfigurationCustomization vfModuleToCvnfc = new VnfVfmoduleCvnfcConfigurationCustomization(); |