|
Brooklyn | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrooklyn.entity.basic.Entities
public class Entities
Convenience methods for working with entities.
Also see the various *Methods classes for traits, such as StartableMethods for Startable implementations.
Method Summary | |
---|---|
static Supplier
|
attributeSupplier(Entity entity, AttributeSensor sensor)
|
static Supplier
|
attributeSupplier(EntityAndAttribute tuple)
|
static Supplier
|
attributeSupplierWhenReady(EntityAndAttribute tuple)
|
static Supplier
|
attributeSupplierWhenReady(Entity entity, AttributeSensor sensor)
|
static void
|
destroy(Entity e)
stops, destroys, and unmanages the given entity -- does as many as are valid given the type and state |
static void
|
destroyAll(ManagementContext mgmt)
stops, destroys, and unmanages all apps in the given context, and then terminates the management context |
static void
|
destroyAll(Application app)
|
static void
|
destroyAllCatching(ManagementContext mgmt)
as destroyAll(ManagementContext) but catching all errors |
static void
|
destroyCatching(Entity entity)
as destroy(Entity) but catching all errors |
static void
|
dumpInfo(java.lang.Iterable entities)
|
static void
|
dumpInfo(Entity e)
|
static void
|
dumpInfo(Entity e, java.io.Writer out)
|
static void
|
dumpInfo(Entity e, java.lang.String currentIndentation, java.lang.String tab)
|
static void
|
dumpInfo(Entity e, java.io.Writer out, java.lang.String currentIndentation, java.lang.String tab)
|
static void
|
dumpInfo(Location loc)
|
static void
|
dumpInfo(Location loc, java.io.Writer out)
|
static void
|
dumpInfo(Location loc, java.lang.String currentIndentation, java.lang.String tab)
|
static void
|
dumpInfo(Location loc, java.io.Writer out, java.lang.String currentIndentation, java.lang.String tab)
|
static void
|
dumpInfo(Policy pol)
|
static void
|
dumpInfo(Policy pol, java.io.Writer out)
|
static void
|
dumpInfo(Policy pol, java.lang.String currentIndentation, java.lang.String tab)
|
static void
|
dumpInfo(Policy pol, java.io.Writer out, java.lang.String currentIndentation, java.lang.String tab)
|
static java.lang.String
|
getRequiredUrlConfig(Entity entity, ConfigKey urlKey)
|
static java.lang.String
|
getRequiredUrlConfig(Entity entity, HasConfigKey urlKey)
|
static Task
|
invokeEffector(EntityLocal callingEntity, Entity entityToCall, Effector effector, java.util.Map parameters)
|
static Task
|
invokeEffector(EntityLocal callingEntity, Entity entityToCall, Effector effector)
|
static Task
|
invokeEffector(EntityLocal callingEntity, java.lang.Iterable entitiesToCall, Effector effector, java.util.Map parameters)
convenience - invokes in parallel if multiple, but otherwise invokes the item directly |
static Task
|
invokeEffector(EntityLocal callingEntity, java.lang.Iterable entitiesToCall, Effector effector)
convenience - invokes in parallel if multiple, but otherwise invokes the item directly |
static Task
|
invokeEffectorList(EntityLocal callingEntity, java.lang.Iterable entitiesToCall, Effector effector, java.util.Map parameters)
Invokes an Effector on multiple entities, with the named arguments from the parameters java.util.Map using the context of the provided Entity. |
static Task
|
invokeEffectorList(EntityLocal callingEntity, java.lang.Iterable entitiesToCall, Effector effector)
|
static Task
|
invokeEffectorListWithArgs(EntityLocal callingEntity, java.lang.Iterable entitiesToCall, Effector effector, java.lang.Object... args)
|
static Task
|
invokeEffectorListWithMap(EntityLocal callingEntity, java.lang.Iterable entitiesToCall, Effector effector, java.util.Map parameters)
|
static Task
|
invokeEffectorWithArgs(EntityLocal callingEntity, Entity entityToCall, Effector effector, java.lang.Object... args)
|
static Task
|
invokeEffectorWithMap(EntityLocal callingEntity, Entity entityToCall, Effector effector, java.util.Map parameters)
@deprecated since 0.6.0 use invokeEffector |
static void
|
invokeStopOnShutdown(Entity entity)
|
static boolean
|
isAncestor(Entity descendant, Entity potentialAncestor)
|
static boolean
|
isDescendant(Entity ancestor, Entity potentialDescendant)
note, it is usually preferred to use isAncestor() and swap the order, it is a cheaper method |
static boolean
|
isManaged(Entity e)
brings this entity under management iff its ancestor is managed, returns true in that case; otherwise returns false in the expectation that the ancestor will become managed, or throws exception if it has no parent or a non-application root (will throw if e is an Application; see also startManagement(Entity) ) |
static boolean
|
isSecret(java.lang.String name)
|
static boolean
|
isTrivial(java.lang.Object v)
|
static boolean
|
manage(Entity e)
|
static void
|
manage(Location loc, ManagementContext managementContext)
Registers the given location (and all its children) with the management context. |
static DownloadResolver
|
newDownloader(EntityDriver driver)
|
static DownloadResolver
|
newDownloader(EntityDriver driver, java.util.Map properties)
|
static ManagementContext
|
newManagementContext()
|
static ManagementContext
|
newManagementContext(BrooklynProperties props)
|
static ManagementContext
|
newManagementContext(java.util.Map props)
|
static java.util.Map
|
sanitize(java.util.Map input)
|
static java.util.List
|
sortConfigKeys(java.util.Set configs)
|
static java.util.Map
|
sortMap(java.util.Map map)
|
static java.util.List
|
sortSensors(java.util.Set sensors)
|
static void
|
start(Entity e, java.util.Collection locations)
convenience for starting an entity, esp a new Startable instance which has been created dynamically (after the application is started) |
static ManagementContext
|
startManagement(Entity e)
brings this entity under management, creating a local management context if necessary (assuming root is an application). |
static ManagementContext
|
startManagement(Application app, ManagementContext mgmt)
Starts managing the given (unmanaged) app, using the given management context. |
static ManagementContext
|
startManagement(Application app, BrooklynProperties props)
|
static java.lang.Object
|
submit(Entity entity, TaskFactory taskFactory)
|
static java.lang.Object
|
submit(Entity entity, java.lang.Object task)
submits a task to run at the entity |
static void
|
unmanage(Entity entity)
|
static void
|
warnOnIgnoringConfig(Entity entity, ConfigKey key)
|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Method Detail |
---|
public static Supplier attributeSupplier(Entity entity, AttributeSensor sensor)
public static Supplier attributeSupplier(EntityAndAttribute tuple)
public static Supplier attributeSupplierWhenReady(EntityAndAttribute tuple)
} public static Supplier attributeSupplierWhenReady(Entity entity, AttributeSensor sensor)
public static void destroy(Entity e)
public static void destroyAll(ManagementContext mgmt)
public static boolean isManaged(Entity e) { public static void destroyAll(Application app)
public static void destroyAllCatching(ManagementContext mgmt)
public static void destroyCatching(Entity entity)
public static void dumpInfo(java.lang.Iterable entities)
public static void dumpInfo(Entity e)
public static void dumpInfo(Entity e, java.io.Writer out)
public static void dumpInfo(Entity e, java.lang.String currentIndentation, java.lang.String tab)
public static void dumpInfo(Entity e, java.io.Writer out, java.lang.String currentIndentation, java.lang.String tab)
public static void dumpInfo(Location loc)
public static void dumpInfo(Location loc, java.io.Writer out)
public static void dumpInfo(Location loc, java.lang.String currentIndentation, java.lang.String tab)
keyO instanceof HasConfigKey ? ((HasConfigKey)keyO).getConfigKey().getName() : public static void dumpInfo(Location loc, java.io.Writer out, java.lang.String currentIndentation, java.lang.String tab)
public static void dumpInfo(Policy pol)
public static void dumpInfo(Policy pol, java.io.Writer out)
public static void dumpInfo(Policy pol, java.lang.String currentIndentation, java.lang.String tab)
public static void dumpInfo(Policy pol, java.io.Writer out, java.lang.String currentIndentation, java.lang.String tab)
public static java.lang.String getRequiredUrlConfig(Entity entity, ConfigKey urlKey)
public static java.lang.String getRequiredUrlConfig(Entity entity, HasConfigKey urlKey)
public static Task invokeEffector(EntityLocal callingEntity, Entity entityToCall, Effector effector, java.util.Map parameters)
public static Task invokeEffector(EntityLocal callingEntity, Entity entityToCall, Effector effector)
public static Task invokeEffector(EntityLocal callingEntity, java.lang.Iterable entitiesToCall, Effector effector, java.util.Map parameters)
public static Task invokeEffector(EntityLocal callingEntity, java.lang.Iterable entitiesToCall, Effector effector)
public static Task invokeEffectorList(EntityLocal callingEntity, java.lang.Iterable entitiesToCall, Effector effector, java.util.Map parameters)
Intended for use only from the callingEntity.
Returns a ParallelTask containing the results from each tasks invocation. Calling java.util.concurrent.Future#get() get() on this will block until all tasks are complete, and will throw an exception if any task resulted in an error.
public static Task invokeEffectorList(EntityLocal callingEntity, java.lang.Iterable entitiesToCall, Effector effector)
final Effectoreffector, Object ...args) { public static Task invokeEffectorListWithArgs(EntityLocal callingEntity, java.lang.Iterable entitiesToCall, Effector effector, java.lang.Object... args)
public static Task invokeEffectorListWithMap(EntityLocal callingEntity, java.lang.Iterable entitiesToCall, Effector effector, java.util.Map parameters)
} public static Task invokeEffectorWithArgs(EntityLocal callingEntity, Entity entityToCall, Effector effector, java.lang.Object... args)
ableList.of(entityToCall), effector, parameters); public static Task invokeEffectorWithMap(EntityLocal callingEntity, Entity entityToCall, Effector effector, java.util.Map parameters)
public static void invokeStopOnShutdown(Entity entity)
public static boolean isAncestor(Entity descendant, Entity potentialAncestor)
public static boolean isDescendant(Entity ancestor, Entity potentialDescendant)
public static boolean isManaged(Entity e)
public static boolean isSecret(java.lang.String name)
public static boolean isTrivial(java.lang.Object v)
public static boolean manage(Entity e)
public static void manage(Location loc, ManagementContext managementContext)
public static DownloadResolver newDownloader(EntityDriver driver)
public static DownloadResolver newDownloader(EntityDriver driver, java.util.Map properties)
public static ManagementContext newManagementContext()
public static ManagementContext newManagementContext(BrooklynProperties props)
public static ManagementContext newManagementContext(java.util.Map props)
public static java.util.Map sanitize(java.util.Map input)
}); public static java.util.List sortConfigKeys(java.util.Set configs)
public static java.util.Map sortMap(java.util.Map map)
}); public static java.util.List sortSensors(java.util.Set sensors)
public static void start(Entity e, java.util.Collection locations)
public static ManagementContext startManagement(Entity e)
callers are recommended to use manage(Entity) instead unless they know a plain-vanilla non-root management context is sufficient (e.g. in tests)
this method may change, but is provided as a stop-gap to prevent ad-hoc things being done in the code which are even more likely to break!
public static ManagementContext startManagement(Application app, ManagementContext mgmt)
public static ManagementContext startManagement(Application app, BrooklynProperties props)
public static java.lang.Object submit(Entity entity, TaskFactory taskFactory)
public static java.lang.Object submit(Entity entity, java.lang.Object task)
public static void unmanage(Entity entity)
public static void warnOnIgnoringConfig(Entity entity, ConfigKey key)
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.