public class JavaCatalogToSpecTransformer extends java.lang.Object implements PlanToSpecTransformer
This is used where a RegisteredType is defined simply with the name of a java class
(no YAML etc); and for legacy old-style (c0.7.0) catalog items (defined in catalog.xml only)
with structure, only a single type.
| Constructor and Description |
|---|
JavaCatalogToSpecTransformer() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accepts(java.lang.String planType)
whether this accepts the given plan type
|
EntitySpec<? extends Application> |
createApplicationSpec(java.lang.String plan)
creates an
EntitySpec given a complete plan textual description for a top-level application,
according to the transformation rules this understands. |
<T,SpecT extends AbstractBrooklynObjectSpec<? extends T,SpecT>> |
createCatalogSpec(CatalogItem<T,SpecT> item,
java.util.Set<java.lang.String> encounteredTypes)
creates an object spec given a catalog item.
|
java.lang.String |
getShortDescription()
A short, human-readable name for this transformer
|
void |
setManagementContext(ManagementContext mgmt)
Sets the
ManagementContext reference. |
public void setManagementContext(ManagementContext mgmt)
ManagementContextInjectableManagementContext reference.setManagementContext in interface ManagementContextInjectablepublic java.lang.String getShortDescription()
PlanToSpecTransformergetShortDescription in interface PlanToSpecTransformerpublic boolean accepts(java.lang.String planType)
PlanToSpecTransformeraccepts in interface PlanToSpecTransformerpublic EntitySpec<? extends Application> createApplicationSpec(java.lang.String plan) throws PlanNotRecognizedException
PlanToSpecTransformerEntitySpec given a complete plan textual description for a top-level application,
according to the transformation rules this understands.
should throw PlanNotRecognizedException if not supported.
createApplicationSpec in interface PlanToSpecTransformerPlanNotRecognizedExceptionpublic <T,SpecT extends AbstractBrooklynObjectSpec<? extends T,SpecT>> SpecT createCatalogSpec(CatalogItem<T,SpecT> item, java.util.Set<java.lang.String> encounteredTypes) throws PlanNotRecognizedException
PlanToSpecTransformer
the catalog item might be known by type, or its source plan fragment text might be inspected and transformed.
implementations will typically look at the CatalogItem.getCatalogItemType() first.
should throw PlanNotRecognizedException if this transformer does not know what to do with the plan.
createCatalogSpec in interface PlanToSpecTransformeritem - - The catalog item to convert to a spec. The item might not be fully populated (i.e. missing symbolicName if called
from the catalog parser).encounteredTypes - - The symbolicNames of catalog items being resolved up the stack, but not including item.PlanNotRecognizedException