@Metadata(label="configuration") public class RouteDefinition extends ProcessorDefinition<RouteDefinition>
inheritErrorHandler, log
Constructor and Description |
---|
RouteDefinition() |
RouteDefinition(Endpoint endpoint) |
RouteDefinition(String uri) |
Modifier and Type | Method and Description |
---|---|
protected RouteContext |
addRoutes(CamelContext camelContext,
Collection<Route> routes,
FromDefinition fromType) |
List<RouteContext> |
addRoutes(ModelCamelContext camelContext,
Collection<Route> routes) |
RouteDefinition |
adviceWith(CamelContext camelContext,
RouteBuilder builder) |
RouteDefinition |
adviceWith(ModelCamelContext camelContext,
RouteBuilder builder)
Advices this route with the route builder.
|
RouteDefinition |
autoStartup(boolean autoStartup)
Sets the auto startup property on this route.
|
RouteDefinition |
autoStartup(String autoStartup)
Sets the auto startup property on this route.
|
RouteDefinition |
delayer(long delay)
Enable delayer for this route.
|
RouteDefinition |
errorHandler(ErrorHandlerFactory errorHandlerBuilder)
Installs the given error handler builder.
|
RouteDefinition |
from(Endpoint... endpoints)
Creates inputs to the route
|
RouteDefinition |
from(Endpoint endpoint)
Creates an input to the route
|
RouteDefinition |
from(String... uris)
Creates inputs to the route
|
RouteDefinition |
from(String uri)
Creates an input to the route
|
void |
fromRest(String uri)
This route is created from the REST DSL.
|
String |
getAutoStartup()
Whether to auto start this route
|
String |
getDelayer()
Whether to slow down processing messages by a given delay in msec.
|
ErrorHandlerFactory |
getErrorHandlerBuilder() |
String |
getErrorHandlerRef()
Sets the bean ref name of the error handler builder to use on this route
|
String |
getGroup()
The group that this route belongs to; could be the name of the RouteBuilder class
or be explicitly configured in the XML.
|
String |
getHandleFault()
Whether handle fault is enabled on this route.
|
List<FromDefinition> |
getInputs() |
InputTypeDefinition |
getInputType() |
String |
getLogMask()
Whether security mask for Logging is enabled on this route.
|
String |
getMessageHistory()
Whether message history is enabled on this route.
|
List<ProcessorDefinition<?>> |
getOutputs() |
OutputTypeDefinition |
getOutputType() |
RestBindingDefinition |
getRestBindingDefinition() |
RestDefinition |
getRestDefinition() |
List<RoutePolicy> |
getRoutePolicies() |
String |
getRoutePolicyRef()
Reference to custom
RoutePolicy to use by the route. |
ShutdownRoute |
getShutdownRoute() |
ShutdownRunningTask |
getShutdownRunningTask()
To control how to shutdown the route.
|
Integer |
getStartupOrder()
To configure the ordering of the routes being started
|
ServiceStatus |
getStatus(CamelContext camelContext)
Returns the status of the route if it has been registered with a
CamelContext |
String |
getStreamCache()
Whether stream caching is enabled on this route.
|
String |
getTrace()
Whether tracing is enabled on this route.
|
RouteDefinition |
group(String name)
Set the group name for this route
|
RouteDefinition |
handleFault()
Enable handle fault for this route.
|
RouteDefinition |
inputType(Class clazz)
Declare the expected data type of the input message by Java class.
|
RouteDefinition |
inputType(String urn)
Declare the expected data type of the input message.
|
RouteDefinition |
inputTypeWithValidate(Class clazz)
Declare the expected data type of the input message by Java class with content validation enabled.
|
RouteDefinition |
inputTypeWithValidate(String urn)
Declare the expected data type of the input message with content validation enabled.
|
boolean |
isAutoStartup(CamelContext camelContext) |
boolean |
isContextScopedErrorHandler(CamelContext context) |
boolean |
isOutputSupported() |
Boolean |
isRest() |
boolean |
isStartable(CamelContext camelContext) |
boolean |
isStoppable(CamelContext camelContext) |
RouteDefinition |
logMask()
Enable security mask for Logging on this route.
|
RouteDefinition |
logMask(String logMask)
Sets whether security mask for logging is enabled on this route.
|
void |
markPrepared()
Marks the route definition as prepared.
|
void |
markUnprepared()
Marks the route definition as un-prepared.
|
RouteDefinition |
messageHistory()
Enable message history for this route.
|
RouteDefinition |
messageHistory(String messageHistory)
Enable message history for this route.
|
RouteDefinition |
noAutoStartup()
Disables this route from being auto started when Camel starts.
|
RouteDefinition |
noDelayer()
Disable delayer for this route.
|
RouteDefinition |
noHandleFault()
Disable handle fault for this route.
|
RouteDefinition |
noMessageHistory()
Disable message history for this route.
|
RouteDefinition |
noStreamCaching()
Disable stream caching for this route.
|
RouteDefinition |
noTracing()
Disable tracing for this route.
|
RouteDefinition |
outputType(Class clazz)
Declare the expected data type of the output message by Java class.
|
RouteDefinition |
outputType(String urn)
Declare the expected data type of the output message.
|
RouteDefinition |
outputTypeWithValidate(Class clazz)
Declare the expected data type of the ouput message by Java class with content validation enabled.
|
RouteDefinition |
outputTypeWithValidate(String urn)
Declare the expected data type of the output message with content validation enabled.
|
void |
prepare(ModelCamelContext context)
Prepares the route definition to be ready to be added to
CamelContext |
Endpoint |
resolveEndpoint(CamelContext camelContext,
String uri) |
RouteDefinition |
routeDescription(String description)
Set the route description for this route
|
RouteDefinition |
routeId(String id)
Set the route id for this route
|
RouteDefinition |
routePolicy(RoutePolicy... policies)
Configures route policies for this route
|
RouteDefinition |
routePolicyRef(String routePolicyRef)
Configures a route policy for this route
|
void |
setAutoStartup(String autoStartup)
Whether to auto start this route
|
void |
setDelayer(String delayer)
Whether to slow down processing messages by a given delay in msec.
|
void |
setErrorHandlerBuilder(ErrorHandlerFactory errorHandlerBuilder)
Sets the error handler to use with processors created by this builder
|
void |
setErrorHandlerBuilderIfNull(ErrorHandlerFactory errorHandlerBuilder)
Sets the error handler if one is not already set
|
void |
setErrorHandlerRef(String errorHandlerRef)
Sets the bean ref name of the error handler builder to use on this route
|
void |
setGroup(String group)
The group that this route belongs to; could be the name of the RouteBuilder class
or be explicitly configured in the XML.
|
void |
setHandleFault(String handleFault)
Whether handle fault is enabled on this route.
|
void |
setInputs(List<FromDefinition> inputs)
Input to the route.
|
void |
setInputType(InputTypeDefinition inputType) |
void |
setLogMask(String logMask)
Whether security mask for Logging is enabled on this route.
|
void |
setMessageHistory(String messageHistory)
Whether message history is enabled on this route.
|
void |
setOutputs(List<ProcessorDefinition<?>> outputs)
Outputs are processors that determines how messages are processed by this route.
|
void |
setOutputType(OutputTypeDefinition outputType) |
void |
setRestBindingDefinition(RestBindingDefinition restBindingDefinition) |
void |
setRestDefinition(RestDefinition restDefinition) |
void |
setRoutePolicies(List<RoutePolicy> routePolicies) |
void |
setRoutePolicyRef(String routePolicyRef)
Reference to custom
RoutePolicy to use by the route. |
void |
setShutdownRoute(ShutdownRoute shutdownRoute)
To control how to shutdown the route.
|
void |
setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask)
To control how to shutdown the route.
|
void |
setStartupOrder(Integer startupOrder)
To configure the ordering of the routes being started
|
void |
setStreamCache(String streamCache)
Whether stream caching is enabled on this route.
|
void |
setTrace(String trace)
Whether tracing is enabled on this route.
|
RouteDefinition |
shutdownRoute(ShutdownRoute shutdownRoute)
Configures a shutdown route option.
|
RouteDefinition |
shutdownRunningTask(ShutdownRunningTask shutdownRunningTask)
Configures a shutdown running task option.
|
RouteDefinition |
startupOrder(int order)
Configures the startup order for this route
Camel will reorder routes and star them ordered by 0..N where 0 is the lowest number and N the highest number.
|
RouteDefinition |
streamCaching()
Enable stream caching for this route.
|
RouteDefinition |
streamCaching(String streamCache)
Enable stream caching for this route.
|
String |
toString() |
RouteDefinition |
tracing()
Enable tracing for this route.
|
RouteDefinition |
tracing(String tracing)
Enable tracing for this route.
|
addInterceptStrategies, addInterceptStrategy, addOutput, addRoutes, aggregate, aggregate, aggregate, aggregate, aop, attribute, bean, bean, bean, bean, bean, bean, bean, bean, beanRef, beanRef, beanRef, beanRef, beanRef, choice, clearOutput, configureChild, convertBodyTo, convertBodyTo, createChannel, createChildProcessor, createCompositeProcessor, createOutputsProcessor, createOutputsProcessor, createOutputsProcessorImpl, createProcessor, createProcessor, delay, delay, delay, doTry, dynamicRouter, dynamicRouter, end, endChoice, endDoTry, endHystrix, endParent, endRest, enrich, enrich, enrich, enrich, enrich, enrichRef, enrichRef, enrichRef, enrichWith, enrichWith, enrichWith, filter, filter, filter, filter, getIndex, getInterceptStrategies, getLabel, getOtherAttributes, getParent, hystrix, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, inOnly, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, inOut, isAbstract, isInheritErrorHandler, isTopLevelOnly, loadBalance, loadBalance, log, log, log, log, log, log, loop, loop, loop, loopDoWhile, loopDoWhile, makeProcessor, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onCompletion, onException, onException, pipeline, pipeline, pipeline, pipeline, placeholder, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichRef, pollEnrichRef, pollEnrichWith, pollEnrichWith, pollEnrichWith, preCreateProcessor, process, process, process, processRef, recipientList, recipientList, recipientList, recipientList, removeFaultHeader, removeHeader, removeHeaders, removeHeaders, removeProperties, removeProperties, removeProperty, resequence, resequence, rollback, rollback, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, sample, sample, sample, script, script, serviceCall, serviceCall, serviceCall, setBody, setBody, setExchangePattern, setFaultBody, setFaultHeader, setHeader, setHeader, setHeader, setInheritErrorHandler, setOtherAttributes, setOutHeader, setOutHeader, setParent, setProperty, setProperty, sort, sort, sort, split, split, split, stop, threads, threads, threads, threads, throttle, throttle, throttle, throwException, throwException, to, to, to, to, to, to, to, to, to, to, toD, toD, toF, transacted, transacted, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wrapChannel, wrapChannel, wrapInErrorHandler, wrapProcessor
description, description, getCustomId, getDescription, getDescriptionText, getId, getShortName, hasCustomIdAssigned, idOrCreate, setCustomId, setDescription, setId
public RouteDefinition()
public RouteDefinition(@AsEndpointUri String uri)
public RouteDefinition(Endpoint endpoint)
public void prepare(ModelCamelContext context)
CamelContext
context
- the camel contextpublic void markPrepared()
public void markUnprepared()
public ServiceStatus getStatus(CamelContext camelContext)
CamelContext
public boolean isStartable(CamelContext camelContext)
public boolean isStoppable(CamelContext camelContext)
public List<RouteContext> addRoutes(ModelCamelContext camelContext, Collection<Route> routes) throws Exception
Exception
public Endpoint resolveEndpoint(CamelContext camelContext, String uri) throws NoSuchEndpointException
NoSuchEndpointException
public RouteDefinition adviceWith(CamelContext camelContext, RouteBuilder builder) throws Exception
Exception
public RouteDefinition adviceWith(ModelCamelContext camelContext, RouteBuilder builder) throws Exception
RouteBuilder
but the specialized AdviceWithRouteBuilder
has additional features when using the advice with feature.
We therefore suggest you to use the AdviceWithRouteBuilder
.
The advice process will add the interceptors, on exceptions, on completions etc. configured
from the route builder to this route.
This is mostly used for testing purpose to add interceptors and the likes to an existing route.
Will stop and remove the old route from camel context and add and start this new advised route.camelContext
- the camel contextbuilder
- the route builderException
- can be thrown from the route builderAdviceWithRouteBuilder
public RouteDefinition from(@AsEndpointUri String uri)
uri
- the from uripublic RouteDefinition from(Endpoint endpoint)
endpoint
- the from endpointpublic RouteDefinition from(@AsEndpointUri String... uris)
uris
- the from urispublic RouteDefinition from(Endpoint... endpoints)
endpoints
- the from endpointspublic RouteDefinition group(String name)
name
- the group namepublic RouteDefinition routeId(String id)
routeId
in class ProcessorDefinition<RouteDefinition>
id
- the route idpublic RouteDefinition routeDescription(String description)
routeDescription
in class ProcessorDefinition<RouteDefinition>
description
- the route descriptionpublic RouteDefinition noStreamCaching()
public RouteDefinition streamCaching()
public RouteDefinition streamCaching(String streamCache)
streamCache
- whether to use stream caching (true or false), the value can be a property placeholderpublic RouteDefinition noTracing()
public RouteDefinition tracing()
public RouteDefinition tracing(String tracing)
tracing
- whether to use tracing (true or false), the value can be a property placeholderpublic RouteDefinition messageHistory()
public RouteDefinition messageHistory(String messageHistory)
messageHistory
- whether to use message history (true or false), the value can be a property placeholderpublic RouteDefinition logMask()
public RouteDefinition logMask(String logMask)
logMask
- whether to enable security mask for Logging (true or false), the value can be a property placeholderpublic RouteDefinition noMessageHistory()
public RouteDefinition noHandleFault()
public RouteDefinition handleFault()
public RouteDefinition noDelayer()
public RouteDefinition delayer(long delay)
delay
- delay in millispublic RouteDefinition errorHandler(ErrorHandlerFactory errorHandlerBuilder)
errorHandlerBuilder
- the error handler to be used by default for all child routespublic RouteDefinition noAutoStartup()
public RouteDefinition autoStartup(String autoStartup)
autoStartup
- whether to auto startup (true or false), the value can be a property placeholderpublic RouteDefinition autoStartup(boolean autoStartup)
autoStartup
- - boolean indicatorpublic RouteDefinition startupOrder(int order)
startupOrder
in class ProcessorDefinition<RouteDefinition>
order
- the order represented as a numberpublic RouteDefinition routePolicy(RoutePolicy... policies)
policies
- the route policiespublic RouteDefinition routePolicyRef(String routePolicyRef)
routePolicyRef
- reference to a RoutePolicy
to lookup and use.
You can specify multiple references by separating using comma.public RouteDefinition shutdownRoute(ShutdownRoute shutdownRoute)
shutdownRoute
- the option to use when shutting down this routepublic RouteDefinition shutdownRunningTask(ShutdownRunningTask shutdownRunningTask)
shutdownRunningTask
- the option to use when shutting down and how to act upon running tasks.public RouteDefinition inputType(String urn)
Transformer
and apply if exists.
The type name consists of two parts, 'scheme' and 'name' connected with ':'. For Java type 'name'
is a fully qualified class name. For example java:java.lang.String
, json:ABCOrder
.urn
- input type URNTransformer
public RouteDefinition inputTypeWithValidate(String urn)
Transformer
and apply if exists, and then applies Validator
as well.
The type name consists of two parts, 'scheme' and 'name' connected with ':'. For Java type 'name'
is a fully qualified class name. For example java:java.lang.String
, json:ABCOrder
.urn
- input type URNTransformer
,
Validator
public RouteDefinition inputType(Class clazz)
Transformer
and apply if exists.clazz
- Class object of the input typeTransformer
public RouteDefinition inputTypeWithValidate(Class clazz)
Transformer
and apply if exists, and then applies Validator
as well.clazz
- Class object of the input typeTransformer
,
Validator
public RouteDefinition outputType(String urn)
Transformer
and apply if exists.
The type name consists of two parts, 'scheme' and 'name' connected with ':'. For Java type 'name'
is a fully qualified class name. For example java:java.lang.String
, json:ABCOrder
.urn
- output type URNTransformer
public RouteDefinition outputTypeWithValidate(String urn)
Transformer
and apply if exists, and then applies Validator
as well.
The type name consists of two parts, 'scheme' and 'name' connected with ':'. For Java type 'name'
is a fully qualified class name. For example java:java.lang.String
, json:ABCOrder
.urn
- output type URNTransformer
,
Validator
public RouteDefinition outputType(Class clazz)
Transformer
and apply if exists.clazz
- Class object of the output typeTransformer
public RouteDefinition outputTypeWithValidate(Class clazz)
Transformer
and apply if exists, and then applies Validator
as well.clazz
- Class object of the output typeTransformer
,
Validator
public List<FromDefinition> getInputs()
public void setInputs(List<FromDefinition> inputs)
public List<ProcessorDefinition<?>> getOutputs()
getOutputs
in class ProcessorDefinition<RouteDefinition>
public void setOutputs(List<ProcessorDefinition<?>> outputs)
public boolean isOutputSupported()
isOutputSupported
in class ProcessorDefinition<RouteDefinition>
public String getGroup()
public void setGroup(String group)
public String getStreamCache()
public void setStreamCache(String streamCache)
public String getMessageHistory()
@Metadata(defaultValue="true") public void setMessageHistory(String messageHistory)
public String getLogMask()
public void setLogMask(String logMask)
public String getHandleFault()
public void setHandleFault(String handleFault)
public String getDelayer()
public void setDelayer(String delayer)
public String getAutoStartup()
public boolean isAutoStartup(CamelContext camelContext) throws Exception
Exception
@Metadata(defaultValue="true") public void setAutoStartup(String autoStartup)
public Integer getStartupOrder()
public void setStartupOrder(Integer startupOrder)
public void setErrorHandlerRef(String errorHandlerRef)
public String getErrorHandlerRef()
public void setErrorHandlerBuilderIfNull(ErrorHandlerFactory errorHandlerBuilder)
public void setRoutePolicyRef(String routePolicyRef)
RoutePolicy
to use by the route.
Multiple policies can be configured by separating values using comma.public String getRoutePolicyRef()
RoutePolicy
to use by the route.
Multiple policies can be configured by separating values using comma.public List<RoutePolicy> getRoutePolicies()
public void setRoutePolicies(List<RoutePolicy> routePolicies)
public ShutdownRoute getShutdownRoute()
@Metadata(defaultValue="Default") public void setShutdownRoute(ShutdownRoute shutdownRoute)
public ShutdownRunningTask getShutdownRunningTask()
@Metadata(defaultValue="CompleteCurrentTaskOnly") public void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask)
public ErrorHandlerFactory getErrorHandlerBuilder()
public void setErrorHandlerBuilder(ErrorHandlerFactory errorHandlerBuilder)
public RestDefinition getRestDefinition()
public void setRestDefinition(RestDefinition restDefinition)
public RestBindingDefinition getRestBindingDefinition()
public void setRestBindingDefinition(RestBindingDefinition restBindingDefinition)
public boolean isContextScopedErrorHandler(CamelContext context)
public void setInputType(InputTypeDefinition inputType)
public InputTypeDefinition getInputType()
public void setOutputType(OutputTypeDefinition outputType)
public OutputTypeDefinition getOutputType()
protected RouteContext addRoutes(CamelContext camelContext, Collection<Route> routes, FromDefinition fromType) throws Exception
Exception
Apache Camel