Brooklyn

brooklyn.entity.basic
[Java] Class Entities

java.lang.Object
  brooklyn.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 void destroy(ManagementContext context, Entity e)

@deprecated since 0.4; use destroy(Entity)

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(Application app)

stops, destroys, and unmanages the given application -- and terminates the mangaement context; does as many as are valid given the type and state

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 Task invokeEffector(EntityLocal callingEntity, Entity entityToCall, Effector effector)

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)

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)

static boolean isSecret(java.lang.String name)

static boolean isTrivial(java.lang.Object v)

static boolean manage(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 DownloadResolver newDownloader(EntityDriver driver)

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 Entity start(ManagementContext context, Entity e, java.util.Collection locations)

@deprecated since 0.4; use start(Entity)

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)

Starts managing the given (unmanaged) app, setting the given brooklyn properties on the new management context.

static void unmanage(Entity entity)

 
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

attributeSupplier

public static Supplier attributeSupplier(Entity entity, AttributeSensor sensor)


destroy

public static void destroy(ManagementContext context, Entity e)
deprecated:
since 0.4; use destroy(Entity)


destroy

public static void destroy(Entity e)
stops, destroys, and unmanages the given entity -- does as many as are valid given the type and state


destroyAll

public static void destroyAll(Application app)
stops, destroys, and unmanages the given application -- and terminates the mangaement context; does as many as are valid given the type and state


dumpInfo

public static void dumpInfo(java.lang.Iterable entities)


dumpInfo

public static void dumpInfo(Entity e)


dumpInfo

public static void dumpInfo(Entity e, java.io.Writer out)


dumpInfo

public static void dumpInfo(Entity e, java.lang.String currentIndentation, java.lang.String tab)


dumpInfo

public static void dumpInfo(Entity e, java.io.Writer out, java.lang.String currentIndentation, java.lang.String tab)


dumpInfo

public static void dumpInfo(Location loc)


dumpInfo

public static void dumpInfo(Location loc, java.io.Writer out)


dumpInfo

public static void dumpInfo(Location loc, java.lang.String currentIndentation, java.lang.String tab)


dumpInfo

@SuppressWarnings("rawtypes")
public static void dumpInfo(Location loc, java.io.Writer out, java.lang.String currentIndentation, java.lang.String tab)


dumpInfo

public static void dumpInfo(Policy pol)


dumpInfo

public static void dumpInfo(Policy pol, java.io.Writer out)


dumpInfo

public static void dumpInfo(Policy pol, java.lang.String currentIndentation, java.lang.String tab)


dumpInfo

public static void dumpInfo(Policy pol, java.io.Writer out, java.lang.String currentIndentation, java.lang.String tab)


invokeEffector

public static Task invokeEffector(EntityLocal callingEntity, Entity entityToCall, Effector effector)


invokeEffectorList

public 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.

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.

Returns:
ParallelTask containing results from each invocation


invokeEffectorList

public static Task invokeEffectorList(EntityLocal callingEntity, java.lang.Iterable entitiesToCall, Effector effector)


invokeEffectorListWithArgs

@SuppressWarnings("unchecked")
public static Task invokeEffectorListWithArgs(EntityLocal callingEntity, java.lang.Iterable entitiesToCall, Effector effector, java.lang.Object... args)


invokeEffectorListWithMap

public static Task invokeEffectorListWithMap(EntityLocal callingEntity, java.lang.Iterable entitiesToCall, Effector effector, java.util.Map parameters)


invokeEffectorWithArgs

public static Task invokeEffectorWithArgs(EntityLocal callingEntity, Entity entityToCall, Effector effector, java.lang.Object... args)


invokeEffectorWithMap

public static Task invokeEffectorWithMap(EntityLocal callingEntity, Entity entityToCall, Effector effector, java.util.Map parameters)


invokeStopOnShutdown

public static void invokeStopOnShutdown(Entity entity)


isAncestor

public static boolean isAncestor(Entity descendant, Entity potentialAncestor)


isDescendant

public static boolean isDescendant(Entity ancestor, Entity potentialDescendant)
note, it is usually preferred to use isAncestor() and swap the order, it is a cheaper method


isManaged

public static boolean isManaged(Entity e)


isSecret

public static boolean isSecret(java.lang.String name)


isTrivial

public static boolean isTrivial(java.lang.Object v)


manage

public static boolean manage(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) )


newDownloader

public static DownloadResolver newDownloader(EntityDriver driver)


newManagementContext

public static ManagementContext newManagementContext()


newManagementContext

public static ManagementContext newManagementContext(BrooklynProperties props)


newManagementContext

public static ManagementContext newManagementContext(java.util.Map props)


sanitize

public static java.util.Map sanitize(java.util.Map input)


sortConfigKeys

@SuppressWarnings({ "rawtypes", "unchecked" })
public static java.util.List sortConfigKeys(java.util.Set configs)


sortMap

public static java.util.Map sortMap(java.util.Map map)


sortSensors

@SuppressWarnings({ "rawtypes", "unchecked" })
public static java.util.List sortSensors(java.util.Set sensors)


start

public static Entity start(ManagementContext context, Entity e, java.util.Collection locations)
deprecated:
since 0.4; use start(Entity)


start

public 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)


startManagement

public static ManagementContext startManagement(Entity e)
brings this entity under management, creating a local management context if necessary (assuming root is an application). returns existing management context if there is one (non-deployment), or new local mgmt context if not, or throwing exception if root is not an application

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!


startManagement

public static ManagementContext startManagement(Application app, ManagementContext mgmt)
Starts managing the given (unmanaged) app, using the given management context.
See Also:
startManagement(brooklyn.entity.Entity)


startManagement

public static ManagementContext startManagement(Application app, BrooklynProperties props)
Starts managing the given (unmanaged) app, setting the given brooklyn properties on the new management context.
See Also:
startManagement(brooklyn.entity.Entity)


unmanage

public static void unmanage(Entity entity)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.