brooklyn.management
Interface EntityManager


public interface EntityManager

For managing and querying entities.


Method Summary
<T extends Entity>
T
createEntity(EntitySpec<T> spec)
          Creates a new (unmanaged) entity.
<T extends Entity>
T
createEntity(Map<?,?> config, Class<T> type)
          Convenience (particularly for groovy code) to create an entity.
 Collection<Entity> getEntities()
          All entities under control of this management plane
 Iterable<Entity> getEntitiesInApplication(Application application)
          All entities managed as part of the given application
 Entity getEntity(String id)
          Returns the entity with the given identifier (may be a full instance, or a proxy to one which is remote), or null.
 EntityTypeRegistry getEntityTypeRegistry()
          Returns the type registry, used to identify the entity implementation when instantiating an entity of a given type.
 boolean isManaged(Entity entity)
          whether the entity is under management by this management context
 void manage(Entity e)
          Begins management for the given entity and its children, recursively.
 void unmanage(Entity e)
          Causes the given entity and its children, recursively, to be removed from the management plane (for instance because the entity is no longer relevant)
 

Method Detail

getEntityTypeRegistry

EntityTypeRegistry getEntityTypeRegistry()
Returns the type registry, used to identify the entity implementation when instantiating an entity of a given type.

See Also:
EntityManager.createEntity(EntitySpec)

createEntity

<T extends Entity> T createEntity(EntitySpec<T> spec)
Creates a new (unmanaged) entity.

Parameters:
spec -
Returns:
A proxy to the created entity (rather than the actual entity itself).

createEntity

<T extends Entity> T createEntity(Map<?,?> config,
                                  Class<T> type)
Convenience (particularly for groovy code) to create an entity. Equivalent to createEntity(EntitySpec.create(type).configure(config))

See Also:
createEntity(EntitySpec)

getEntities

Collection<Entity> getEntities()
All entities under control of this management plane


getEntitiesInApplication

Iterable<Entity> getEntitiesInApplication(Application application)
All entities managed as part of the given application


getEntity

@Nullable
Entity getEntity(String id)
Returns the entity with the given identifier (may be a full instance, or a proxy to one which is remote), or null.


isManaged

boolean isManaged(Entity entity)
whether the entity is under management by this management context


manage

void manage(Entity e)
Begins management for the given entity and its children, recursively. depending on the implementation of the management context, this might push it out to one or more remote management nodes. Manage an entity.


unmanage

void unmanage(Entity e)
Causes the given entity and its children, recursively, to be removed from the management plane (for instance because the entity is no longer relevant)



Copyright © 2013. All Rights Reserved.