Interface ServiceTaskProvider


  • public interface ServiceTaskProvider
    This class provides access to the tasks of the cloud (tasks folder)
    • Method Detail

      • reload

        void reload()
        Reloads all tasks
      • getPermanentServiceTasks

        java.util.Collection<ServiceTask> getPermanentServiceTasks()
        Gets all tasks that are registered in the cloud
        Returns:
        a list containing the task configurations of all tasks
      • setPermanentServiceTasks

        void setPermanentServiceTasks​(@NotNull
                                      @NotNull java.util.Collection<ServiceTask> serviceTasks)
        Clears all existing service tasks and sets the given collection as the new service tasks
        Parameters:
        serviceTasks - the new service tasks
      • getServiceTask

        @Nullable
        @Nullable ServiceTask getServiceTask​(@NotNull
                                             @NotNull java.lang.String name)
        Gets a specific task by its name
        Parameters:
        name - the name of the task
        Returns:
        the task or null if no task with that name exists
      • isServiceTaskPresent

        boolean isServiceTaskPresent​(@NotNull
                                     @NotNull java.lang.String name)
        Checks whether the task with a specific name exists
        Parameters:
        name - the name of the task
        Returns:
        true if the task exists or false otherwise
      • addPermanentServiceTask

        boolean addPermanentServiceTask​(@NotNull
                                        @NotNull ServiceTask serviceTask)
        Adds a new task to the cloud
        Parameters:
        serviceTask - the task to be added
      • removePermanentServiceTask

        void removePermanentServiceTask​(@NotNull
                                        @NotNull java.lang.String name)
        Removes a task from the cloud
        Parameters:
        name - the name of the task to be removed
      • removePermanentServiceTask

        void removePermanentServiceTask​(@NotNull
                                        @NotNull ServiceTask serviceTask)
        Removes a task from the cloud
        Parameters:
        serviceTask - the task to be removed (the only thing that matters in this object is the name, the rest is ignored)
      • reloadAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> reloadAsync()
        Reloads all tasks
      • getPermanentServiceTasksAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<ServiceTask>> getPermanentServiceTasksAsync()
        Gets all tasks that are registered in the cloud
        Returns:
        a list containing the task configurations of all tasks
      • setPermanentServiceTasksAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> setPermanentServiceTasksAsync​(@NotNull
                                                                                                           @NotNull java.util.Collection<ServiceTask> serviceTasks)
        Clears all existing service tasks and sets the given collection as the new service tasks
        Parameters:
        serviceTasks - the new service tasks
      • getServiceTaskAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<ServiceTask> getServiceTaskAsync​(@NotNull
                                                                                              @NotNull java.lang.String name)
        Gets a specific task by its name
        Parameters:
        name - the name of the task
        Returns:
        the task or null if no task with that name exists
      • isServiceTaskPresentAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> isServiceTaskPresentAsync​(@NotNull
                                                                                                          @NotNull java.lang.String name)
        Checks whether the task with a specific name exists
        Parameters:
        name - the name of the task
        Returns:
        true if the task exists or false otherwise
      • addPermanentServiceTaskAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> addPermanentServiceTaskAsync​(@NotNull
                                                                                                             @NotNull ServiceTask serviceTask)
        Adds a new task to the cloud
        Parameters:
        serviceTask - the task to be added
      • removePermanentServiceTaskAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> removePermanentServiceTaskAsync​(@NotNull
                                                                                                             @NotNull java.lang.String name)
        Removes a task from the cloud
        Parameters:
        name - the name of the task to be removed
      • removePermanentServiceTaskAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> removePermanentServiceTaskAsync​(@NotNull
                                                                                                             @NotNull ServiceTask serviceTask)
        Removes a task from the cloud
        Parameters:
        serviceTask - the task to be removed (the only thing that matters in this object is the name, the rest is ignored)