Package org.apache.camel.model
Class TemplatedRouteDefinition
- java.lang.Object
-
- org.apache.camel.model.TemplatedRouteDefinition
-
- All Implemented Interfaces:
org.apache.camel.CamelContextAware
@Metadata(label="configuration") public class TemplatedRouteDefinition extends Object implements org.apache.camel.CamelContextAware
Defines a templated route (a route built from a route template)
-
-
Constructor Summary
Constructors Constructor Description TemplatedRouteDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TemplatedRouteBeanDefinitionbean(String name)Adds a local bean as input of the route template.TemplatedRouteDefinitionbean(String name, Class<?> type)Adds a local bean as input of the route template.TemplatedRouteDefinitionbean(String name, Class<?> type, String language, String script)Adds a local bean as input of the route template.TemplatedRouteDefinitionbean(String name, Class<?> type, org.apache.camel.RouteTemplateContext.BeanSupplier<Object> bean)Adds a local bean as input of the route template.TemplatedRouteDefinitionbean(String name, Object bean)Adds a local bean as input of the route template.TemplatedRouteDefinitionbean(String name, String language, String script)Adds a local bean as input of the route template.TemplatedRouteDefinitionbean(String name, Supplier<Object> bean)Adds a local bean as input of the route template.List<TemplatedRouteBeanDefinition>getBeans()org.apache.camel.CamelContextgetCamelContext()List<TemplatedRouteParameterDefinition>getParameters()StringgetRouteId()StringgetRouteTemplateRef()TemplatedRouteDefinitionparameter(String name, String value)Adds an input parameter to build the route from the route template.TemplatedRouteDefinitionparameters(Map<String,String> parameters)Adds the input parameters to build the route from the route template.TemplatedRouteDefinitionrouteId(String id)Sets the id of the route built from the route template.TemplatedRouteDefinitionrouteTemplateRef(String ref)Sets the id of the route template to use to build the route.voidsetBeans(List<TemplatedRouteBeanDefinition> beans)voidsetCamelContext(org.apache.camel.CamelContext camelContext)voidsetParameters(List<TemplatedRouteParameterDefinition> parameters)voidsetRouteId(String routeId)voidsetRouteTemplateRef(String routeTemplateRef)
-
-
-
Method Detail
-
getRouteTemplateRef
public String getRouteTemplateRef()
-
setRouteTemplateRef
public void setRouteTemplateRef(String routeTemplateRef)
-
getParameters
public List<TemplatedRouteParameterDefinition> getParameters()
-
setParameters
public void setParameters(List<TemplatedRouteParameterDefinition> parameters)
-
getBeans
public List<TemplatedRouteBeanDefinition> getBeans()
-
setBeans
public void setBeans(List<TemplatedRouteBeanDefinition> beans)
-
getRouteId
public String getRouteId()
-
setRouteId
public void setRouteId(String routeId)
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()
- Specified by:
getCamelContextin interfaceorg.apache.camel.CamelContextAware
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext)
- Specified by:
setCamelContextin interfaceorg.apache.camel.CamelContextAware
-
parameter
public TemplatedRouteDefinition parameter(String name, String value)
Adds an input parameter to build the route from the route template.- Parameters:
name- the name of the parametervalue- the value of the parameter
-
parameters
public TemplatedRouteDefinition parameters(Map<String,String> parameters)
Adds the input parameters to build the route from the route template.- Parameters:
parameters- the parameters
-
bean
public TemplatedRouteDefinition bean(String name, Class<?> type)
Adds a local bean as input of the route template.- Parameters:
name- the name of the beantype- the type of the bean to associate the binding
-
bean
public TemplatedRouteDefinition bean(String name, Object bean)
Adds a local bean as input of the route template.- Parameters:
name- the name of the beanbean- the bean, or reference to bean (#class or #type), or a supplier for the bean
-
bean
public TemplatedRouteDefinition bean(String name, Supplier<Object> bean)
Adds a local bean as input of the route template.- Parameters:
name- the name of the beanbean- the supplier for the bean
-
bean
public TemplatedRouteDefinition bean(String name, Class<?> type, org.apache.camel.RouteTemplateContext.BeanSupplier<Object> bean)
Adds a local bean as input of the route template.- Parameters:
name- the name of the beantype- the type of the bean to associate the bindingbean- a supplier for the bean
-
bean
public TemplatedRouteDefinition bean(String name, String language, String script)
Adds a local bean as input of the route template.- Parameters:
name- the name of the beanlanguage- the language to usescript- the script to use for creating the local bean
-
bean
public TemplatedRouteDefinition bean(String name, Class<?> type, String language, String script)
Adds a local bean as input of the route template.- Parameters:
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 bean
-
bean
public TemplatedRouteBeanDefinition bean(String name)
Adds a local bean as input of the route template. (via fluent builder)- Parameters:
name- the name of the bean- Returns:
- fluent builder to choose which language and script to use for creating the bean
-
routeId
public TemplatedRouteDefinition routeId(String id)
Sets the id of the route built from the route template.- Parameters:
id- the id the generated route
-
routeTemplateRef
public TemplatedRouteDefinition routeTemplateRef(String ref)
Sets the id of the route template to use to build the route.- Parameters:
ref- the id of the route template
-
-