Class IndexableTaskItem
java.lang.Object
com.azure.resourcemanager.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
ConstructorsConstructorDescriptionCreates a TaskItem which is index-able using a random UUID.IndexableTaskItem(ResourceManagerUtils.InternalRuntimeContext internalContext) Creates 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 StringaddDependency(FunctionalTaskItem dependency) Add a dependency task item for this task item.protected StringaddDependency(TaskGroup.HasTaskGroup dependency) Add a dependency for this task item.protected StringaddDependency(Appliable<? extends Indexable> appliable) Add an appliable dependency for this task item.protected StringaddDependency(Creatable<? extends Indexable> creatable) Add a creatable dependency for this task item.protected StringaddDependency(Executable<? extends Indexable> executable) Add an executable 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 StringaddPostRunDependent(Appliable<? extends Indexable> appliable) Add an appliable "post-run" dependent for this task item.protected StringaddPostRunDependent(Creatable<? extends Indexable> creatable) Add a creatable "post-run" dependent for this task item.protected StringaddPostRunDependent(Executable<? extends Indexable> executable) Add an executable "post-run" dependent for this task item.voidThe method that gets called before invoking all the tasks in theTaskGroupthis task belongs to.voidclear()Clear the result produced by the task.static IndexableTaskItemcreate(FunctionalTaskItem taskItem) Creates an IndexableTaskItem from provided FunctionalTaskItem.static IndexableTaskItemcreate(FunctionalTaskItem taskItem, ResourceManagerUtils.InternalRuntimeContext internalContext) Creates an IndexableTaskItem from provided FunctionalTaskItem.invokeAfterPostRunAsync(boolean isGroupFaulted) The method that gets called after invocation of "post run" task items depends on this TaskItem.invokeAsync(TaskGroup.InvocationContext context) The method that gets called to perform the unit of work asynchronously.Invokes a task asynchronously.booleanisHot()Check whether is a hot observable.key()Gets the index key.result()Gets the result of the task invocation.Gets the task group.protected <T extends Indexable>
TtaskResult(String key) Get result of one of the task that belongs to this task's task group.protected IndexableGet an instance of VoidIndexable.Get an Observable upon subscription emits VoidIndexable.
-
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. -
IndexableTaskItem
Creates a TaskItem which is index-able using a random UUID.- Parameters:
internalContext- the internal runtime context
-
-
Method Details
-
create
Creates an IndexableTaskItem from provided FunctionalTaskItem.- Parameters:
taskItem- functional TaskItem- Returns:
- IndexableTaskItem
-
create
public static IndexableTaskItem create(FunctionalTaskItem taskItem, ResourceManagerUtils.InternalRuntimeContext internalContext) Creates an IndexableTaskItem from provided FunctionalTaskItem.- Parameters:
taskItem- functional TaskIteminternalContext- the internal runtime context- Returns:
- IndexableTaskItem
-
taskGroup
Description copied from interface:TaskGroup.HasTaskGroupGets the task group.- Specified by:
taskGroupin interfaceTaskGroup.HasTaskGroup- Returns:
- the TaskGroup this this TaskItem as root.
-
clear
public void clear()Clear the result produced by the task. -
key
Description copied from interface:IndexableGets the index 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
-
addDependency
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
Description copied from interface:TaskItemGets the result of the task invocation. -
beforeGroupInvoke
public void beforeGroupInvoke()Description copied from interface:TaskItemThe method that gets called before invoking all the tasks in theTaskGroupthis task belongs to.- Specified by:
beforeGroupInvokein interfaceTaskItem
-
isHot
public boolean isHot()Description copied from interface:TaskItemCheck whether is a hot observable. -
invokeAsync
Description copied from interface:TaskItemThe method that gets called to perform the unit of work asynchronously.- Specified by:
invokeAsyncin interfaceTaskItem- Parameters:
context- the context shared across the the all task items in the group this task item belongs to.- Returns:
- a
Monoupon subscription does the unit of work and produces result of typeIndexable
-
invokeAfterPostRunAsync
Description copied from interface:TaskItemThe 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:
invokeAfterPostRunAsyncin interfaceTaskItem- Parameters:
isGroupFaulted- true if one or more tasks in the group this TaskItem belongs to are in faulted state.- Returns:
- a
Fluxrepresenting any asynchronous work initiated
-
invokeTaskAsync
Invokes a task asynchronously.- Parameters:
context- Context of the invocation.- Returns:
- an Observable upon subscription emits
Indexable.
-
voidIndexable
Get an instance of VoidIndexable.- Returns:
- an instance of
VoidIndexablewith key same as the key of this TaskItem.
-
voidPublisher
Get an Observable upon subscription emits VoidIndexable.- Returns:
- an Observable upon subscription emits
VoidIndexablewith key same as the key of this TaskItem
-