Class AbstractTaskScheduler

    • Constructor Detail

      • AbstractTaskScheduler

        public AbstractTaskScheduler​(PartitionedStorageProvider storageProvider)
        Creates a new AbstractTaskScheduler using the provided storageProvider
        Parameters:
        storageProvider - the storageProvider to use
      • AbstractTaskScheduler

        public AbstractTaskScheduler​(PartitionedStorageProvider storageProvider,
                                     List<TaskFilter> taskFilters)
        Creates a new AbstractTaskScheduler using the provided storageProvider and the list of TaskFilters that will be used for every background task
        Parameters:
        storageProvider - the storageProvider to use
        taskFilters - list of taskFilters that will be used for every task
    • Method Detail

      • delete

        public void delete​(TaskId taskId)
        Parameters:
        taskId - the id of the task
        See Also:
        delete(UUID)
      • delete

        public void delete​(TaskId taskId,
                           String reason)
        Parameters:
        taskId - the id of the task
        reason - the reason to delete
        See Also:
        delete(UUID, String)
      • delete

        public void delete​(UUID id)
        Deletes a task and sets its state to DELETED. If the task is being processed, it will be interrupted.
        Parameters:
        id - the id of the task
      • delete

        public void delete​(UUID id,
                           String reason)
        Deletes a task and sets its state to DELETED. If the task is being processed, it will be interrupted.
        Parameters:
        id - the id of the task
        reason - the reason why the task is deleted.
      • delete

        public void delete​(String id)
        Deletes the recurring task based on the given id.

        An example:

        
              taskScheduler.delete("my-recurring-task"));
         
        Parameters:
        id - the id of the recurring task to delete
      • shutdown

        public void shutdown()
        Utility method to register the shutdown of Carrot in various containers - it is even automatically called by Spring Framework. Note that this will stop the BackgroundTaskServer, the Dashboard and the StorageProvider. TaskProcessing will stop and enqueueing new tasks will fail.