Fix Sdc controller 11/47811/2
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Wed, 16 May 2018 12:24:56 +0000 (14:24 +0200)
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Wed, 16 May 2018 12:36:08 +0000 (14:36 +0200)
Fix Sdc controller startup, it should not impact the spring startup now
as there is a periodic process that checks that every 2 mins

Issue-ID: CLAMP-151
Change-Id: I47f81383eba320c08e923f7408f268b346aa68c5
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
src/main/java/org/onap/clamp/clds/config/spring/CldsSdcControllerConfiguration.java
src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java
src/main/java/org/onap/clamp/clds/service/CldsService.java

index 46c483f..0558470 100644 (file)
@@ -60,13 +60,8 @@ public class CldsSdcControllerConfiguration {
     public void loadSdcControllers() {
         SdcControllersConfiguration sdcControllersConfig = getSdcControllersConfiguration();
         sdcControllersConfig.getAllDefinedControllers().forEach((k, v) -> {
-            logger.info("Instantiating controller :" + k);
+            logger.info("Creating controller instance:" + k);
             SdcSingleController sdcController = new SdcSingleController(clampProp, csarInstaller, v, true);
-            try {
-                sdcController.initSdc();
-            } catch (SdcControllerException e) {
-                logger.error("Exception caught when starting sdc controller", e);
-            }
             sdcControllersList.add(sdcController);
         });
     }
@@ -80,7 +75,7 @@ public class CldsSdcControllerConfiguration {
                     controller.initSdc();
                 }
             } catch (SdcControllerException e) {
-                logger.error("Exception caught when rebooting sdc controller", e);
+                logger.error("Exception caught when booting sdc controller", e);
             }
         }
         logger.info("SDC Controllers check completed");
index 3421ee9..9cad683 100644 (file)
@@ -145,7 +145,7 @@ public class SdcSingleController {
      *             If there is an issue with the parameters provided\r
      */\r
     public void initSdc() throws SdcControllerException {\r
-        logger.info("Attempt to initialize the SDC Controller");\r
+        logger.info("Attempt to initialize the SDC Controller: " + sdcConfig.getSdcControllerName());\r
         if (this.getControllerStatus() != SdcSingleControllerStatus.STOPPED) {\r
             throw new SdcControllerException("The controller is already initialized, call the closeSDC method first");\r
         }\r
@@ -159,6 +159,8 @@ public class SdcSingleController {
             throw new SdcControllerException("Initialization of the SDC Controller failed with reason: "\r
                     + result.getDistributionMessageResult());\r
         }\r
+        logger.info("SDC Controller successfully initialized: " + sdcConfig.getSdcControllerName());\r
+        logger.info("Attempt to start the SDC Controller: " + sdcConfig.getSdcControllerName());\r
         result = this.distributionClient.start();\r
         if (!result.getDistributionActionResult().equals(DistributionActionResultEnum.SUCCESS)) {\r
             logger.error("SDC distribution client start failed with reason:" + result.getDistributionMessageResult());\r
@@ -166,6 +168,7 @@ public class SdcSingleController {
             throw new SdcControllerException(\r
                     "Startup of the SDC Controller failed with reason: " + result.getDistributionMessageResult());\r
         }\r
+        logger.info("SDC Controller successfully started: " + sdcConfig.getSdcControllerName());\r
         this.changeControllerStatus(SdcSingleControllerStatus.IDLE);\r
     }\r
 \r
index 592a945..888b782 100644 (file)
@@ -36,7 +36,6 @@ import java.util.Date;
 import java.util.List;
 import java.util.Properties;
 import java.util.UUID;
-import java.util.concurrent.TimeUnit;
 
 import javax.annotation.PostConstruct;
 import javax.ws.rs.BadRequestException;
@@ -121,7 +120,6 @@ public class CldsService extends SecureServiceBase {
     private SecureServicePermission permissionUpdateCl;
     private SecureServicePermission permissionReadTemplate;
     private SecureServicePermission permissionUpdateTemplate;
-    private static final long DCAE_DEPLOY_WAITING_TIME = TimeUnit.SECONDS.toNanos(30);
 
     @PostConstruct
     private final void afterConstruction() {