Merge "Composite State to handle dmi-reg YANG updates"
[cps.git] / cps-ncmp-service / src / main / java / org / onap / cps / ncmp / api / inventory / sync / ModuleSyncWatchdog.java
index 368262b..353db9d 100644 (file)
@@ -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");