Class 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 Detail

      • TemplatedRouteDefinition

        public TemplatedRouteDefinition()
    • Method Detail

      • getRouteTemplateRef

        public String getRouteTemplateRef()
      • setRouteTemplateRef

        public void setRouteTemplateRef​(String routeTemplateRef)
      • getRouteId

        public String getRouteId()
      • setRouteId

        public void setRouteId​(String routeId)
      • getCamelContext

        public org.apache.camel.CamelContext getCamelContext()
        Specified by:
        getCamelContext in interface org.apache.camel.CamelContextAware
      • setCamelContext

        public void setCamelContext​(org.apache.camel.CamelContext camelContext)
        Specified by:
        setCamelContext in interface org.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 parameter
        value - 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 bean
        type - 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 bean
        bean - the bean, or reference to bean (#class or #type), or a 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 bean
        type - the type of the bean to associate the binding
        bean - 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 bean
        language - the language to use
        script - 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 bean
        type - the type of the bean to associate the binding
        language - the language to use
        script - 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