aboutsummaryrefslogtreecommitdiffstats
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.java62
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java11
2 files changed, 36 insertions, 37 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 91505918a8..503de0429e 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
@@ -680,36 +680,13 @@ public class ASDCController {
VfResourceStructure resourceStructure = null;
ToscaResourceStructure toscaResourceStructure = new ToscaResourceStructure();
boolean deploySuccessful = true;
+ boolean hasVFResource = false;
String errorMessage = null;
try {
this.processCsarServiceArtifacts(iNotif, toscaResourceStructure);
-
- if (toscaResourceStructure.getServiceVersion() == null) {
- LOGGER.debug("Deploy the workflow");
- IArtifactInfo iArtifact = toscaResourceStructure.getToscaArtifact();
- String csarFilePath = System.getProperty("mso.config.path") + "/ASDC" + "/" + iArtifact.getArtifactName();
- bpmnInstaller.installBpmn(csarFilePath);
- }
-
- // Install a service with no resources, only the service itself
- if (iNotif.getResources() == null || iNotif.getResources().size() < 1) {
-
- LOGGER.debug("No resources found for Service: " + iNotif.getServiceUUID());
-
- try{
- resourceStructure = new VfResourceStructure(iNotif,new ResourceInstance());
-
- this.deployResourceStructure(resourceStructure, toscaResourceStructure);
-
- } catch(ArtifactInstallerException e){
- deploySuccessful = false;
- errorMessage = e.getMessage();
- LOGGER.debug ("Exception in processResourceNotification(): " + e);
- }
- } else { // Services with resources
-
+
for (IResourceInstance resource : iNotif.getResources()){
resourceStructure = new VfResourceStructure(iNotif,resource);
@@ -720,11 +697,14 @@ public class ASDCController {
LOGGER.debug("Processing Resource Type: " + resourceType + " and Model UUID: " + resourceStructure.getResourceInstance().getResourceUUID());
if("VF".equals(resourceType) && !"Allotted Resource".equalsIgnoreCase(category)){
+
+ hasVFResource = true;
for (IArtifactInfo artifact : resource.getArtifacts()) {
IDistributionClientDownloadResult resultArtifact = this.downloadTheArtifact(artifact,
iNotif.getDistributionID());
if (resultArtifact != null) {
+
if (ASDCConfiguration.VF_MODULES_METADATA.equals(artifact.getArtifactType())) {
LOGGER.debug("VF_MODULE_ARTIFACT: "+new String(resultArtifact.getArtifactPayload(),"UTF-8"));
LOGGER.debug(ASDCNotificationLogging.dumpVfModuleMetaDataList(resourceStructure.decodeVfModuleArtifact(resultArtifact.getArtifactPayload())));
@@ -732,21 +712,37 @@ public class ASDCController {
resourceStructure.addArtifactToStructure(distributionClient,artifact, resultArtifact);
}
}
+
+ //Deploy VF resource and artifacts
+ LOGGER.debug("Preparing to deploy Service: " + iNotif.getServiceUUID());
+ try{
+
+ this.deployResourceStructure(resourceStructure, toscaResourceStructure);
+
+ } catch(ArtifactInstallerException e){
+ deploySuccessful = false;
+ errorMessage = e.getMessage();
+ LOGGER.error(e);
+ }
}
+
+ }
+
+ // There are cases where the Service has no VF resources, those are handled here
+ if (!hasVFResource) {
+
+ LOGGER.debug("No resources found for Service: " + iNotif.getServiceUUID());
- //Deploy All resources and artifacts
- LOGGER.debug("Preparing to deploy Service: " + iNotif.getServiceUUID());
- try{
-
+ try{
+ resourceStructure = new VfResourceStructure(iNotif,new ResourceInstance());
+
this.deployResourceStructure(resourceStructure, toscaResourceStructure);
} catch(ArtifactInstallerException e){
deploySuccessful = false;
errorMessage = e.getMessage();
- LOGGER.debug ("Exception in processResourceNotification(): " + e);
- }
-
- }
+ LOGGER.error(e);
+ }
}
this.sendCsarDeployNotification(iNotif, resourceStructure, toscaResourceStructure, deploySuccessful, errorMessage);
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 ca4c5e83a9..f7c761f017 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
@@ -97,6 +97,7 @@ public class ASDCNotificationLogging {
buffer.append(System.lineSeparator());
buffer.append("Environment Context:");
buffer.append(csarHelper.getServiceMetadata().getValue("environmentContext"));
+ buffer.append(System.lineSeparator());
List<NodeTemplate> serviceProxyResourceList = toscaResourceStructure.getSdcCsarHelper().getServiceNodeTemplateBySdcType(SdcTypes.SERVICE_PROXY);
@@ -223,6 +224,9 @@ public class ASDCNotificationLogging {
buffer.append("Type:");
buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)));
buffer.append(System.lineSeparator());
+ buffer.append("Category:");
+ buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY)));
+ buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
buffer.append(System.lineSeparator());
@@ -412,14 +416,13 @@ public class ASDCNotificationLogging {
}
- buffer.append(System.lineSeparator());
- buffer.append("Network Collection Resource Properties:");
- buffer.append(System.lineSeparator());
-
+
List<NodeTemplate> networkCollectionList = toscaResourceStructure.getSdcCsarHelper().getServiceNodeTemplateBySdcType(SdcTypes.CR);
if (networkCollectionList != null) {
for (NodeTemplate crNode : networkCollectionList) {
+ buffer.append(System.lineSeparator());
+ buffer.append("Network Collection Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));