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 |
NO_VERSION |
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> SpecT |
createSpec(CatalogItem<T,SpecT> item)
creates a spec for the given catalog item, throwing exceptions if any problems
|
void |
deleteCatalogItem(java.lang.String id)
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)
Deprecated.
|
<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)
Deprecated.
|
CatalogItem<?,?> |
getCatalogItem(java.lang.String symbolicName,
java.lang.String version) |
CatalogItem<?,?> |
getCatalogItemForType(java.lang.String typeName)
Deprecated.
|
<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() |
void |
load()
Loads this catalog.
|
<T,SpecT> java.lang.Class<? extends T> |
loadClass(CatalogItem<T,SpecT> item)
Deprecated.
|
<T> java.lang.Class<? extends T> |
loadClassByType(java.lang.String typeName,
java.lang.Class<T> typeClass)
Deprecated.
|
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 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 BrooklynCatalog
public CatalogDo getCatalog()
@Deprecated public CatalogItem<?,?> getCatalogItem(java.lang.String symbolicName)
getCatalogItem
in interface BrooklynCatalog
symbolicName
, or null if not found.public CatalogItem<?,?> getCatalogItem(java.lang.String symbolicName, java.lang.String version)
getCatalogItem
in interface BrooklynCatalog
symbolicName
, or null if not found.@Deprecated public void deleteCatalogItem(java.lang.String id)
deleteCatalogItem
in interface BrooklynCatalog
public void deleteCatalogItem(java.lang.String symbolicName, java.lang.String version)
deleteCatalogItem
in interface BrooklynCatalog
@Deprecated public <T,SpecT> CatalogItem<T,SpecT> getCatalogItem(java.lang.Class<T> type, java.lang.String id)
BrooklynCatalog
BrooklynCatalog.getCatalogItem(String, String)
which checks (and casts) type for convenience
(returns null if type does not match)getCatalogItem
in interface BrooklynCatalog
public <T,SpecT> CatalogItem<T,SpecT> getCatalogItem(java.lang.Class<T> type, java.lang.String id, java.lang.String version)
BrooklynCatalog
BrooklynCatalog.getCatalogItem(String, String)
which checks (and casts) type for convenience
(returns null if type does not match)getCatalogItem
in interface BrooklynCatalog
public void persist(CatalogItem<?,?> catalogItem)
BrooklynCatalog
persist
in interface BrooklynCatalog
public java.lang.ClassLoader getRootClassLoader()
getRootClassLoader
in interface BrooklynCatalog
public void load()
public <T,SpecT> SpecT createSpec(CatalogItem<T,SpecT> item)
BrooklynCatalog
createSpec
in interface BrooklynCatalog
@Deprecated public <T,SpecT> java.lang.Class<? extends T> loadClass(CatalogItem<T,SpecT> item)
BrooklynCatalog
loadClass
in interface BrooklynCatalog
@Deprecated public <T> java.lang.Class<? extends T> loadClassByType(java.lang.String typeName, java.lang.Class<T> typeClass)
loadClassByType
in interface BrooklynCatalog
public CatalogItem<?,?> addItem(java.lang.String yaml)
BrooklynCatalog
addItem
in interface BrooklynCatalog
public java.util.List<? extends CatalogItem<?,?>> addItems(java.lang.String yaml)
BrooklynCatalog
addItems
in interface BrooklynCatalog
public CatalogItem<?,?> addItem(java.lang.String yaml, boolean forceUpdate)
BrooklynCatalog
addItem
in interface BrooklynCatalog
forceUpdate
- 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)
BrooklynCatalog
addItems
in interface BrooklynCatalog
forceUpdate
- If true allows catalog update even when an
item exists with the same symbolicName and version@Deprecated public void addItem(CatalogItem<?,?> item)
BrooklynCatalog
addItem
in interface BrooklynCatalog
@Deprecated public CatalogItem<?,?> addItem(java.lang.Class<?> type)
BrooklynCatalog
Note 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
public <T,SpecT> java.lang.Iterable<CatalogItem<T,SpecT>> getCatalogItems()
getCatalogItems
in interface BrooklynCatalog
public <T,SpecT> java.lang.Iterable<CatalogItem<T,SpecT>> getCatalogItems(com.google.common.base.Predicate<? super CatalogItem<T,SpecT>> filter)
BrooklynCatalog
getCatalogItems
in interface BrooklynCatalog
public java.lang.String toXmlString()
@Deprecated public CatalogItem<?,?> getCatalogItemForType(java.lang.String typeName)
getCatalogItemForType
in interface BrooklynCatalog