diff options
Diffstat (limited to 'asdc-controller/src/main')
-rw-r--r-- | asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java | 6 | ||||
-rw-r--r-- | asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java | 8 |
2 files changed, 9 insertions, 5 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 3b9406a697..073412133c 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 @@ -37,6 +37,7 @@ import java.nio.file.Paths; import java.util.List; import java.util.Optional; import org.onap.so.logger.LoggingAnchor; +import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.onap.sdc.api.IDistributionClient; import org.onap.sdc.api.consumer.IDistributionStatusMessage; import org.onap.sdc.api.consumer.IFinalDistrStatusMessage; @@ -71,6 +72,7 @@ import org.onap.so.logger.ErrorCode; import org.onap.so.logger.MessageEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.orm.ObjectOptimisticLockingFailureException; import org.springframework.stereotype.Component; @@ -588,6 +590,10 @@ public class ASDCController { logger.info(LoggingAnchor.FOUR, MessageEnum.ASDC_RECEIVE_CALLBACK_NOTIF.toString(), String.valueOf(noOfArtifacts), iNotif.getServiceUUID(), "ASDC"); try { + + if (iNotif.getDistributionID() != null && !iNotif.getDistributionID().isEmpty()) { + MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, iNotif.getDistributionID()); + } logger.debug(ASDCNotificationLogging.dumpASDCNotification(iNotif)); logger.info(LoggingAnchor.FOUR, MessageEnum.ASDC_RECEIVE_SERVICE_NOTIF.toString(), iNotif.getServiceUUID(), "ASDC", "treatNotification"); diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java index 095741c19b..195aa7e302 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java @@ -33,7 +33,6 @@ import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import java.util.zip.ZipInputStream; -import org.onap.so.logger.LoggingAnchor; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; @@ -49,6 +48,7 @@ import org.apache.http.entity.mime.content.StringBody; import org.apache.http.impl.client.HttpClientBuilder; import org.onap.so.asdc.client.ASDCConfiguration; import org.onap.so.logger.ErrorCode; +import org.onap.so.logger.LoggingAnchor; import org.onap.so.logger.MessageEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -71,9 +71,8 @@ public class BpmnInstaller { public void installBpmn(String csarFilePath) { logger.info("Deploying BPMN files from {}", csarFilePath); - try { - ZipInputStream csarFile = - new ZipInputStream(new FileInputStream(Paths.get(csarFilePath).normalize().toString())); + try (ZipInputStream csarFile = + new ZipInputStream(new FileInputStream(Paths.get(csarFilePath).normalize().toString()))) { ZipEntry entry = csarFile.getNextEntry(); while (entry != null) { @@ -103,7 +102,6 @@ public class BpmnInstaller { } entry = csarFile.getNextEntry(); } - csarFile.close(); } catch (IOException ex) { logger.debug("Exception :", ex); logger.error(LoggingAnchor.FIVE, MessageEnum.ASDC_ARTIFACT_NOT_DEPLOYED_DETAIL.toString(), csarFilePath, |