public class LocalEntityManager extends java.lang.Object implements EntityManagerInternal
Constructor and Description |
---|
LocalEntityManager(LocalManagementContext managementContext) |
Modifier and Type | Method and Description |
---|---|
<T extends Enricher> |
createEnricher(EnricherSpec<T> spec)
Creates a new enricher (not managed; not associated with any entity).
|
<T extends Entity> |
createEntity(EntitySpec<T> spec)
Creates a new (unmanaged) entity.
|
<T extends Entity> |
createEntity(java.util.Map<?,?> config,
java.lang.Class<T> type)
Convenience (particularly for groovy code) to create an entity.
|
<T extends Policy> |
createPolicy(PolicySpec<T> spec)
Creates a new policy (not managed; not associated with any entity).
|
java.util.Collection<Entity> |
findEntities(com.google.common.base.Predicate<? super Entity> filter)
All entities under control of this management plane that match the given filter
|
java.util.Collection<Entity> |
findEntitiesInApplication(Application application,
com.google.common.base.Predicate<? super Entity> filter)
All entities managed as part of the given application that match the given filter
|
java.lang.Iterable<Entity> |
getAllEntitiesInApplication(Application application)
gets all entities currently known to the application, including entities that are not yet managed
|
java.util.Collection<Entity> |
getEntities()
All entities under control of this management plane
|
java.util.Collection<Entity> |
getEntitiesInApplication(Application application)
All entities managed as part of the given application
|
Entity |
getEntity(java.lang.String id)
Returns the entity with the given identifier (may be a full instance, or a proxy to one which is remote),
or null.
|
InternalEntityFactory |
getEntityFactory() |
java.util.Collection<java.lang.String> |
getEntityIds() |
EntityTypeRegistry |
getEntityTypeRegistry()
Returns the type registry, used to identify the entity implementation when instantiating an
entity of a given type.
|
ManagementTransitionMode |
getLastManagementTransitionMode(java.lang.String itemId) |
InternalPolicyFactory |
getPolicyFactory() |
boolean |
isKnownEntityId(java.lang.String id) |
boolean |
isManaged(Entity e)
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 |
manageRebindedRoot(Entity item)
Begins management for the given rebinded root, recursively;
if rebinding as a read-only copy,
#setReadOnly(T, boolean) should be called prior to this. |
void |
setManagementTransitionMode(Entity item,
ManagementTransitionMode mode) |
void |
stopTasks(Entity entity,
Duration timeout)
stops all tasks (apart from any current one or its descendants) on this entity,
optionally -- if a timeout is given -- waiting for completion and warning on incomplete tasks
|
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)
|
void |
unmanage(Entity e,
ManagementTransitionMode mode) |
public LocalEntityManager(LocalManagementContext managementContext)
public InternalEntityFactory getEntityFactory()
public InternalPolicyFactory getPolicyFactory()
public EntityTypeRegistry getEntityTypeRegistry()
EntityManager
getEntityTypeRegistry
in interface EntityManager
EntityManager.createEntity(EntitySpec)
public <T extends Entity> T createEntity(EntitySpec<T> spec)
EntityManager
createEntity
in interface EntityManager
public <T extends Entity> T createEntity(java.util.Map<?,?> config, java.lang.Class<T> type)
EntityManager
createEntity(EntitySpec.create(type).configure(config))
createEntity
in interface EntityManager
EntityManager.createEntity(EntitySpec)
public <T extends Policy> T createPolicy(PolicySpec<T> spec)
EntityManager
createPolicy
in interface EntityManager
public <T extends Enricher> T createEnricher(EnricherSpec<T> spec)
EntityManager
createEnricher
in interface EntityManager
public java.util.Collection<Entity> getEntities()
EntityManager
getEntities
in interface EntityManager
public java.util.Collection<java.lang.String> getEntityIds()
getEntityIds
in interface EntityManagerInternal
public java.util.Collection<Entity> getEntitiesInApplication(Application application)
EntityManager
getEntitiesInApplication
in interface EntityManager
public java.util.Collection<Entity> findEntities(com.google.common.base.Predicate<? super Entity> filter)
EntityManager
findEntities
in interface EntityManager
public java.util.Collection<Entity> findEntitiesInApplication(Application application, com.google.common.base.Predicate<? super Entity> filter)
EntityManager
findEntitiesInApplication
in interface EntityManager
public java.lang.Iterable<Entity> getAllEntitiesInApplication(Application application)
EntityManagerInternal
getAllEntitiesInApplication
in interface EntityManagerInternal
public Entity getEntity(java.lang.String id)
EntityManager
getEntity
in interface EntityManager
public boolean isManaged(Entity e)
EntityManager
isManaged
in interface EntityManager
public ManagementTransitionMode getLastManagementTransitionMode(java.lang.String itemId)
getLastManagementTransitionMode
in interface BrooklynObjectManagerInternal<Entity>
public void setManagementTransitionMode(Entity item, ManagementTransitionMode mode)
setManagementTransitionMode
in interface BrooklynObjectManagerInternal<Entity>
public void manage(Entity e)
EntityManager
manage
in interface EntityManager
public void manageRebindedRoot(Entity item)
BrooklynObjectManagerInternal
#setReadOnly(T, boolean)
should be called prior to this.manageRebindedRoot
in interface BrooklynObjectManagerInternal<Entity>
public void unmanage(Entity e)
EntityManager
unmanage
in interface EntityManager
public void unmanage(Entity e, ManagementTransitionMode mode)
unmanage
in interface BrooklynObjectManagerInternal<Entity>
@Beta public void stopTasks(Entity entity, @Nullable Duration timeout)
public boolean isKnownEntityId(java.lang.String id)