public interface ManagementContext
It may refer to several applications, and it refers to all the entities descended from those applications.
Modifier and Type | Interface and Description |
---|---|
static interface |
ManagementContext.PropertiesReloadListener
Listener for
brooklyn.properties reload events. |
Modifier and Type | Method and Description |
---|---|
void |
addPropertiesReloadListener(ManagementContext.PropertiesReloadListener listener)
Registers a listener to be notified when brooklyn.properties is reloaded
|
AccessController |
getAccessController()
For controlling access to operations - can be queried to find if an operation is allowed.
|
java.util.Collection<Application> |
getApplications()
All applications under control of this management plane
|
BrooklynCatalog |
getCatalog()
Record of configured Brooklyn entities (and templates and policies) which can be loaded
|
java.lang.ClassLoader |
getCatalogClassLoader()
Returns the class loader to be used to load items.
|
StringConfigMap |
getConfig()
Returns the ConfigMap (e.g.
|
EntitlementManager |
getEntitlementManager()
Active entitlements checker instance.
|
DownloadResolverManager |
getEntityDownloadsManager()
Returns the
DownloadResolverManager for resolving things like which URL to download an installer from. |
EntityDriverManager |
getEntityDriverManager()
Returns the
EntityDriverManager entities can use to create drivers. |
EntityManager |
getEntityManager()
Returns the
EntityManager instance for managing/querying entities. |
ExecutionContext |
getExecutionContext(Entity entity)
Returns an
ExecutionContext instance representing tasks
(from the ExecutionManager ) associated with this entity, and capable
of conveniently running such tasks which will be associated with that entity |
ExecutionManager |
getExecutionManager()
Returns the
ExecutionManager instance for entities and users in this management realm
to submit tasks and to observe what tasks are occurring |
HighAvailabilityManager |
getHighAvailabilityManager() |
LocationManager |
getLocationManager() |
LocationRegistry |
getLocationRegistry()
Record of configured locations and location resolvers
|
java.lang.String |
getManagementNodeId()
UID for this
ManagementContext node (as part of a single management plane). |
Maybe<java.net.URI> |
getManagementNodeUri()
The URI that this management node's REST API is available at, or absent if the node's
API is unavailable.
|
java.lang.String |
getManagementPlaneId()
UID for the Brooklyn management plane which this
ManagementContext node is a part of. |
RebindManager |
getRebindManager() |
ExecutionContext |
getServerExecutionContext()
Returns an
ExecutionContext within the ExecutionManager for tasks
associated to the Brooklyn node's operation (not any entities). |
SubscriptionContext |
getSubscriptionContext(Entity entity)
Returns a
SubscriptionContext instance representing subscriptions
(from the SubscriptionManager ) associated with this entity, and capable
of conveniently subscribing on behalf of that entity |
SubscriptionManager |
getSubscriptionManager()
Returns the
SubscriptionManager instance for entities and users of this management realm
to subscribe to sensor events (and, in the case of entities, to emit sensor events) |
boolean |
isRunning()
Whether the management context has been initialized and not yet terminated.
|
boolean |
isStartupComplete()
Whether all startup tasks have completed.
|
BrooklynObject |
lookup(java.lang.String id)
As
lookup(String, Class) but not constraining the return type |
<T extends BrooklynObject> |
lookup(java.lang.String id,
java.lang.Class<T> type)
Finds an entity with the given ID known at this management context
|
void |
reloadBrooklynProperties()
Reloads locations from
brooklyn.properties . |
void |
removePropertiesReloadListener(ManagementContext.PropertiesReloadListener listener)
Deregisters a listener from brooklyn.properties reload notifications
|
java.lang.String getManagementPlaneId()
ManagementContext
node is a part of.
Each Brooklyn entity is actively managed by a unique management plane
whose ID which should not normally change for the duration of that entity,
even though the nodes in that plane might, and the plane may go down and come back up.
In other words the value of Application#getManagementContext()#getManagementPlaneId()
will generally be constant (in contrast to getManagementNodeId()
).
This value should not be null unless the management context is a non-functional (non-deployment) instance.
java.lang.String getManagementNodeId()
ManagementContext
node (as part of a single management plane).
No two instances of ManagementContext
should ever have the same node UID.
The value of Application#getManagementContext()#getManagementNodeId()
may
change many times (in contrast to getManagementPlaneId()
).
This value should not be null unless the management context is a non-functional (non-deployment) instance.
Maybe<java.net.URI> getManagementNodeUri()
java.util.Collection<Application> getApplications()
EntityManager getEntityManager()
EntityManager
instance for managing/querying entities.ExecutionManager getExecutionManager()
ExecutionManager
instance for entities and users in this management realm
to submit tasks and to observe what tasks are occurringExecutionContext getServerExecutionContext()
ExecutionContext
within the ExecutionManager
for tasks
associated to the Brooklyn node's operation (not any entities).EntityDriverManager getEntityDriverManager()
EntityDriverManager
entities can use to create drivers. This
manager can also be used to programmatically customize which driver type to use
for entities in different locations.
The default strategy for choosing a driver is to use a naming convention:
DriverDependentEntity.getDriverInterface()
returns the interface that the
driver must implement; its name should end in "Driver". For example, this suffix is
replaced with "SshDriver" for SshMachineLocation, for example.DownloadResolverManager getEntityDownloadsManager()
DownloadResolverManager
for resolving things like which URL to download an installer from.
The default DownloadResolverManager
will retrieve entity.getAttribute(Attributes.DOWNLOAD_URL)
,
and substitute things like "${version}" etc.
However, additional resolvers can be registered to customize this behaviour (e.g. to always go to an
enterprise's repository).SubscriptionManager getSubscriptionManager()
SubscriptionManager
instance for entities and users of this management realm
to subscribe to sensor events (and, in the case of entities, to emit sensor events)ExecutionContext getExecutionContext(Entity entity)
ExecutionContext
instance representing tasks
(from the ExecutionManager
) associated with this entity, and capable
of conveniently running such tasks which will be associated with that entitySubscriptionContext getSubscriptionContext(Entity entity)
SubscriptionContext
instance representing subscriptions
(from the SubscriptionManager
) associated with this entity, and capable
of conveniently subscribing on behalf of that entity@Beta RebindManager getRebindManager()
@Beta HighAvailabilityManager getHighAvailabilityManager()
StringConfigMap getConfig()
boolean isRunning()
isStartupComplete()
.@Beta boolean isStartupComplete()
isRunning()
returns true immediately after construction)
but some subsystems (e.g. persistence, OSGi, webapps, entities started at startup)
may not be available until this returns true.
Also see isStartupComplete()
.
LocationRegistry getLocationRegistry()
BrooklynCatalog getCatalog()
@Beta java.lang.ClassLoader getCatalogClassLoader()
LocationManager getLocationManager()
AccessController getAccessController()
AccessController
.void reloadBrooklynProperties()
brooklyn.properties
. Any changes will apply only to newly created applicationsvoid addPropertiesReloadListener(ManagementContext.PropertiesReloadListener listener)
void removePropertiesReloadListener(ManagementContext.PropertiesReloadListener listener)
EntitlementManager getEntitlementManager()
BrooklynObject lookup(java.lang.String id)
lookup(String, Class)
but not constraining the return type<T extends BrooklynObject> T lookup(java.lang.String id, java.lang.Class<T> type)