Class RouteConfigurationDefinition

All Implemented Interfaces:
org.apache.camel.CamelContextAware, org.apache.camel.LineNumberAware, PreconditionContainer, org.apache.camel.NamedNode, org.apache.camel.spi.HasCamelContext, org.apache.camel.spi.HasId, org.apache.camel.spi.IdAware, org.apache.camel.spi.ResourceAware

@Metadata(label="configuration") public class RouteConfigurationDefinition extends OptionalIdentifiedDefinition<RouteConfigurationDefinition> implements PreconditionContainer, org.apache.camel.spi.ResourceAware
Reusable configuration for Camel route(s).
  • Constructor Details

    • RouteConfigurationDefinition

      public RouteConfigurationDefinition()
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getShortName

      public String getShortName()
      Specified by:
      getShortName in interface org.apache.camel.NamedNode
    • getLabel

      public String getLabel()
      Specified by:
      getLabel in interface org.apache.camel.NamedNode
    • 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
    • getErrorHandler

      public ErrorHandlerDefinition getErrorHandler()
    • setErrorHandler

      public void setErrorHandler(ErrorHandlerDefinition errorHandler)
    • getOnExceptions

      public List<OnExceptionDefinition> getOnExceptions()
    • setOnExceptions

      public void setOnExceptions(List<OnExceptionDefinition> onExceptions)
    • getOnCompletions

      public List<OnCompletionDefinition> getOnCompletions()
    • setOnCompletions

      public void setOnCompletions(List<OnCompletionDefinition> onCompletions)
    • getIntercepts

      public List<InterceptDefinition> getIntercepts()
    • setIntercepts

      public void setIntercepts(List<InterceptDefinition> intercepts)
    • getInterceptFroms

      public List<InterceptFromDefinition> getInterceptFroms()
    • setInterceptFroms

      public void setInterceptFroms(List<InterceptFromDefinition> interceptFroms)
    • getInterceptSendTos

      public List<InterceptSendToEndpointDefinition> getInterceptSendTos()
    • setInterceptSendTos

      public void setInterceptSendTos(List<InterceptSendToEndpointDefinition> interceptSendTos)
    • getPrecondition

      public String getPrecondition()
      The predicate of the precondition in simple language to evaluate in order to determine if this route configuration should be included or not.
      Specified by:
      getPrecondition in interface PreconditionContainer
    • setPrecondition

      public void setPrecondition(String precondition)
      The predicate of the precondition in simple language to evaluate in order to determine if this route configuration should be included or not.
      Specified by:
      setPrecondition in interface PreconditionContainer
    • errorHandler

      public RouteConfigurationDefinition errorHandler(String ref)
      Sets the error handler to use, for routes that has not already been configured with an error handler.
      Parameters:
      ref - reference to existing error handler
      Returns:
      the builder
    • errorHandler

      public RouteConfigurationDefinition errorHandler(org.apache.camel.ErrorHandlerFactory errorHandler)
      Sets the error handler to use, for routes that has not already been configured with an error handler.
      Parameters:
      errorHandler - the error handler
      Returns:
      the builder
    • precondition

      public RouteConfigurationDefinition precondition(String precondition)
      Sets the predicate of the precondition in simple language to evaluate in order to determine if this route configuration should be included or not.
      Parameters:
      precondition - the predicate corresponding to the test to evaluate.
      Returns:
      the builder
    • onException

      public OnExceptionDefinition onException(Class<? extends Throwable> exceptionType)
      Exception clause for catching certain exceptions and handling them.
      Parameters:
      exceptionType - the exception to catch
      Returns:
      the exception builder to configure
    • onException

      @SafeVarargs public final OnExceptionDefinition onException(Class<? extends Throwable>... exceptions)
      Exception clause for catching certain exceptions and handling them.
      Parameters:
      exceptions - list of exceptions to catch
      Returns:
      the exception builder to configure
    • onCompletion

      public OnCompletionDefinition onCompletion()
      On completion callback for doing custom routing when the Exchange is complete.
      Returns:
      the on completion builder to configure
    • intercept

      public InterceptDefinition intercept()
      Adds a route for an interceptor that intercepts every processing step.
      Returns:
      the builder
    • interceptFrom

      public InterceptFromDefinition interceptFrom()
      Adds a route for an interceptor that intercepts incoming messages on any inputs in this route
      Returns:
      the builder
    • interceptFrom

      public InterceptFromDefinition interceptFrom(String uri)
      Adds a route for an interceptor that intercepts incoming messages on the given endpoint.
      Parameters:
      uri - endpoint uri
      Returns:
      the builder
    • interceptSendToEndpoint

      public InterceptSendToEndpointDefinition interceptSendToEndpoint(String uri)
      Applies a route for an interceptor if an exchange is send to the given endpoint
      Parameters:
      uri - endpoint uri
      Returns:
      the builder