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 java.lang.String |
LOCATIONS_KEY |
static java.lang.String |
NO_VERSION |
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 |
addItem(CatalogItem<?,?> item)
Deprecated.
|
CatalogItem<?,?> |
addItem(java.lang.Class<?> type)
Deprecated.
|
CatalogItem<?,?> |
addItem(java.lang.String yaml)
Adds an item (represented in yaml) to the catalog.
|
CatalogItem<?,?> |
addItem(java.lang.String yaml,
boolean forceUpdate)
Adds an item (represented in yaml) to the catalog.
|
java.util.List<? extends CatalogItem<?,?>> |
addItems(java.lang.String yaml)
Adds items (represented in yaml) to the catalog.
|
java.util.List<? extends CatalogItem<?,?>> |
addItems(java.lang.String yaml,
boolean forceUpdate)
Adds items (represented in yaml) to the catalog.
|
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) |
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) |
<T,SpecT> java.lang.Iterable<CatalogItem<T,SpecT>> |
getCatalogItems() |
<T,SpecT> java.lang.Iterable<CatalogItem<T,SpecT>> |
getCatalogItems(com.google.common.base.Predicate<? super CatalogItem<T,SpecT>> filter)
convenience for filtering items in the catalog; see CatalogPredicates for useful filters
|
java.lang.ClassLoader |
getRootClassLoader() |
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.) |
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
|
java.lang.String |
toXmlString() |
public static final java.lang.String POLICIES_KEY
public static final java.lang.String LOCATIONS_KEY
public static final java.lang.String NO_VERSION
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()
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.public void deleteCatalogItem(java.lang.String symbolicName,
java.lang.String version)
deleteCatalogItem 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 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 CatalogItem<?,?> addItem(java.lang.String yaml)
BrooklynCatalogaddItem in interface BrooklynCatalogpublic java.util.List<? extends CatalogItem<?,?>> addItems(java.lang.String yaml)
BrooklynCatalogaddItems in interface BrooklynCatalogpublic CatalogItem<?,?> addItem(java.lang.String yaml, boolean forceUpdate)
BrooklynCatalogaddItem 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 forceUpdate)
BrooklynCatalogaddItems in interface BrooklynCatalogforceUpdate - If true allows catalog update even when an
item exists with the same symbolicName and version@Deprecated public void addItem(CatalogItem<?,?> item)
BrooklynCatalogaddItem 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 BrooklynCatalogpublic <T,SpecT> java.lang.Iterable<CatalogItem<T,SpecT>> getCatalogItems()
getCatalogItems in interface BrooklynCatalogpublic <T,SpecT> java.lang.Iterable<CatalogItem<T,SpecT>> getCatalogItems(com.google.common.base.Predicate<? super CatalogItem<T,SpecT>> filter)
BrooklynCataloggetCatalogItems in interface BrooklynCatalogpublic java.lang.String toXmlString()