public class BrooklynTaskTags extends TaskTags
Modifier and Type | Class and Description |
---|---|
static class |
BrooklynTaskTags.EffectorCallTag |
static class |
BrooklynTaskTags.EntitlementTag |
static class |
BrooklynTaskTags.WrappedEntity |
static class |
BrooklynTaskTags.WrappedStream |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BROOKLYN_SERVER_TASK_TAG
Tag for tasks which are running on behalf of the management server, rather than any entity
|
static java.lang.String |
CALLER_ENTITY |
static java.lang.String |
CONTEXT_ENTITY |
static java.lang.String |
EFFECTOR_TAG
Tag for a task which represents an effector
|
static java.lang.String |
NON_TRANSIENT_TASK_TAG
Tag for a task which *is* interesting, in contrast to
TRANSIENT_TASK_TAG |
static java.lang.String |
STREAM_ENV
not a stream, but inserted with the same mechanism
|
static java.lang.String |
STREAM_STDERR |
static java.lang.String |
STREAM_STDIN |
static java.lang.String |
STREAM_STDOUT |
static java.lang.String |
TARGET_ENTITY |
static java.lang.String |
TRANSIENT_TASK_TAG
indicates a task is transient, roughly that is to say it is uninteresting --
specifically this means it can be GC'd as soon as it is completed,
and that it need not appear in some task lists;
often used for framework lifecycle events and sensor polling
|
INESSENTIAL_TASK, SUB_TASK_TAG
Constructor and Description |
---|
BrooklynTaskTags() |
Modifier and Type | Method and Description |
---|---|
static Entity |
getContextEntity(Task<?> task) |
static BrooklynTaskTags.EffectorCallTag |
getEffectorCallTag(Task<?> task,
boolean recurse)
finds the first
BrooklynTaskTags.EffectorCallTag tag on this tag, or optionally on submitters, or null |
static java.lang.String |
getEffectorName(Task<?> task)
finds the first
BrooklynTaskTags.EffectorCallTag tag on this tag or a submitter, and returns the effector name |
static EntitlementContext |
getEntitlement(BrooklynTaskTags.EntitlementTag tag) |
static EntitlementContext |
getEntitlement(java.util.Collection<?> tags) |
static EntitlementContext |
getEntitlement(Task<?> task) |
static Entity |
getTargetOrContextEntity(Task<?> t) |
static java.util.Set<Task<?>> |
getTasksInEntityContext(ExecutionManager em,
Entity e) |
static Entity |
getWrappedEntityOfType(java.util.Collection<?> tags,
java.lang.String wrappingType) |
static Entity |
getWrappedEntityOfType(Task<?> t,
java.lang.String wrappingType) |
static boolean |
isEffectorTask(Task<?> task) |
static boolean |
isInEffectorTask(Task<?> task,
Entity entity,
Effector<?> effector,
boolean allowNestedEffectorCalls)
checks if the given task is part of the given effector call on the given entity;
|
static boolean |
isSubTask(Task<?> task) |
static boolean |
isTransient(Task<?> task) |
static void |
setInessential(Task<?> task) |
static void |
setTransient(Task<?> task) |
static BrooklynTaskTags.WrappedStream |
stream(Task<?> task,
java.lang.String streamType)
returns the tag for the indicated stream, or null
|
static java.util.Set<BrooklynTaskTags.WrappedStream> |
streams(Task<?> task)
returns the set of tags indicating the streams available on a task
|
static BrooklynTaskTags.WrappedEntity |
tagForCallerEntity(Entity entity) |
static BrooklynTaskTags.WrappedEntity |
tagForContextEntity(Entity entity) |
static BrooklynTaskTags.EffectorCallTag |
tagForEffectorCall(Entity entity,
java.lang.String effectorName) |
static BrooklynTaskTags.EntitlementTag |
tagForEntitlement(EntitlementContext context) |
static BrooklynTaskTags.WrappedStream |
tagForEnvStream(java.lang.String streamEnv,
java.util.Map<?,?> env)
creates a tag suitable for attaching a snapshot of an environment var map as a "stream" on a task;
mainly for use with STREAM_ENV
|
static BrooklynTaskTags.WrappedStream |
tagForStream(java.lang.String streamType,
java.io.ByteArrayOutputStream stream)
creates a tag suitable for marking a stream available on a task
|
static BrooklynTaskTags.WrappedStream |
tagForStream(java.lang.String streamType,
com.google.common.base.Supplier<java.lang.String> contents,
com.google.common.base.Supplier<java.lang.Integer> size)
creates a tag suitable for marking a stream available on a task
|
static BrooklynTaskTags.WrappedStream |
tagForStreamSoft(java.lang.String streamType,
java.io.ByteArrayOutputStream stream)
creates a tag suitable for marking a stream available on a task, but which might be GC'd
|
static BrooklynTaskTags.WrappedEntity |
tagForTargetEntity(Entity entity) |
addTagDynamically, addTagsDynamically, hasTag, isInessential, markInessential
public static final java.lang.String BROOKLYN_SERVER_TASK_TAG
public static final java.lang.String EFFECTOR_TAG
public static final java.lang.String NON_TRANSIENT_TASK_TAG
TRANSIENT_TASK_TAG
public static final java.lang.String TRANSIENT_TASK_TAG
public static final java.lang.String CONTEXT_ENTITY
public static final java.lang.String CALLER_ENTITY
public static final java.lang.String TARGET_ENTITY
public static final java.lang.String STREAM_STDIN
public static final java.lang.String STREAM_STDOUT
public static final java.lang.String STREAM_STDERR
public static final java.lang.String STREAM_ENV
public static BrooklynTaskTags.WrappedEntity tagForContextEntity(Entity entity)
public static BrooklynTaskTags.WrappedEntity tagForCallerEntity(Entity entity)
public static BrooklynTaskTags.WrappedEntity tagForTargetEntity(Entity entity)
public static Entity getWrappedEntityOfType(Task<?> t, java.lang.String wrappingType)
public static Entity getWrappedEntityOfType(java.util.Collection<?> tags, java.lang.String wrappingType)
public static java.util.Set<Task<?>> getTasksInEntityContext(ExecutionManager em, Entity e)
public static BrooklynTaskTags.WrappedStream tagForStream(java.lang.String streamType, java.io.ByteArrayOutputStream stream)
public static BrooklynTaskTags.WrappedStream tagForStreamSoft(java.lang.String streamType, java.io.ByteArrayOutputStream stream)
public static BrooklynTaskTags.WrappedStream tagForStream(java.lang.String streamType, com.google.common.base.Supplier<java.lang.String> contents, com.google.common.base.Supplier<java.lang.Integer> size)
public static BrooklynTaskTags.WrappedStream tagForEnvStream(java.lang.String streamEnv, java.util.Map<?,?> env)
public static java.util.Set<BrooklynTaskTags.WrappedStream> streams(Task<?> task)
public static BrooklynTaskTags.WrappedStream stream(Task<?> task, java.lang.String streamType)
public static void setInessential(Task<?> task)
public static void setTransient(Task<?> task)
public static boolean isTransient(Task<?> task)
public static boolean isSubTask(Task<?> task)
public static boolean isEffectorTask(Task<?> task)
public static BrooklynTaskTags.EffectorCallTag tagForEffectorCall(Entity entity, java.lang.String effectorName)
public static boolean isInEffectorTask(Task<?> task, @Nullable Entity entity, @Nullable Effector<?> effector, boolean allowNestedEffectorCalls)
task
- the task to check (false if null)entity
- the entity where this effector task should be running, or any entity if nulleffector
- the effector (matching name) where this task should be running, or any effector if nullallowNestedEffectorCalls
- whether to match ancestor effector calls, e.g. if eff1 calls eff2,
and we are checking eff2, whether to match eff1public static BrooklynTaskTags.EffectorCallTag getEffectorCallTag(Task<?> task, boolean recurse)
BrooklynTaskTags.EffectorCallTag
tag on this tag, or optionally on submitters, or nullpublic static java.lang.String getEffectorName(Task<?> task)
BrooklynTaskTags.EffectorCallTag
tag on this tag or a submitter, and returns the effector namepublic static EntitlementContext getEntitlement(Task<?> task)
public static EntitlementContext getEntitlement(java.util.Collection<?> tags)
public static EntitlementContext getEntitlement(BrooklynTaskTags.EntitlementTag tag)
public static BrooklynTaskTags.EntitlementTag tagForEntitlement(EntitlementContext context)