@Override public Task addTask(Task task) throws TaskStoreException { return taskStore.addTask(task); }
@Override public Collection<Task> getAllTasks() { return taskStore.getAllTasks(); }
@Override public int getSize() { return taskStore.getSize(); }
@Override public Task getTask(int id) { return taskStore.getTask(id); }
@Override public Task removeTask(Task task) throws TaskStoreException { return taskStore.removeTask(task); }
@Override public void clear() { taskStore.clear(); sendTaskCount.clear(); newTasksQueue.clear(); generatedTasksQueue.clear(); }
@Override public List<Task> getTasksWithStatus(TaskStatus... status) { return taskStore.getTasksWithStatus(status); }
@Override public Task getTask(int id) { return taskStore.getTask(id); }
@Override public Task removeTask(int id) throws TaskStoreException { return taskStore.removeTask(id); }
@Override public void clear() { taskStore.clear(); enginesByTaskId.clear(); waitingTasksQueue.clear(); waitingForcedTasksQueue.clear(); }
@Override public List<Task> getTasksWithStatus(Task.TaskStatus... status) { return taskStore.getTasksWithStatus(status); }
@Override public Task getTask(Facility facility, Service service) { return taskStore.getTask(facility, service); }
@Override public Task removeTask(int id) throws TaskStoreException { log.debug("[{}] Removing Task from scheduling pool.", id); Task removed = taskStore.removeTask(id); if (removed != null) { sendTaskCount.remove(id); } else { log.debug("[{}] Task was not in TaskStore (all tasks)", id); } return removed; }
@Override public int getSize() { return taskStore.getSize(); }
@Override public Collection<Task> getAllTasks() { return taskStore.getAllTasks(); }
/** * Adds new Task to the SchedulingPool. * Only newly received Tasks with PLANNED status can be added. * * @param task Task that will be added to the pool. * @return Task that was added to the pool. */ public Task addTask(Task task) throws TaskStoreException { if (task.getStatus() != PLANNED) { throw new IllegalArgumentException("Only Tasks with PLANNED status can be added to SchedulingPool."); } log.debug("[{}] Adding Task to scheduling pool: {}", task.getId(), task); Task addedTask = taskStore.addTask(task); if (task.isPropagationForced()) { try { newTasksQueue.putFirst(task); } catch (InterruptedException e) { handleInterruptedException(task, e); } } else { try { newTasksQueue.put(task); } catch (InterruptedException e) { handleInterruptedException(task, e); } } return addedTask; }
@Override public Task getTask(Facility facility, Service service) { return taskStore.getTask(facility, service); }