Class TemplatedRouteDefinition

java.lang.Object
org.apache.camel.model.TemplatedRouteDefinition
All Implemented Interfaces:
org.apache.camel.CamelContextAware, org.apache.camel.spi.HasCamelContext, org.apache.camel.spi.ResourceAware

@Metadata(label="configuration") public class TemplatedRouteDefinition extends Object implements org.apache.camel.CamelContextAware, org.apache.camel.spi.ResourceAware
Defines a templated route (a route built from a route template)
  • Constructor Details

    • TemplatedRouteDefinition

      public TemplatedRouteDefinition()
  • Method Details

    • 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)
    • getPrefixId

      public String getPrefixId()
    • setPrefixId

      public void setPrefixId(String prefixId)
    • getCamelContext

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

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

      public org.apache.camel.spi.Resource getResource()
      Specified by:
      getResource in interface org.apache.camel.spi.ResourceAware
    • setResource

      public void setResource(org.apache.camel.spi.Resource resource)
      Specified by:
      setResource in interface org.apache.camel.spi.ResourceAware
    • 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, Supplier<Object> bean)
      Adds a local bean as input of the route template.
      Parameters:
      name - the name of the bean
      bean - 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 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

      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
    • prefixId

      public TemplatedRouteDefinition prefixId(String id)
      Sets a prefix to use for all node ids (not route id).
      Parameters:
      id - the prefix id
    • 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