public interface TaskManager extends TaskConditionClassProvider
Modifier and Type | Method and Description |
---|---|
void |
createTask(HubContext ctx,
java.lang.String name,
java.lang.String description,
java.util.List<PropertyContainer> conditions,
PropertyContainerSet actionSet)
Creates a new task in the system.
|
void |
deleteTask(TaskContext ctx)
Deletes a previously added task.
|
void |
executeTask(TaskContext ctx)
Manually executes a task.
|
void |
fireTaskTrigger(TaskContext ctx)
Indicates that a task trigger condition has been met.
|
java.util.Collection<TaskConditionClass> |
getConditionClasses(HubContext ctx,
ConditionClassType type,
boolean applyConstraints)
Returns all published condition classes.
|
HobsonTask |
getTask(TaskContext ctx)
Returns a specific task.
|
java.util.Collection<HobsonTask> |
getTasks(HubContext ctx)
Returns all tasks that have been published by all task providers.
|
void |
publishConditionClass(TaskConditionClass conditionClass)
Publishes a condition class.
|
void |
updateTask(PluginContext pctx,
TaskContext tctx,
java.lang.String name,
java.lang.String description,
boolean enabled,
java.util.List<PropertyContainer> conditions,
PropertyContainerSet actionSet)
Updates an existing task.
|
void |
updateTaskProperties(PluginContext pctx,
TaskContext tctx,
java.util.Map<java.lang.String,java.lang.Object> properties)
Updates a task's properties.
|
getConditionClass
void createTask(HubContext ctx, java.lang.String name, java.lang.String description, java.util.List<PropertyContainer> conditions, PropertyContainerSet actionSet)
ctx
- the hub contextname
- the task namedescription
- the task descriptionconditions
- the task's conditionsactionSet
- the task's action setvoid deleteTask(TaskContext ctx)
ctx
- the context of the taskvoid executeTask(TaskContext ctx)
ctx
- the context of the task to executevoid fireTaskTrigger(TaskContext ctx)
ctx
- the context of the target hubjava.util.Collection<TaskConditionClass> getConditionClasses(HubContext ctx, ConditionClassType type, boolean applyConstraints)
ctx
- the context of the hub that published the condition classestype
- filter the results by a type of condition class (or null for all)applyConstraints
- only return condition classes for which the constraints of their typed properties can be
met by the currently available system services (i.e. don't show the user things they
can't do)HobsonTask getTask(TaskContext ctx)
ctx
- the context of the taskjava.util.Collection<HobsonTask> getTasks(HubContext ctx)
ctx
- the context of the target hubvoid publishConditionClass(TaskConditionClass conditionClass)
conditionClass
- the condition class to publishvoid updateTask(PluginContext pctx, TaskContext tctx, java.lang.String name, java.lang.String description, boolean enabled, java.util.List<PropertyContainer> conditions, PropertyContainerSet actionSet)
pctx
- the plugin updating the task (prevents that plugin from receiving the update event)tctx
- the context of the task to updatename
- the new task namedescription
- the description of the new taskenabled
- indicates whether the task should be enabledconditions
- the task's conditionsactionSet
- the task's action setvoid updateTaskProperties(PluginContext pctx, TaskContext tctx, java.util.Map<java.lang.String,java.lang.Object> properties)
pctx
- the plugin updating the task (prevents that plugin from receiving the update event)tctx
- the task contextproperties
- the new propertiesCopyright © 2015 Whizzo Software LLC. All rights reserved.