public class BasicBrooklynCatalog extends java.lang.Object implements BrooklynCatalog
| Modifier and Type | Class and Description |
|---|---|
static class |
BasicBrooklynCatalog.BrooklynLoaderTracker |
| Modifier and Type | Field and Description |
|---|---|
static boolean |
AUTO_WRAP_CATALOG_YAML_AS_BUNDLE |
static java.lang.String |
BROOKLYN_WRAPPED_BOM_BUNDLE
Header on bundle indicating it is a wrapped BOM with no other resources
|
static java.lang.String |
CATALOG_BOM |
static java.lang.String |
ENRICHERS_KEY |
static java.lang.String |
LOCATIONS_KEY |
static java.lang.String |
NO_VERSION |
static java.lang.String |
OSGI_MANIFEST_VERSION_VALUE |
static java.lang.String |
POLICIES_KEY |
DEFAULT_VERSION| Constructor and Description |
|---|
BasicBrooklynCatalog(ManagementContext mgmt) |
BasicBrooklynCatalog(ManagementContext mgmt,
CatalogDto dto) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCatalogLegacyItemsOnRebind(java.lang.Iterable<? extends CatalogItem<?,?>> items)
Deprecated.
|
void |
addItem(CatalogItem<?,?> item)
Deprecated.
|
CatalogItem<?,?> |
addItem(java.lang.Class<?> type)
Deprecated.
|
java.util.List<? extends CatalogItem<?,?>> |
addItems(java.lang.String yaml)
As
#addItemsFromBundle(String, ManagedBundle) with a null bundle. |
java.util.List<? extends CatalogItem<?,?>> |
addItems(java.lang.String yaml,
boolean forceUpdate)
Deprecated.
since 1.0.0 use
addItems(String) or addItems(String, boolean, boolean) |
java.util.List<? extends CatalogItem<?,?>> |
addItems(java.lang.String yaml,
boolean validate,
boolean forceUpdate)
Adds items (represented in yaml) to the catalog.
|
java.util.List<? extends CatalogItem<?,?>> |
addItems(java.lang.String yaml,
ManagedBundle bundle)
Adds items (represented in yaml) to the catalog coming from the indicated managed bundle.
|
java.util.List<? extends CatalogItem<?,?>> |
addItems(java.lang.String yaml,
ManagedBundle bundle,
boolean forceUpdate)
As
BrooklynCatalog.addItems(String, ManagedBundle) but exposing forcing option as per #addItem(String, boolean). |
OsgiBundleInstallationResult |
addItemsBundleResult(java.lang.String yaml,
boolean forceUpdate)
Like
addItems(String, boolean) but returning the OsgiBundleInstallationResult for use from new environments. |
void |
addTypesFromBundleBom(java.lang.String yaml,
ManagedBundle bundle,
boolean forceUpdate,
java.util.Map<RegisteredType,RegisteredType> result)
Adds the given registered types defined in a bundle's catalog BOM;
no validation performed, so caller should do that subsequently after
loading all potential inter-dependent types.
|
boolean |
blockIfNotLoaded(Duration timeout) |
<T,SpecT extends AbstractBrooklynObjectSpec<? extends T,SpecT>> |
createSpec(CatalogItem<T,SpecT> item)
Deprecated.
|
void |
deleteCatalogItem(java.lang.String symbolicName,
java.lang.String version)
Deprecated.
|
void |
deleteCatalogItem(java.lang.String symbolicName,
java.lang.String version,
boolean alsoCheckTypeRegistry,
boolean failIfNotFound)
Deprecated.
|
CatalogDo |
getCatalog() |
<T,SpecT> CatalogItem<T,SpecT> |
getCatalogItem(java.lang.Class<T> type,
java.lang.String id,
java.lang.String version)
variant of
BrooklynCatalog.getCatalogItem(String, String) which checks (and casts) type for convenience
(returns null if type does not match) |
CatalogItem<?,?> |
getCatalogItem(java.lang.String symbolicName,
java.lang.String version)
Deprecated.
|
<T,SpecT> CatalogItem<T,SpecT> |
getCatalogItemLegacy(java.lang.Class<T> type,
java.lang.String id,
java.lang.String version)
As non-legacy method but only looking in legacy catalog
|
CatalogItem<?,?> |
getCatalogItemLegacy(java.lang.String symbolicName,
java.lang.String version)
Deprecated.
|
<T,SpecT> java.lang.Iterable<CatalogItem<T,SpecT>> |
getCatalogItems()
Deprecated.
|
<T,SpecT> java.lang.Iterable<CatalogItem<T,SpecT>> |
getCatalogItems(<any> filter)
Deprecated.
|
<T,SpecT> java.lang.Iterable<CatalogItem<T,SpecT>> |
getCatalogItemsLegacy()
Deprecated.
|
<T,SpecT> java.lang.Iterable<CatalogItem<T,SpecT>> |
getCatalogItemsLegacy(<any> filter)
Deprecated.
|
static java.util.Map<?,?> |
getCatalogMetadata(java.lang.String yaml) |
java.lang.ClassLoader |
getRootClassLoader() |
static VersionedName |
getVersionedName(java.util.Map<?,?> catalogMetadata)
Deprecated.
since 0.12.0 - use
getVersionedName(Map, boolean) |
static VersionedName |
getVersionedName(java.util.Map<?,?> catalogMetadata,
boolean required) |
static <T,SpecT extends AbstractBrooklynObjectSpec<? extends T,SpecT>> |
internalCreateSpecLegacy(ManagementContext mgmt,
CatalogItem<T,SpecT> item,
java.util.Set<java.lang.String> encounteredTypes,
boolean includeDeprecatedTransformers)
Deprecated.
since introduction in 0.9.0, only used for backwards compatibility, can be removed any time;
uses the type-creation info on the item.
deprecated transformers must be included by routines which don't use
BrooklynTypePlanTransformer instances;
otherwise deprecated transformers should be excluded. (deprecation is taken as equivalent to having a new-style transformer.) |
static boolean |
isNoBundleOrSimpleWrappingBundle(ManagementContext mgmt,
ManagedBundle b) |
static boolean |
isWrapperBundle(org.osgi.framework.Bundle b) |
void |
load()
Loads this catalog.
|
AbstractBrooklynObjectSpec<?,?> |
peekSpec(CatalogItem<?,?> item)
Creates a spec for the given catalog item, throwing exceptions if any problems.
|
void |
persist(CatalogItem<?,?> catalogItem)
persists the catalog item to the object store, if persistence is enabled
|
void |
reset(CatalogDto dto) |
void |
reset(CatalogDto dto,
boolean failOnLoadError) |
void |
reset(java.util.Collection<CatalogItem<?,?>> entries)
Resets the catalog to the given entries
|
ReferenceWithError<RegisteredType> |
resolve(RegisteredType typeToValidate,
RegisteredTypeLoadingContext constraint)
Resolves the given object with respect to the catalog.
|
void |
uninstallEmptyWrapperBundles() |
java.util.Collection<java.lang.Throwable> |
validateType(RegisteredType typeToValidate,
RegisteredTypeLoadingContext constraint)
Performs YAML validation on the given type, returning a collection of errors.
|
java.util.Map<RegisteredType,java.util.Collection<java.lang.Throwable>> |
validateTypes(java.lang.Iterable<RegisteredType> typesToValidate)
As
#validateType(RegisteredType) but taking a set of types, returning a map whose keys are
those types where validation failed, mapped to the collection of errors validating that type. |
public static final java.lang.String POLICIES_KEY
public static final java.lang.String ENRICHERS_KEY
public static final java.lang.String LOCATIONS_KEY
public static final java.lang.String NO_VERSION
public static final java.lang.String CATALOG_BOM
public static final java.lang.String OSGI_MANIFEST_VERSION_VALUE
public static final java.lang.String BROOKLYN_WRAPPED_BOM_BUNDLE
public static final boolean AUTO_WRAP_CATALOG_YAML_AS_BUNDLE
public BasicBrooklynCatalog(ManagementContext mgmt)
public BasicBrooklynCatalog(ManagementContext mgmt, CatalogDto dto)
public boolean blockIfNotLoaded(Duration timeout)
public void reset(CatalogDto dto)
public void reset(CatalogDto dto, boolean failOnLoadError)
public void reset(java.util.Collection<CatalogItem<?,?>> entries)
reset in interface BrooklynCatalogpublic CatalogDo getCatalog()
@Deprecated public CatalogItem<?,?> getCatalogItem(java.lang.String symbolicName, java.lang.String version)
getCatalogItem in interface BrooklynCatalogsymbolicName
and optionally CatalogItem.getVersion(),
taking the best version if the version is BrooklynCatalog.DEFAULT_VERSION or null,
returning null if no matches are found.@Deprecated public CatalogItem<?,?> getCatalogItemLegacy(java.lang.String symbolicName, java.lang.String version)
BrooklynCatalogBrooklynCatalog.getCatalogItem(String, String) but only looking in legacy cataloggetCatalogItemLegacy in interface BrooklynCatalog@Deprecated
public void deleteCatalogItem(java.lang.String symbolicName,
java.lang.String version)
deleteCatalogItem in interface BrooklynCatalog@Deprecated
public void deleteCatalogItem(java.lang.String symbolicName,
java.lang.String version,
boolean alsoCheckTypeRegistry,
boolean failIfNotFound)
BrooklynCatalogsymbolicName and versiondeleteCatalogItem in interface BrooklynCatalogpublic <T,SpecT> CatalogItem<T,SpecT> getCatalogItem(java.lang.Class<T> type, java.lang.String id, java.lang.String version)
BrooklynCatalogBrooklynCatalog.getCatalogItem(String, String) which checks (and casts) type for convenience
(returns null if type does not match)getCatalogItem in interface BrooklynCatalogpublic <T,SpecT> CatalogItem<T,SpecT> getCatalogItemLegacy(java.lang.Class<T> type, java.lang.String id, java.lang.String version)
BrooklynCataloggetCatalogItemLegacy in interface BrooklynCatalogpublic void persist(CatalogItem<?,?> catalogItem)
BrooklynCatalogpersist in interface BrooklynCatalogpublic java.lang.ClassLoader getRootClassLoader()
getRootClassLoader in interface BrooklynCatalogpublic void load()
public AbstractBrooklynObjectSpec<?,?> peekSpec(CatalogItem<?,?> item)
BrooklynCatalogEntityManagementUtils.createEntitySpecForApplication(ManagementContext mgmt, String plan)
for how apps are deployed.peekSpec in interface BrooklynCatalog@Deprecated public <T,SpecT extends AbstractBrooklynObjectSpec<? extends T,SpecT>> SpecT createSpec(CatalogItem<T,SpecT> item)
BrooklynCatalogcreateSpec in interface BrooklynCatalog@Deprecated public static <T,SpecT extends AbstractBrooklynObjectSpec<? extends T,SpecT>> SpecT internalCreateSpecLegacy(ManagementContext mgmt, CatalogItem<T,SpecT> item, java.util.Set<java.lang.String> encounteredTypes, boolean includeDeprecatedTransformers)
BrooklynTypePlanTransformer instances;
otherwise deprecated transformers should be excluded. (deprecation is taken as equivalent to having a new-style transformer.)public static java.util.Map<?,?> getCatalogMetadata(java.lang.String yaml)
@Deprecated public static VersionedName getVersionedName(java.util.Map<?,?> catalogMetadata)
getVersionedName(Map, boolean)public static VersionedName getVersionedName(java.util.Map<?,?> catalogMetadata, boolean required)
public static boolean isNoBundleOrSimpleWrappingBundle(ManagementContext mgmt, ManagedBundle b)
public static boolean isWrapperBundle(org.osgi.framework.Bundle b)
public java.util.List<? extends CatalogItem<?,?>> addItems(java.lang.String yaml)
BrooklynCatalog#addItemsFromBundle(String, ManagedBundle) with a null bundle.
(Only used for legacy-mode additions.)addItems in interface BrooklynCatalog@Deprecated public java.util.List<? extends CatalogItem<?,?>> addItems(java.lang.String yaml, boolean forceUpdate)
addItems(String) or addItems(String, boolean, boolean)BrooklynCatalogaddItems in interface BrooklynCatalogforceUpdate - If true allows catalog update even when an
item exists with the same symbolicName and versionpublic java.util.List<? extends CatalogItem<?,?>> addItems(java.lang.String yaml, boolean validate, boolean forceUpdate)
BrooklynCatalogaddItems in interface BrooklynCatalogvalidate - Whether to validate the types (default true)forceUpdate - If true allows catalog update even when an
item exists with the same symbolicName and versionpublic OsgiBundleInstallationResult addItemsBundleResult(java.lang.String yaml, boolean forceUpdate)
addItems(String, boolean) but returning the OsgiBundleInstallationResult for use from new environments.
If not using OSGi the bundle/code/etc fields are null but the types will always be set.public java.util.List<? extends CatalogItem<?,?>> addItems(java.lang.String yaml, ManagedBundle bundle)
BrooklynCatalogaddItems in interface BrooklynCatalogpublic java.util.List<? extends CatalogItem<?,?>> addItems(java.lang.String yaml, ManagedBundle bundle, boolean forceUpdate)
BrooklynCatalogBrooklynCatalog.addItems(String, ManagedBundle) but exposing forcing option as per #addItem(String, boolean).
(Only used for legacy-mode additions.)addItems in interface BrooklynCatalogpublic void addTypesFromBundleBom(java.lang.String yaml,
ManagedBundle bundle,
boolean forceUpdate,
java.util.Map<RegisteredType,RegisteredType> result)
BrooklynCatalogaddTypesFromBundleBom in interface BrooklynCatalogpublic java.util.Map<RegisteredType,java.util.Collection<java.lang.Throwable>> validateTypes(java.lang.Iterable<RegisteredType> typesToValidate)
BrooklynCatalog#validateType(RegisteredType) but taking a set of types, returning a map whose keys are
those types where validation failed, mapped to the collection of errors validating that type.
An empty map result indicates no validation errors in the types passed in.validateTypes in interface BrooklynCatalogpublic java.util.Collection<java.lang.Throwable> validateType(RegisteredType typeToValidate, RegisteredTypeLoadingContext constraint)
BrooklynCatalogValidation may be side-effecting in that it sets metadata and refines supertypes for the given registered type.
validateType in interface BrooklynCatalogpublic ReferenceWithError<RegisteredType> resolve(RegisteredType typeToValidate, RegisteredTypeLoadingContext constraint)
@Deprecated public void addItem(CatalogItem<?,?> item)
BrooklynCatalogaddItem in interface BrooklynCatalog@Deprecated public void addCatalogLegacyItemsOnRebind(java.lang.Iterable<? extends CatalogItem<?,?>> items)
BrooklynCatalogBrooklynCatalog.reset(Collection) but where it
just adds without removing the existing content. Note this is very different from
BrooklynCatalog.addItem(CatalogItem), which adds to the 'manual' catalog.addCatalogLegacyItemsOnRebind in interface BrooklynCatalog@Deprecated public CatalogItem<?,?> addItem(java.lang.Class<?> type)
BrooklynCatalogNote that the class will be available for this session only, although the record of the item will appear in the catalog DTO if exported, so it is recommended to edit the 'manual' catalog DTO if using it to generate a catalog, either adding the appropriate classpath URL or removing this entry.
addItem in interface BrooklynCatalog@Deprecated public <T,SpecT> java.lang.Iterable<CatalogItem<T,SpecT>> getCatalogItems()
getCatalogItems in interface BrooklynCatalog@Deprecated public <T,SpecT> java.lang.Iterable<CatalogItem<T,SpecT>> getCatalogItemsLegacy()
BrooklynCataloggetCatalogItemsLegacy in interface BrooklynCatalog@Deprecated public <T,SpecT> java.lang.Iterable<CatalogItem<T,SpecT>> getCatalogItems(<any> filter)
BrooklynCataloggetCatalogItems in interface BrooklynCatalog@Deprecated public <T,SpecT> java.lang.Iterable<CatalogItem<T,SpecT>> getCatalogItemsLegacy(<any> filter)
BrooklynCataloggetCatalogItemsLegacy in interface BrooklynCatalogpublic void uninstallEmptyWrapperBundles()