Interface ServiceTaskProvider
-
public interface ServiceTaskProviderThis class provides access to the tasks of the cloud (tasks folder)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaddPermanentServiceTask(@NotNull ServiceTask serviceTask)Adds a new task to the cloud@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>addPermanentServiceTaskAsync(@NotNull ServiceTask serviceTask)Adds a new task to the cloudjava.util.Collection<ServiceTask>getPermanentServiceTasks()Gets all tasks that are registered in the cloud@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<ServiceTask>>getPermanentServiceTasksAsync()Gets all tasks that are registered in the cloud@Nullable ServiceTaskgetServiceTask(@NotNull java.lang.String name)Gets a specific task by its name@NotNull de.dytanic.cloudnet.common.concurrent.ITask<ServiceTask>getServiceTaskAsync(@NotNull java.lang.String name)Gets a specific task by its namebooleanisServiceTaskPresent(@NotNull java.lang.String name)Checks whether the task with a specific name exists@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>isServiceTaskPresentAsync(@NotNull java.lang.String name)Checks whether the task with a specific name existsvoidreload()Reloads all tasks@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>reloadAsync()Reloads all tasksvoidremovePermanentServiceTask(@NotNull ServiceTask serviceTask)Removes a task from the cloudvoidremovePermanentServiceTask(@NotNull java.lang.String name)Removes a task from the cloud@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>removePermanentServiceTaskAsync(@NotNull ServiceTask serviceTask)Removes a task from the cloud@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>removePermanentServiceTaskAsync(@NotNull java.lang.String name)Removes a task from the cloudvoidsetPermanentServiceTasks(@NotNull java.util.Collection<ServiceTask> serviceTasks)Clears all existing service tasks and sets the given collection as the new service tasks@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>setPermanentServiceTasksAsync(@NotNull java.util.Collection<ServiceTask> serviceTasks)Clears all existing service tasks and sets the given collection as the new service tasks
-
-
-
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
nullif 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:
trueif the task exists orfalseotherwise
-
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
nullif 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:
trueif the task exists orfalseotherwise
-
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)
-
-