public static Watchdog NewTask(Server server, string taskType, string configPayload, LiveExecutionStatus les)
        {
            log.DebugFormat("Factory.NewTask({0:S}, {1:S}) called", server.ToString(), les.ToString());

            var typeToCreate = Tasks.FirstOrDefault(t => t.Name == taskType);

            if (typeToCreate == null)
            {
                throw new Exceptions.UnsupportedTaskException(taskType);
            }

            GenericTask task = (GenericTask)Activator.CreateInstance(typeToCreate);

            task.ParseConfiguration(configPayload);
            return(new Watchdog(server, task, les));
        }
 public Watchdog(Server Server, GenericTask task, LiveExecutionStatus LiveExecutionStatus)
 {
     this.Server = Server;
     this.Task   = task;
     this.LiveExecutionStatus = LiveExecutionStatus;
 }