public class BasicBrooklynCatalog extends java.lang.Object implements BrooklynCatalog
Modifier and Type | Class and Description |
---|---|
static class |
BasicBrooklynCatalog.BrooklynLoaderTracker |
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.
|
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) |
CatalogDo |
getCatalog() |
<T,SpecT> CatalogItem<T,SpecT> |
getCatalogItem(java.lang.Class<T> type,
java.lang.String id)
variant of
BrooklynCatalog.getCatalogItem(String) which checks (and casts) type for convenience
(returns null if type does not match) |
CatalogItem<?,?> |
getCatalogItem(java.lang.String idOrRegisteredTypeName) |
<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 |
reset(CatalogDto dto) |
void |
reset(java.util.Collection<CatalogItem<?,?>> entries)
Resets the catalog to the given entries
|
void |
resetCatalogToContentsAtConfiguredUrl() |
java.lang.String |
toXmlString() |
public BasicBrooklynCatalog(ManagementContext mgmt)
public BasicBrooklynCatalog(ManagementContext mgmt, CatalogDto dto)
public boolean blockIfNotLoaded(Duration timeout)
public void reset(CatalogDto dto)
public void reset(java.util.Collection<CatalogItem<?,?>> entries)
reset
in interface BrooklynCatalog
public CatalogDo getCatalog()
public CatalogItem<?,?> getCatalogItem(java.lang.String idOrRegisteredTypeName)
getCatalogItem
in interface BrooklynCatalog
registeredTypeName
, or null if not found.public void deleteCatalogItem(java.lang.String id)
deleteCatalogItem
in interface BrooklynCatalog
public <T,SpecT> CatalogItem<T,SpecT> getCatalogItem(java.lang.Class<T> type, java.lang.String id)
BrooklynCatalog
BrooklynCatalog.getCatalogItem(String)
which checks (and casts) type for convenience
(returns null if type does not match)getCatalogItem
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
@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()
public void resetCatalogToContentsAtConfiguredUrl()