From f520d38414df03382d6af4f902e1d86ca67a0655 Mon Sep 17 00:00:00 2001 From: "Determe, Sebastien (sd378r)" Date: Wed, 16 May 2018 14:24:56 +0200 Subject: [PATCH] Fix Sdc controller 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) --- .../clamp/clds/config/spring/CldsSdcControllerConfiguration.java | 9 ++------- .../org/onap/clamp/clds/sdc/controller/SdcSingleController.java | 5 ++++- src/main/java/org/onap/clamp/clds/service/CldsService.java | 2 -- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/onap/clamp/clds/config/spring/CldsSdcControllerConfiguration.java b/src/main/java/org/onap/clamp/clds/config/spring/CldsSdcControllerConfiguration.java index 46c483f9..05584708 100644 --- a/src/main/java/org/onap/clamp/clds/config/spring/CldsSdcControllerConfiguration.java +++ b/src/main/java/org/onap/clamp/clds/config/spring/CldsSdcControllerConfiguration.java @@ -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"); diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java b/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java index 3421ee9e..9cad683a 100644 --- a/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java +++ b/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java @@ -145,7 +145,7 @@ public class SdcSingleController { * If there is an issue with the parameters provided */ public void initSdc() throws SdcControllerException { - logger.info("Attempt to initialize the SDC Controller"); + logger.info("Attempt to initialize the SDC Controller: " + sdcConfig.getSdcControllerName()); if (this.getControllerStatus() != SdcSingleControllerStatus.STOPPED) { throw new SdcControllerException("The controller is already initialized, call the closeSDC method first"); } @@ -159,6 +159,8 @@ public class SdcSingleController { throw new SdcControllerException("Initialization of the SDC Controller failed with reason: " + result.getDistributionMessageResult()); } + logger.info("SDC Controller successfully initialized: " + sdcConfig.getSdcControllerName()); + logger.info("Attempt to start the SDC Controller: " + sdcConfig.getSdcControllerName()); result = this.distributionClient.start(); if (!result.getDistributionActionResult().equals(DistributionActionResultEnum.SUCCESS)) { logger.error("SDC distribution client start failed with reason:" + result.getDistributionMessageResult()); @@ -166,6 +168,7 @@ public class SdcSingleController { throw new SdcControllerException( "Startup of the SDC Controller failed with reason: " + result.getDistributionMessageResult()); } + logger.info("SDC Controller successfully started: " + sdcConfig.getSdcControllerName()); this.changeControllerStatus(SdcSingleControllerStatus.IDLE); } diff --git a/src/main/java/org/onap/clamp/clds/service/CldsService.java b/src/main/java/org/onap/clamp/clds/service/CldsService.java index 592a9457..888b782e 100644 --- a/src/main/java/org/onap/clamp/clds/service/CldsService.java +++ b/src/main/java/org/onap/clamp/clds/service/CldsService.java @@ -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() { -- 2.16.6