Package org.apache.camel.builder
Class TemplatedRouteBuilder
java.lang.Object
org.apache.camel.builder.TemplatedRouteBuilder
Fluent builder for adding new routes from route templates.
-
Method Summary
Modifier and TypeMethodDescriptionadd()
Adds the route to theCamelContext
which is built from the configured route template.Binds the bean to the template local repository (takes precedence over global beans)Binds the bean (via a supplier) to the template local repository (takes precedence over global beans)Binds the bean to the template local repository (takes precedence over global beans)static TemplatedRouteBuilder
Creates a newTemplatedRouteBuilder
to specify input parameters, and others, for the route template.Sets a configurer which allows to do configuration while the route template is being used to create a route.handler
(Consumer<RouteTemplateDefinition> handler) Sets a handler which gives access to the route template model that will be used for creating the route.Adds a parameter the route template will use when creating the route.parameters
(Map<String, Object> parameters) Adds parameters the route template will use when creating the route.Sets a prefix to use for all node ids (not route id).Sets the id of the route.
-
Method Details
-
builder
public static TemplatedRouteBuilder builder(org.apache.camel.CamelContext camelContext, String routeTemplateId) Creates a newTemplatedRouteBuilder
to specify input parameters, and others, for the route template.- Parameters:
camelContext
- the camel contextrouteTemplateId
- the id of the route template- Returns:
- the builder
-
routeId
Sets the id of the route. If no route id is configured, then Camel will auto assign a route id, which is returned from the build method.- Parameters:
routeId
- the route id
-
prefixId
Sets a prefix to use for all node ids (not route id).- Parameters:
prefixId
- the prefix id
-
parameter
Adds a parameter the route template will use when creating the route.- Parameters:
name
- parameter namevalue
- parameter value
-
parameters
Adds parameters the route template will use when creating the route.- Parameters:
parameters
- the template parameters to add
-
bean
Binds the bean to the template local repository (takes precedence over global beans)- Parameters:
id
- the id of the beanbean
- the bean
-
bean
Binds the bean to the template local repository (takes precedence over global beans)- Parameters:
id
- the id of the beantype
- the type of the bean to associate the bindingbean
- the bean
-
bean
Binds the bean (via a supplier) to the template local repository (takes precedence over global beans)- Parameters:
id
- the id of the beantype
- the type of the bean to associate the bindingbean
- the bean
-
handler
Sets a handler which gives access to the route template model that will be used for creating the route. This can be used to do validation. Any changes to the model happens before the route is created and added, however these changes affect future usage of the same template.- Parameters:
handler
- the handler with callback to invoke with the given route template
-
configure
Sets a configurer which allows to do configuration while the route template is being used to create a route. This gives control over the creating process, such as binding local beans and doing other kind of customization.- Parameters:
configurer
- the configurer with callback to invoke with the given route template context
-
add
Adds the route to theCamelContext
which is built from the configured route template.- Returns:
- the route id of the route that was added.
-