Remove ECOMP in headers
[clamp.git] / src / main / java / org / onap / clamp / clds / sdc / controller / SdcSingleController.java
index a44f867..c9bbd06 100644 (file)
@@ -18,7 +18,7 @@
  * limitations under the License.\r
  * ============LICENSE_END============================================\r
  * ===================================================================\r
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
+ * \r
  */\r
 \r
 package org.onap.clamp.clds.sdc.controller;\r
@@ -84,8 +84,7 @@ public class SdcSingleController {
         @Override\r
         public void activateCallback(INotificationData iNotif) {\r
             Date startTime = new Date();\r
-            String event = "Receive a callback notification in SDC, nb of resources: " + iNotif.getResources().size();\r
-            logger.debug(event);\r
+            logger.info("Receive a callback notification in SDC, nb of resources: " + iNotif.getResources().size());\r
             sdcController.treatNotification(iNotif);\r
             LoggingUtils.setTimeContext(startTime, new Date());\r
             LoggingUtils.setResponseContext("0", "SDC Notification received and processed successfully",\r
@@ -144,7 +143,7 @@ public class SdcSingleController {
      *             If there is an issue with the parameters provided\r
      */\r
     public void initSdc() throws SdcControllerException {\r
-        logger.debug("Attempt to initialize the SDC Controller");\r
+        logger.info("Attempt to initialize the SDC Controller");\r
         if (this.getControllerStatus() != SdcSingleControllerStatus.STOPPED) {\r
             throw new SdcControllerException("The controller is already initialized, call the closeSDC method first");\r
         }\r
@@ -160,7 +159,7 @@ public class SdcSingleController {
         }\r
         result = this.distributionClient.start();\r
         if (!result.getDistributionActionResult().equals(DistributionActionResultEnum.SUCCESS)) {\r
-            logger.debug("SDC distribution client start failed with reason:" + result.getDistributionMessageResult());\r
+            logger.error("SDC distribution client start failed with reason:" + result.getDistributionMessageResult());\r
             this.changeControllerStatus(SdcSingleControllerStatus.STOPPED);\r
             throw new SdcControllerException(\r
                     "Startup of the SDC Controller failed with reason: " + result.getDistributionMessageResult());\r
@@ -201,10 +200,10 @@ public class SdcSingleController {
     public void treatNotification(INotificationData iNotif) {\r
         CsarHandler csar = null;\r
         try {\r
-            // wait for a random time, so that 2 running Clamp will not treat the same Notification at the same time \r
-            int i = ThreadLocalRandom.current().nextInt(1, 5);\r
-            Thread.sleep(i * 1000);\r
-\r
+            // wait for a random time, so that 2 running Clamp will not treat\r
+            // the same Notification at the same time\r
+            long i = ThreadLocalRandom.current().nextInt(1, 5);\r
+            Thread.sleep(i * 1000L);\r
             logger.info("Notification received for service UUID:" + iNotif.getServiceUUID());\r
             this.changeControllerStatus(SdcSingleControllerStatus.BUSY);\r
             csar = new CsarHandler(iNotif, this.sdcConfig.getSdcControllerName(),\r
@@ -248,6 +247,7 @@ public class SdcSingleController {
                     e.getMessage(), System.currentTimeMillis());\r
         } catch (InterruptedException e) {\r
             logger.error("Interrupt exception caught during the notification processing", e);\r
+            Thread.currentThread().interrupt();\r
         } catch (RuntimeException e) {\r
             logger.error("Unexpected exception caught during the notification processing", e);\r
         } finally {\r
@@ -260,7 +260,7 @@ public class SdcSingleController {
     }\r
 \r
     private IDistributionClientDownloadResult downloadTheArtifact(IArtifactInfo artifact) throws SdcDownloadException {\r
-        logger.debug("Trying to download the artifact : " + artifact.getArtifactURL() + " UUID: "\r
+        logger.info("Trying to download the artifact : " + artifact.getArtifactURL() + " UUID: "\r
                 + artifact.getArtifactUUID());\r
         IDistributionClientDownloadResult downloadResult;\r
         try {\r