Class IndexableTaskItem
java.lang.Object
com.microsoft.azure.management.resources.fluentcore.dag.IndexableTaskItem
- All Implemented Interfaces:
TaskGroup.HasTaskGroup
,TaskItem
,Indexable
public abstract class IndexableTaskItem
extends Object
implements Indexable, TaskItem, TaskGroup.HasTaskGroup
An index-able TaskItem with a TaskGroup.
-
Constructor Summary
ConstructorDescriptionCreates a TaskItem which is index-able using a random UUID.IndexableTaskItem
(String key) Creates a TaskItem which is index-able using provided key. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
addDependency
(FunctionalTaskItem dependency) Add a dependency task item for this task item.protected String
addDependency
(TaskGroup.HasTaskGroup dependency) Add a dependency for this task item.protected String
addDependency
(Creatable<? extends Indexable> creatable) Add a creatable dependency for this task item.protected String
addDependency
(Executable<? extends Indexable> executable) Add an executable dependency for this task item.protected String
addeDependency
(Appliable<? extends Indexable> appliable) Add an appliable dependency for this task item.addPostRunDependent
(FunctionalTaskItem dependent) Add a "post-run" dependent task item for this task item.addPostRunDependent
(TaskGroup.HasTaskGroup dependent) Add a "post-run" dependent for this task item.protected String
addPostRunDependent
(Appliable<? extends Indexable> appliable) Add an appliable "post-run" dependent for this task item.protected String
addPostRunDependent
(Creatable<? extends Indexable> creatable) Add a creatable "post-run" dependent for this task item.protected String
addPostRunDependent
(Executable<? extends Indexable> executable) Add an executable "post-run" dependent for this task item.void
The method that gets called before invoking all the tasks in theTaskGroup
this task belongs to.void
clear()
Clear the result produced by the task.static IndexableTaskItem
create
(FunctionalTaskItem taskItem) Creates an IndexableTaskItem from provided FunctionalTaskItem.rx.Completable
invokeAfterPostRunAsync
(boolean isGroupFaulted) The method that gets called after invocation of "post run" task items depends on this TaskItem.rx.Observable<Indexable>
invokeAsync
(TaskGroup.InvocationContext context) The method that gets called to perform the unit of work asynchronously.protected abstract rx.Observable<Indexable>
boolean
isHot()
key()
result()
protected <T extends Indexable>
TtaskResult
(String key) Get result of one of the task that belongs to this task's task group.protected Indexable
protected rx.Observable<Indexable>
-
Constructor Details
-
IndexableTaskItem
Creates a TaskItem which is index-able using provided key.- Parameters:
key
- the unique key to index this TaskItem
-
IndexableTaskItem
public IndexableTaskItem()Creates a TaskItem which is index-able using a random UUID.
-
-
Method Details
-
create
Creates an IndexableTaskItem from provided FunctionalTaskItem.- Parameters:
taskItem
- functional TaskItem- Returns:
- IndexableTaskItem
-
taskGroup
- Specified by:
taskGroup
in interfaceTaskGroup.HasTaskGroup
- Returns:
- the TaskGroup this this TaskItem as root.
-
clear
public void clear()Clear the result produced by the task. -
key
-
addDependency
Add a dependency task item for this task item.- Parameters:
dependency
- the dependency task item.- Returns:
- key to be used as parameter to taskResult(string) method to retrieve result the task item
-
addDependency
Add a dependency for this task item.- Parameters:
dependency
- the dependency.- Returns:
- key to be used as parameter to taskResult(string) method to retrieve result of root task in the given dependency task group
-
addDependency
Add a creatable dependency for this task item.- Parameters:
creatable
- the creatable dependency.- Returns:
- the key to be used as parameter to taskResult(string) method to retrieve created dependency
-
addeDependency
Add an appliable dependency for this task item.- Parameters:
appliable
- the appliable dependency.- Returns:
- the key to be used as parameter to taskResult(string) method to retrieve updated dependency
-
addDependency
Add an executable dependency for this task item.- Parameters:
executable
- the executable dependency- Returns:
- the key to be used as parameter to taskResult(string) method to retrieve result of executing the executable dependency
-
addPostRunDependent
Add a "post-run" dependent task item for this task item.- Parameters:
dependent
- the "post-run" dependent task item.- Returns:
- key to be used as parameter to taskResult(string) method to retrieve result of root task in the given dependent task group
-
addPostRunDependent
Add a "post-run" dependent for this task item.- Parameters:
dependent
- the "post-run" dependent.- Returns:
- key to be used as parameter to taskResult(string) method to retrieve result of root task in the given dependent task group
-
addPostRunDependent
Add a creatable "post-run" dependent for this task item.- Parameters:
creatable
- the creatable "post-run" dependent.- Returns:
- the key to be used as parameter to taskResult(string) method to retrieve created "post-run" dependent
-
addPostRunDependent
Add an appliable "post-run" dependent for this task item.- Parameters:
appliable
- the appliable "post-run" dependent.- Returns:
- the key to be used as parameter to taskResult(string) method to retrieve updated "post-run" dependent
-
addPostRunDependent
Add an executable "post-run" dependent for this task item.- Parameters:
executable
- the executable "post-run" dependent- Returns:
- the key to be used as parameter to taskResult(string) method to retrieve result of executing the executable "post-run" dependent
-
taskResult
Get result of one of the task that belongs to this task's task group.- Type Parameters:
T
- the actual type of the task result- Parameters:
key
- the task key- Returns:
- the task result, null will be returned if task has not produced a result yet
-
result
-
beforeGroupInvoke
public void beforeGroupInvoke()Description copied from interface:TaskItem
The method that gets called before invoking all the tasks in theTaskGroup
this task belongs to.- Specified by:
beforeGroupInvoke
in interfaceTaskItem
-
isHot
public boolean isHot() -
invokeAsync
Description copied from interface:TaskItem
The method that gets called to perform the unit of work asynchronously.- Specified by:
invokeAsync
in interfaceTaskItem
- Parameters:
context
- the context shared across the the all task items in the group this task item belongs to.- Returns:
- an observable upon subscription does the unit of work and produces
result of type
Indexable
-
invokeAfterPostRunAsync
public rx.Completable invokeAfterPostRunAsync(boolean isGroupFaulted) Description copied from interface:TaskItem
The method that gets called after invocation of "post run" task items depends on this TaskItem.This method will be invoked only if this TaskItem had "post run" dependents.
- Specified by:
invokeAfterPostRunAsync
in interfaceTaskItem
- Parameters:
isGroupFaulted
- true if one or more tasks in the group this TaskItem belongs to are in faulted state.- Returns:
- a completable representing any asynchronous work initiated
-
invokeTaskAsync
-
voidIndexable
- Returns:
- an instance of
VoidIndexable
with key same as the key of this TaskItem.
-
voidObservable
- Returns:
- an Observable upon subscription emits
VoidIndexable
with key same as the key of this TaskItem
-