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)
ManagementContextInjectable
ManagementContext
reference.setManagementContext
in interface ManagementContextInjectable
public java.lang.String getShortDescription()
PlanToSpecTransformer
getShortDescription
in interface PlanToSpecTransformer
public boolean accepts(java.lang.String planType)
PlanToSpecTransformer
accepts
in interface PlanToSpecTransformer
public EntitySpec<? extends Application> createApplicationSpec(java.lang.String plan) throws PlanNotRecognizedException
PlanToSpecTransformer
EntitySpec
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 PlanToSpecTransformer
PlanNotRecognizedException
public <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 PlanToSpecTransformer
item
- - 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 symbolicName
s of catalog items being resolved up the stack, but not including item
.PlanNotRecognizedException