Merge "Composite State to handle dmi-reg YANG updates"
authorToine Siebelink <toine.siebelink@est.tech>
Thu, 19 May 2022 13:28:02 +0000 (13:28 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 19 May 2022 13:28:02 +0000 (13:28 +0000)
1  2 
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java

@@@ -39,15 -39,15 +39,15 @@@ public class ModuleSyncWatchdog 
      /**
       * Execute Cm Handle poll which changes the cm handle state from 'ADVISED' to 'READY'.
       */
 -    @Scheduled(fixedDelayString = "${ncmp.timers.advised-modules-sync.sleep-time-ms}")
 +    @Scheduled(fixedDelayString = "${timers.advised-modules-sync.sleep-time-ms}")
      public void executeAdvisedCmHandlePoll() {
          YangModelCmHandle advisedCmHandle = syncUtils.getAnAdvisedCmHandle();
          while (advisedCmHandle != null) {
-             final CmHandleState cmHandleState = advisedCmHandle.getCmHandleState();
              moduleSyncService.syncAndCreateSchemaSet(advisedCmHandle);
              // ToDo Lock Cm Handle if module sync fails
-             syncUtils.updateCmHandleState(advisedCmHandle, cmHandleState.ready());
-             log.info("{} is now in {} state", advisedCmHandle.getId(), advisedCmHandle.getCmHandleState());
+             syncUtils.updateCmHandleState(advisedCmHandle, CmHandleState.READY);
+             log.info("{} is now in {} state", advisedCmHandle.getId(),
+                     advisedCmHandle.getCompositeState().getCmhandleState());
              advisedCmHandle = syncUtils.getAnAdvisedCmHandle();
          }
          log.debug("No Cm-Handles currently found in an ADVISED state");