|
|
@ -89,15 +89,17 @@ public class IoTSStartupHandler implements ServerStartupObserver {
|
|
|
|
taskInfo.setProperties(dt.getProperties());
|
|
|
|
taskInfo.setProperties(dt.getProperties());
|
|
|
|
taskManager.registerTask(taskInfo);
|
|
|
|
taskManager.registerTask(taskInfo);
|
|
|
|
taskManager.rescheduleTask(generatedTaskId);
|
|
|
|
taskManager.rescheduleTask(generatedTaskId);
|
|
|
|
|
|
|
|
log.debug("Task - '" + generatedTaskId + "' updated according to the dynamic task table");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (dt.isEnabled()
|
|
|
|
if (dt.isEnabled()
|
|
|
|
&& taskManager.getTaskState(generatedTaskId) == TaskManager.TaskState.PAUSED) {
|
|
|
|
&& taskManager.getTaskState(generatedTaskId) == TaskManager.TaskState.PAUSED) {
|
|
|
|
taskManager.resumeTask(generatedTaskId);
|
|
|
|
taskManager.resumeTask(generatedTaskId);
|
|
|
|
|
|
|
|
log.debug("Task - '" + generatedTaskId + "' enabled according to the dynamic task table");
|
|
|
|
} else if (!dt.isEnabled()
|
|
|
|
} else if (!dt.isEnabled()
|
|
|
|
&& taskManager.getTaskState(generatedTaskId) != TaskManager.TaskState.PAUSED) {
|
|
|
|
&& taskManager.getTaskState(generatedTaskId) != TaskManager.TaskState.PAUSED) {
|
|
|
|
taskManager.pauseTask(generatedTaskId);
|
|
|
|
taskManager.pauseTask(generatedTaskId);
|
|
|
|
|
|
|
|
log.debug("Task - '" + generatedTaskId + "' disabled according to the dynamic task table");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log.info("Task - '" + generatedTaskId + "' updated according to the dynamic task table");
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -108,7 +110,7 @@ public class IoTSStartupHandler implements ServerStartupObserver {
|
|
|
|
dt.getProperties(), triggerInfo);
|
|
|
|
dt.getProperties(), triggerInfo);
|
|
|
|
taskManager.registerTask(taskInfo);
|
|
|
|
taskManager.registerTask(taskInfo);
|
|
|
|
taskManager.scheduleTask(generatedTaskId);
|
|
|
|
taskManager.scheduleTask(generatedTaskId);
|
|
|
|
log.info("New task -'" + generatedTaskId + "' created according to the dynamic task table");
|
|
|
|
log.debug("New task -'" + generatedTaskId + "' created according to the dynamic task table");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -122,7 +124,7 @@ public class IoTSStartupHandler implements ServerStartupObserver {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!isExist) {
|
|
|
|
if (!isExist) {
|
|
|
|
taskManager.deleteTask(taskInfo.getName());
|
|
|
|
taskManager.deleteTask(taskInfo.getName());
|
|
|
|
log.info("Task '" + taskInfo.getName() + "' deleted according to the dynamic task table");
|
|
|
|
log.debug("Task '" + taskInfo.getName() + "' deleted according to the dynamic task table");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log.info("Task Comparison Completed and all tasks in current node are updated");
|
|
|
|
log.info("Task Comparison Completed and all tasks in current node are updated");
|
|
|
|