summaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'asdc-controller/src/main/java')
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java11
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java4
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java10
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java71
4 files changed, 77 insertions, 19 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
index fae3a49910..ee329ced3c 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
@@ -22,6 +22,7 @@ d * ============LICENSE_START===================================================
package org.onap.so.asdc.client;
+import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
@@ -352,9 +353,17 @@ public class ASDCController {
+ artifact.getArtifactUUID ()
+ ")");
+ String filePath = System.getProperty("mso.config.path") + "/ASDC" + "/" + artifact.getArtifactVersion() + "/" + artifact.getArtifactName();
+ // make parent directory
+ File file = new File(filePath);
+ File fileParent = file.getParentFile();
+ if (!fileParent.exists()) {
+ fileParent.mkdirs();
+ }
+
byte[] payloadBytes = resultArtifact.getArtifactPayload();
- try (FileOutputStream outFile = new FileOutputStream(System.getProperty("mso.config.path") + "/ASDC" + "/" + artifact.getArtifactName())) {
+ try (FileOutputStream outFile = new FileOutputStream(filePath)) {
LOGGER.info(MessageEnum.ASDC_RECEIVE_SERVICE_NOTIF, "***WRITE FILE ARTIFACT NAME", "ASDC", artifact.getArtifactName());
outFile.write(payloadBytes, 0, payloadBytes.length);
outFile.close();
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java
index 8353f708a9..030035157d 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java
@@ -126,7 +126,9 @@ public class ToscaResourceStructure {
LOGGER.debug("MSO config path is: " + System.getProperty("mso.config.path"));
- File spoolFile = new File(System.getProperty("mso.config.path") + "/ASDC/" + artifact.getArtifactName());
+ String filePath = System.getProperty("mso.config.path") + "/ASDC/" + artifact.getArtifactVersion() + "/" + artifact.getArtifactName();
+
+ File spoolFile = new File(filePath);
LOGGER.debug("ASDC File path is: " + spoolFile.getAbsolutePath());
LOGGER.info(MessageEnum.ASDC_RECEIVE_SERVICE_NOTIF, "***PATH", "ASDC", spoolFile.getAbsolutePath());
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 1fca9d3ff2..970cb0bf50 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
@@ -488,13 +488,11 @@ public class ToscaResourceInstaller {
.getSdcCsarHelper().getVfModulesByVf(vfCustomizationUUID);
IVfModuleData vfMetadata = vfModuleStructure.getVfModuleMetadata();
- logger.debug("Comparing VFModule Metadata CustomizationUUID : " + vfMetadata.getVfModuleModelCustomizationUUID());
- for(Group group : vfGroups){
- logger.debug("To Group VFModuleModelCustomizationUUID " + group.getMetadata().getValue("vfModuleModelCustomizationUUID"));
- }
+ logger.debug("Comparing VFModuleMetadata CustomizationUUID : " + vfMetadata.getVfModuleModelCustomizationUUID());
- Optional<org.onap.sdc.toscaparser.api.Group> matchingObject = vfGroups.stream().
- filter(group -> group.getMetadata().getValue("vfModuleModelCustomizationUUID").equals(vfMetadata.getVfModuleModelCustomizationUUID())).
+ Optional<org.onap.sdc.toscaparser.api.Group> matchingObject = vfGroups.stream()
+ .peek(group -> logger.debug("To Csar Group VFModuleModelCustomizationUUID " + group.getMetadata().getValue("vfModuleModelCustomizationUUID")))
+ .filter(group -> group.getMetadata().getValue("vfModuleModelCustomizationUUID").equals(vfMetadata.getVfModuleModelCustomizationUUID())).
findFirst();
if(matchingObject.isPresent()){
VfModuleCustomization vfModuleCustomization = createVFModuleResource(matchingObject.get(), nodeTemplate, toscaResourceStruct,
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java b/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java
index 54977104ff..ab9c359b7f 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java
@@ -201,11 +201,6 @@ public class ASDCNotificationLogging {
}
}
- buffer.append(System.lineSeparator());
- buffer.append(System.lineSeparator());
- buffer.append("VNF Level Properties:");
- buffer.append(System.lineSeparator());
-
List<NodeTemplate> vfNodeTemplatesList = toscaResourceStructure.getSdcCsarHelper().getServiceVfList();
for (NodeTemplate vfNodeTemplate : vfNodeTemplatesList) {
@@ -287,17 +282,16 @@ public class ASDCNotificationLogging {
}
-
-
- buffer.append(System.lineSeparator());
- buffer.append("VF Module Properties:");
- buffer.append(System.lineSeparator());
+
List<Group> vfGroups = toscaResourceStructure.getSdcCsarHelper().getVfModulesByVf(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
for(Group group : vfGroups){
Metadata vfMetadata = group.getMetadata();
+ buffer.append(System.lineSeparator());
+ buffer.append("VF Module Properties:");
+ buffer.append(System.lineSeparator());
buffer.append("ModelInvariantUuid:");
buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)));
buffer.append(System.lineSeparator());
@@ -314,7 +308,62 @@ public class ASDCNotificationLogging {
buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
buffer.append(System.lineSeparator());
}
-
+
+ List<NodeTemplate> cvfcList = toscaResourceStructure.getSdcCsarHelper().getNodeTemplateBySdcType(vfNodeTemplate, SdcTypes.CVFC);
+
+ for(NodeTemplate cvfcTemplate : cvfcList) {
+
+ buffer.append(System.lineSeparator());
+ buffer.append("CVNFC Properties:");
+ buffer.append(System.lineSeparator());
+ buffer.append("ModelCustomizationUuid:");
+ buffer.append(testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
+ buffer.append(System.lineSeparator());
+ buffer.append("ModelInvariantUuid:");
+ buffer.append(testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
+ buffer.append(System.lineSeparator());
+ buffer.append("ModelName:");
+ buffer.append(testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
+ buffer.append(System.lineSeparator());
+ buffer.append("ModelUuid:");
+ buffer.append(testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
+ buffer.append(System.lineSeparator());
+ buffer.append("ModelVersion:");
+ buffer.append(testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
+ buffer.append(System.lineSeparator());
+ buffer.append("Description:");
+ buffer.append(testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
+ buffer.append(System.lineSeparator());
+
+
+ List<NodeTemplate> vfcList = toscaResourceStructure.getSdcCsarHelper().getNodeTemplateBySdcType(cvfcTemplate, SdcTypes.VFC);
+
+ for(NodeTemplate vfcTemplate : vfcList) {
+ buffer.append(System.lineSeparator());
+ buffer.append("VNFC Properties:");
+ buffer.append(System.lineSeparator());
+ buffer.append("ModelCustomizationUuid:");
+ buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
+ buffer.append(System.lineSeparator());
+ buffer.append("ModelInvariantUuid:");
+ buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
+ buffer.append(System.lineSeparator());
+ buffer.append("ModelName:");
+ buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
+ buffer.append(System.lineSeparator());
+ buffer.append("ModelUuid:");
+ buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
+ buffer.append(System.lineSeparator());
+ buffer.append("ModelVersion:");
+ buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
+ buffer.append(System.lineSeparator());
+ buffer.append("Description:");
+ buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
+ buffer.append(System.lineSeparator());
+
+ }
+
+ }
}