public class EntityManagementUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
EntityManagementUtils.CreationResult<T,U>
container for operation which creates something and which wants to return both
the items created and any pending create/start task
|
Modifier and Type | Field and Description |
---|---|
static ConfigKey<java.lang.Boolean> |
WRAPPER_APP_MARKER
A marker config value which indicates that an
Application entity was created automatically,
needed because a plan might give multiple top-level entities or a non-Application top-level entity,
but brooklyn requires an Application at the root. |
Constructor and Description |
---|
EntityManagementUtils() |
Modifier and Type | Method and Description |
---|---|
static EntityManagementUtils.CreationResult<java.util.List<Entity>,java.util.List<java.lang.String>> |
addChildren(EntityLocal parent,
java.lang.String yaml,
java.lang.Boolean start) |
static EntityManagementUtils.CreationResult<java.util.List<Entity>,java.util.List<java.lang.String>> |
addChildrenStarting(EntityLocal parent,
java.lang.String yaml) |
static java.util.List<Entity> |
addChildrenUnstarted(EntityLocal parent,
java.lang.String yaml)
adds entities from the given yaml, under the given parent; but does not start them
|
static boolean |
canPromoteChildrenInWrappedApplication(EntitySpec<?> spec)
returns true if the spec is for an empty-ish wrapper app,
for use when adding from a plan specifying multiple entities but nothing significant at the application level.
|
static boolean |
canPromoteWrappedApplication(EntitySpec<? extends Application> app)
returns true if the spec is for an empty-ish wrapper app contianing an application,
for use when adding from a plan specifying an application which was wrapped because it had to be.
|
static AbstractBrooklynObjectSpec<?,?> |
createCatalogSpec(ManagementContext mgmt,
CatalogItem<?,?> item) |
static EntitySpec<? extends Application> |
createEntitySpecForApplication(ManagementContext mgmt,
java.lang.String plan) |
static <T extends Application> |
createStarting(ManagementContext mgmt,
EntitySpec<T> appSpec) |
static EntityManagementUtils.CreationResult<? extends Application,java.lang.Void> |
createStarting(ManagementContext mgmt,
java.lang.String appSpec) |
static <T extends Application> |
createUnstarted(ManagementContext mgmt,
EntitySpec<T> spec)
creates an application from the given app spec, managed by the given management context
|
static Application |
createUnstarted(ManagementContext mgmt,
java.lang.String plan)
as
createUnstarted(ManagementContext, EntitySpec) but for a string plan (e.g. |
static boolean |
isWrapperApp(EntitySpec<?> spec) |
static void |
mergeWrapperParentSpecToChildEntity(EntitySpec<? extends Application> wrapperParent,
EntitySpec<?> wrappedChild)
Modifies the child so it includes the inessential setup of its parent,
for use when unwrapping specific children, but a name or other item may have been set on the parent.
|
static EntitySpec<? extends Application> |
newWrapperApp() |
static <T extends Application> |
start(T app) |
static EntitySpec<? extends Application> |
unwrapApplication(EntitySpec<? extends Application> wrapperApplication)
if an application should be unwrapped, it does so, returning the child; otherwise returns the argument passed in.
|
public static final ConfigKey<java.lang.Boolean> WRAPPER_APP_MARKER
Application
entity was created automatically,
needed because a plan might give multiple top-level entities or a non-Application top-level entity,
but brooklyn requires an Application
at the root.
Typically when such a wrapper app wraps another Application
(or when we are adding to an existing entity and it wraps multiple Entity
instances)
it will be unwrapped. See newWrapperApp()
and unwrapApplication(EntitySpec)
.
public static <T extends Application> T createUnstarted(ManagementContext mgmt, EntitySpec<T> spec)
public static Application createUnstarted(ManagementContext mgmt, java.lang.String plan)
createUnstarted(ManagementContext, EntitySpec)
but for a string plan (e.g. camp yaml)public static EntitySpec<? extends Application> createEntitySpecForApplication(ManagementContext mgmt, java.lang.String plan)
public static AbstractBrooklynObjectSpec<?,?> createCatalogSpec(ManagementContext mgmt, CatalogItem<?,?> item)
public static <T extends Application> EntityManagementUtils.CreationResult<T,java.lang.Void> createStarting(ManagementContext mgmt, EntitySpec<T> appSpec)
public static EntityManagementUtils.CreationResult<? extends Application,java.lang.Void> createStarting(ManagementContext mgmt, java.lang.String appSpec)
public static <T extends Application> EntityManagementUtils.CreationResult<T,java.lang.Void> start(T app)
public static EntityManagementUtils.CreationResult<java.util.List<Entity>,java.util.List<java.lang.String>> addChildren(EntityLocal parent, java.lang.String yaml, java.lang.Boolean start)
public static java.util.List<Entity> addChildrenUnstarted(EntityLocal parent, java.lang.String yaml)
public static EntityManagementUtils.CreationResult<java.util.List<Entity>,java.util.List<java.lang.String>> addChildrenStarting(EntityLocal parent, java.lang.String yaml)
public static EntitySpec<? extends Application> unwrapApplication(EntitySpec<? extends Application> wrapperApplication)
canPromoteWrappedApplication(EntitySpec)
to test whether it will unwrap.@Beta public static void mergeWrapperParentSpecToChildEntity(EntitySpec<? extends Application> wrapperParent, EntitySpec<?> wrappedChild)
WRAPPER_APP_MARKER
.public static EntitySpec<? extends Application> newWrapperApp()
public static boolean canPromoteWrappedApplication(EntitySpec<? extends Application> app)
WRAPPER_APP_MARKER
public static boolean canPromoteChildrenInWrappedApplication(EntitySpec<?> spec)
WRAPPER_APP_MARKER
public static boolean isWrapperApp(EntitySpec<?> spec)