@Metadata(label="configuration") public class RouteTemplateDefinition extends OptionalIdentifiedDefinition
Modifier and Type | Class and Description |
---|---|
static interface |
RouteTemplateDefinition.Converter |
Constructor and Description |
---|
RouteTemplateDefinition() |
Modifier and Type | Method and Description |
---|---|
RouteDefinition |
asRouteDefinition()
Creates a copy of this template as a
RouteDefinition which can be used to add as a new route. |
RouteTemplateDefinition |
configure(Consumer<org.apache.camel.RouteTemplateContext> configurer)
Sets a configurer which allows to do configuration while the route template is being used to create a route.
|
RouteTemplateDefinition |
description(String text)
Sets the description of this node
|
RouteDefinition |
from(org.apache.camel.Endpoint endpoint)
Creates an input to the route
|
RouteDefinition |
from(EndpointConsumerBuilder endpoint)
Creates an input to the route
|
RouteDefinition |
from(String uri)
Creates an input to the route
|
Consumer<org.apache.camel.RouteTemplateContext> |
getConfigurer() |
String |
getLabel() |
RouteDefinition |
getRoute() |
String |
getShortName() |
List<RouteTemplateBeanDefinition> |
getTemplateBeans() |
List<RouteTemplateParameterDefinition> |
getTemplateParameters() |
RouteDefinition |
route()
To define the route in the template
|
void |
setConfigurer(Consumer<org.apache.camel.RouteTemplateContext> configurer) |
void |
setRoute(RouteDefinition route) |
void |
setTemplateBeans(List<RouteTemplateBeanDefinition> templateBeans) |
void |
setTemplateParameters(List<RouteTemplateParameterDefinition> templateParameters) |
RouteTemplateBeanDefinition |
templateBean(String name)
Adds a local bean the route template uses (via fluent builder)
|
RouteTemplateDefinition |
templateBean(String name,
Class<?> type)
Adds a local bean the route template uses
|
RouteTemplateDefinition |
templateBean(String name,
Class<?> type,
org.apache.camel.RouteTemplateContext.BeanSupplier<Object> bean)
Adds a local bean the route template uses
|
RouteTemplateDefinition |
templateBean(String name,
Class<?> type,
String language,
String script)
Adds a local bean the route template uses
|
RouteTemplateDefinition |
templateBean(String name,
Object bean)
Adds a local bean the route template uses
|
RouteTemplateDefinition |
templateBean(String name,
String language,
String script)
Adds a local bean the route template uses
|
RouteTemplateDefinition |
templateBean(String name,
Supplier<Object> bean)
Adds a local bean the route template uses
|
RouteTemplateDefinition |
templateOptionalParameter(String name)
Adds an optional parameter the route template uses
|
RouteTemplateDefinition |
templateOptionalParameter(String name,
String description)
Adds an optional parameter the route template uses
|
RouteTemplateDefinition |
templateParameter(String name)
Adds a required parameter the route template uses
|
RouteTemplateDefinition |
templateParameter(String name,
String defaultValue)
Adds a parameter (will use default value if not provided) the route template uses
|
RouteTemplateDefinition |
templateParameter(String name,
String defaultValue,
String description)
Adds a parameter (will use default value if not provided) the route template uses
|
RouteTemplateDefinition |
templateParameters(Map<String,String> parameters)
Adds the parameters the route template uses.
|
description, getCustomId, getDescription, getDescriptionText, getId, getParent, hasCustomIdAssigned, id, idOrCreate, setCustomId, setDescription, setGeneratedId, setId
public List<RouteTemplateParameterDefinition> getTemplateParameters()
public void setTemplateParameters(List<RouteTemplateParameterDefinition> templateParameters)
public List<RouteTemplateBeanDefinition> getTemplateBeans()
public void setTemplateBeans(List<RouteTemplateBeanDefinition> templateBeans)
public RouteDefinition getRoute()
public void setRoute(RouteDefinition route)
public void setConfigurer(Consumer<org.apache.camel.RouteTemplateContext> configurer)
public Consumer<org.apache.camel.RouteTemplateContext> getConfigurer()
public RouteDefinition from(@AsEndpointUri String uri)
uri
- the from uripublic RouteDefinition from(org.apache.camel.Endpoint endpoint)
endpoint
- the from endpointpublic RouteDefinition from(EndpointConsumerBuilder endpoint)
endpoint
- the from endpointpublic RouteDefinition route()
public RouteTemplateDefinition description(String text)
OptionalIdentifiedDefinition
description
in class OptionalIdentifiedDefinition
text
- sets the text description, use null to not set a textpublic RouteTemplateDefinition templateParameter(String name)
name
- the name of the parameterpublic RouteTemplateDefinition templateOptionalParameter(String name)
name
- the name of the parameterpublic RouteTemplateDefinition templateOptionalParameter(String name, String description)
name
- the name of the parameterdescription
- the description of the parameterpublic RouteTemplateDefinition templateParameter(String name, String defaultValue)
name
- the name of the parameterdefaultValue
- default value of the parameterpublic RouteTemplateDefinition templateParameter(String name, String defaultValue, String description)
name
- the name of the parameterdefaultValue
- default value of the parameterdescription
- the description of the parameterpublic RouteTemplateDefinition templateParameters(Map<String,String> parameters)
parameters
- the parameters (only name and default values)public RouteTemplateDefinition templateBean(String name, Class<?> type)
name
- the name of the beantype
- the type of the bean to associate the bindingpublic RouteTemplateDefinition templateBean(String name, Object bean)
name
- the name of the beanbean
- the bean, or reference to bean (#class or #type), or a supplier for the beanpublic RouteTemplateDefinition templateBean(String name, Supplier<Object> bean)
name
- the name of the beanbean
- the supplier for the beanpublic RouteTemplateDefinition templateBean(String name, Class<?> type, org.apache.camel.RouteTemplateContext.BeanSupplier<Object> bean)
name
- the name of the beantype
- the type of the bean to associate the bindingbean
- a supplier for the beanpublic RouteTemplateDefinition templateBean(String name, String language, String script)
name
- the name of the beanlanguage
- the language to usescript
- the script to use for creating the local beanpublic RouteTemplateDefinition templateBean(String name, Class<?> type, String language, String script)
name
- the name of the beantype
- the type of the bean to associate the bindinglanguage
- the language to usescript
- the script to use for creating the local beanpublic RouteTemplateBeanDefinition templateBean(String name)
name
- the name of the beanpublic RouteTemplateDefinition configure(Consumer<org.apache.camel.RouteTemplateContext> configurer)
configurer
- the configurer with callback to invoke with the given route template contextpublic String getShortName()
public String getLabel()
public RouteDefinition asRouteDefinition()
RouteDefinition
which can be used to add as a new route.Apache Camel