Package org.apache.camel.model
Class RouteDefinition
- java.lang.Object
-
- org.apache.camel.model.OptionalIdentifiedDefinition<Type>
-
- org.apache.camel.model.ProcessorDefinition<Type>
-
- org.apache.camel.model.OutputDefinition<RouteDefinition>
-
- org.apache.camel.model.RouteDefinition
-
- All Implemented Interfaces:
org.apache.camel.CamelContextAware
,org.apache.camel.LineNumberAware
,Block
,OutputNode
,PreconditionContainer
,org.apache.camel.NamedNode
,org.apache.camel.NamedRoute
,org.apache.camel.spi.HasId
,org.apache.camel.spi.IdAware
,org.apache.camel.spi.ResourceAware
@Metadata(label="configuration") public class RouteDefinition extends OutputDefinition<RouteDefinition> implements org.apache.camel.NamedRoute, PreconditionContainer, org.apache.camel.spi.ResourceAware
A Camel route
-
-
Field Summary
-
Fields inherited from class org.apache.camel.model.OutputDefinition
outputs
-
Fields inherited from class org.apache.camel.model.ProcessorDefinition
disabled, inheritErrorHandler
-
-
Constructor Summary
Constructors Constructor Description RouteDefinition()
RouteDefinition(String uri)
RouteDefinition(org.apache.camel.Endpoint endpoint)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAppliedRouteConfigurationId(String routeConfigurationId)
This is used internally by Camel to keep track which route configurations is applied when creating a route from this model.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(String ref)
Installs the given error handler builder.RouteDefinition
errorHandler(org.apache.camel.ErrorHandlerFactory errorHandlerBuilder)
Installs the given error handler builder.RouteDefinition
from(String uri)
Creates an input to the routeRouteDefinition
from(EndpointConsumerBuilder endpoint)
Creates an input to the routeRouteDefinition
from(org.apache.camel.Endpoint endpoint)
Creates an input to the routestatic RouteDefinition
fromEndpoint(org.apache.camel.Endpoint endpoint)
void
fromRest(String uri)
This route is created from the REST DSL.static RouteDefinition
fromUri(String uri)
Set<String>
getAppliedRouteConfigurationIds()
This is used internally by Camel to keep track which route configurations is applied when creating a route from this model.String
getAutoStartup()
Whether to auto start this routeString
getDelayer()
Whether to slow down processing messages by a given delay in msec.String
getEndpointUrl()
org.apache.camel.ErrorHandlerFactory
getErrorHandlerFactory()
String
getErrorHandlerRef()
Sets the bean ref name of the error handler builder to use on this routeString
getGroup()
The group that this route belongs to; could be the name of the RouteBuilder class or be explicitly configured in the XML.FromDefinition
getInput()
InputTypeDefinition
getInputType()
String
getLabel()
Returns a label to describe this node such as the expression if some kind of expression nodeString
getLogMask()
Whether security mask for Logging is enabled on this route.String
getMessageHistory()
Whether message history is enabled on this route.String
getNodePrefixId()
Prefix to use for all node ids (not route id).List<ProcessorDefinition<?>>
getOutputs()
OutputTypeDefinition
getOutputType()
String
getPrecondition()
The predicate of the precondition in simple language to evaluate in order to determine if this route should be included or not.org.apache.camel.spi.Resource
getResource()
RestBindingDefinition
getRestBindingDefinition()
RestDefinition
getRestDefinition()
String
getRouteConfigurationId()
The route configuration id or pattern this route should use for configuration.String
getRouteId()
List<org.apache.camel.spi.RoutePolicy>
getRoutePolicies()
String
getRoutePolicyRef()
Reference to customRoutePolicy
to use by the route.List<PropertyDefinition>
getRouteProperties()
org.apache.camel.RouteTemplateContext
getRouteTemplateContext()
String
getShortName()
String
getShutdownRoute()
String
getShutdownRunningTask()
To control how to shutdown the route.Integer
getStartupOrder()
To configure the ordering of the routes being startedString
getStreamCache()
Whether stream caching is enabled on this route.Map<String,Object>
getTemplateDefaultParameters()
Map<String,Object>
getTemplateParameters()
String
getTrace()
Whether tracing is enabled on this route.RouteDefinition
group(String name)
Set the group name for this routeRouteDefinition
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
isContextScopedErrorHandler()
boolean
isPrepared()
Check if the route has been preparedBoolean
isRest()
Boolean
isTemplate()
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
nodePrefixId(String prefixId)
Sets a prefix to use for all node ids (not route id).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.RouteDefinition
precondition(String precondition)
Sets the predicate of the precondition in simple language to evaluate in order to determine if this route should be included or not.void
resetPrepare()
Reset internal state before preparing routeRouteDefinition
routeConfigurationId(String routeConfigurationId)
The route configuration id or pattern this route should use for configuration.RouteDefinition
routeDescription(String description)
Set the route description for this routeRouteDefinition
routeGroup(String group)
Set the route group for this routeRouteDefinition
routeId(String id)
Set the route id for this routeRouteDefinition
routePolicy(Supplier<org.apache.camel.spi.RoutePolicy> policy)
Configures route policy for this routeRouteDefinition
routePolicy(org.apache.camel.spi.RoutePolicy... policies)
Configures route policies for this routeRouteDefinition
routePolicyRef(String routePolicyRef)
Configures a route policy for this routeRouteDefinition
routeProperty(String key, String value)
Adds a custom property on the route.void
setAutoStartup(String autoStartup)
Whether to auto start this routevoid
setDelayer(String delayer)
Whether to slow down processing messages by a given delay in msec.void
setErrorHandlerFactory(org.apache.camel.ErrorHandlerFactory errorHandlerFactory)
Sets the error handler to use with processors created by this buildervoid
setErrorHandlerFactoryIfNull(org.apache.camel.ErrorHandlerFactory errorHandlerFactory)
Sets the error handler if one is not already setvoid
setErrorHandlerRef(String errorHandlerRef)
Sets the bean ref name of the error handler builder to use on this routevoid
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
setInput(FromDefinition input)
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
setNodePrefixId(String nodePrefixId)
Sets a prefix to use for all node ids (not route id).void
setOutputs(List<ProcessorDefinition<?>> outputs)
Outputs are processors that determines how messages are processed by this route.void
setOutputType(OutputTypeDefinition outputType)
void
setPrecondition(String precondition)
The predicate of the precondition in simple language to evaluate in order to determine if this route should be included or not.void
setResource(org.apache.camel.spi.Resource resource)
void
setRest(Boolean rest)
void
setRestBindingDefinition(RestBindingDefinition restBindingDefinition)
void
setRestDefinition(RestDefinition restDefinition)
void
setRouteConfigurationId(String routeConfigurationId)
The route configuration id or pattern this route should use for configuration.void
setRoutePolicies(List<org.apache.camel.spi.RoutePolicy> routePolicies)
void
setRoutePolicyRef(String routePolicyRef)
Reference to customRoutePolicy
to use by the route.void
setRouteProperties(List<PropertyDefinition> routeProperties)
To set metadata as properties on the route.void
setRouteTemplateContext(org.apache.camel.RouteTemplateContext routeTemplateContext)
void
setShutdownRoute(String shutdownRoute)
To control how to shutdown the route.void
setShutdownRunningTask(String shutdownRunningTask)
To control how to shutdown the route.void
setStartupOrder(Integer startupOrder)
To configure the ordering of the routes being startedvoid
setStreamCache(String streamCache)
Whether stream caching is enabled on this route.void
setTemplate(Boolean template)
This route is created from a route template.void
setTemplateDefaultParameters(Map<String,Object> templateDefaultParameters)
void
setTemplateParameters(Map<String,Object> templateParameters)
void
setTrace(String trace)
Whether tracing is enabled on this route.RouteDefinition
shutdownRoute(String shutdownRoute)
Configures a shutdown route option.RouteDefinition
shutdownRoute(org.apache.camel.ShutdownRoute shutdownRoute)
Configures a shutdown route option.RouteDefinition
shutdownRunningTask(String shutdownRunningTask)
Configures a shutdown running task option.RouteDefinition
shutdownRunningTask(org.apache.camel.ShutdownRunningTask shutdownRunningTask)
Configures a shutdown running task option.RouteDefinition
startupOrder(int order)
Configures the startup order for this routeRouteDefinition
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.-
Methods inherited from class org.apache.camel.model.ProcessorDefinition
addInterceptStrategy, addOutput, aggregate, aggregate, aggregate, aggregate, bean, bean, bean, bean, bean, bean, bean, bean, bean, bean, bean, choice, circuitBreaker, claimCheck, claimCheck, claimCheck, claimCheck, clearOutput, configureChild, convertBodyTo, convertBodyTo, convertBodyTo, delay, delay, delay, disabled, disabled, disabled, doTry, dynamicRouter, dynamicRouter, end, endChoice, endCircuitBreaker, endDoCatch, endDoTry, endParent, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrichWith, enrichWith, enrichWith, enrichWith, enrichWith, enrichWith, filter, filter, filter, filter, getDisabled, getIndex, getInterceptStrategies, getParent, getRouteConfiguration, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, isAbstract, isInheritErrorHandler, isTopLevelOnly, isWrappingEntireOutput, kamelet, loadBalance, loadBalance, log, log, log, log, log, log, loop, loop, loop, loopDoWhile, loopDoWhile, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onCompletion, onException, onException, pausable, pausable, pausable, pausable, pipeline, pipeline, pipeline, pipeline, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, preCreateProcessor, process, process, process, recipientList, recipientList, recipientList, recipientList, removeHeader, removeHeaders, removeHeaders, removeProperties, removeProperties, removeProperty, resequence, resequence, resumable, resumable, resumable, rollback, rollback, routingSlip, routingSlip, routingSlip, saga, sample, sample, sample, sample, sample, script, script, serviceCall, serviceCall, serviceCall, setBody, setBody, setBody, setDisabled, setExchangePattern, setExchangePattern, setHeader, setHeader, setHeader, setInheritErrorHandler, setParent, setProperty, setProperty, setProperty, setRouteConfiguration, sort, sort, sort, split, split, split, split, step, step, stop, threads, threads, threads, threads, throttle, throttle, throttle, throttle, throttle, throwException, throwException, to, to, to, to, to, to, to, to, to, to, to, to, to, to, toD, toD, toD, toD, toD, toD, toD, toF, transacted, transacted, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap
-
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, description, getCamelContext, getCustomId, getDescription, getDescriptionText, getId, getLineNumber, getLocation, hasCustomIdAssigned, idOrCreate, setCamelContext, setCustomId, setDescription, setGeneratedId, setId, setLineNumber, setLocation
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
RouteDefinition
public RouteDefinition()
-
RouteDefinition
public RouteDefinition(@AsEndpointUri String uri)
-
RouteDefinition
public RouteDefinition(org.apache.camel.Endpoint endpoint)
-
-
Method Detail
-
fromRest
public void fromRest(@AsEndpointUri String uri)
This route is created from the REST DSL.
-
isPrepared
public boolean isPrepared()
Check if the route has been prepared- Returns:
- whether the route has been prepared or not
- See Also:
RouteDefinitionHelper.prepareRoute(CamelContext, RouteDefinition)
-
markPrepared
public void markPrepared()
Marks the route definition as prepared. This is needed if routes have been created by components such as camel-spring-xml or camel-blueprint. Usually they share logic in the camel-core-xml module which prepares the routes.
-
markUnprepared
public void markUnprepared()
Marks the route definition as un-prepared.
-
resetPrepare
public void resetPrepare()
Reset internal state before preparing route
-
toString
public String toString()
- Overrides:
toString
in classOutputDefinition<RouteDefinition>
-
getShortName
public String getShortName()
- Specified by:
getShortName
in interfaceorg.apache.camel.NamedNode
- Overrides:
getShortName
in classOutputDefinition<RouteDefinition>
-
getLabel
public String getLabel()
Description copied from class:ProcessorDefinition
Returns a label to describe this node such as the expression if some kind of expression node- Specified by:
getLabel
in interfaceorg.apache.camel.NamedNode
- Overrides:
getLabel
in classProcessorDefinition<RouteDefinition>
-
getRouteId
public String getRouteId()
- Specified by:
getRouteId
in interfaceorg.apache.camel.NamedRoute
-
getEndpointUrl
public String getEndpointUrl()
- Specified by:
getEndpointUrl
in interfaceorg.apache.camel.NamedRoute
-
from
public RouteDefinition from(@AsEndpointUri String uri)
Creates an input to the route- Parameters:
uri
- the from uri- Returns:
- the builder
-
from
public RouteDefinition from(org.apache.camel.Endpoint endpoint)
Creates an input to the route- Parameters:
endpoint
- the from endpoint- Returns:
- the builder
-
from
public RouteDefinition from(EndpointConsumerBuilder endpoint)
Creates an input to the route- Parameters:
endpoint
- the from endpoint- Returns:
- the builder
-
routeConfigurationId
public RouteDefinition routeConfigurationId(String routeConfigurationId)
The route configuration id or pattern this route should use for configuration. Multiple id/pattern can be separated by comma.- Parameters:
routeConfigurationId
- id or pattern- Returns:
- the builder
-
group
public RouteDefinition group(String name)
Set the group name for this route- Parameters:
name
- the group name- Returns:
- the builder
-
routeGroup
public RouteDefinition routeGroup(String group)
Set the route group for this route- Overrides:
routeGroup
in classProcessorDefinition<RouteDefinition>
- Parameters:
group
- the route group- Returns:
- the builder
-
routeId
public RouteDefinition routeId(String id)
Set the route id for this route- Overrides:
routeId
in classProcessorDefinition<RouteDefinition>
- Parameters:
id
- the route id- Returns:
- the builder
-
routeDescription
public RouteDefinition routeDescription(String description)
Set the route description for this route- Overrides:
routeDescription
in classProcessorDefinition<RouteDefinition>
- Parameters:
description
- the route description- Returns:
- the builder
-
nodePrefixId
public RouteDefinition nodePrefixId(String prefixId)
Sets a prefix to use for all node ids (not route id).- Overrides:
nodePrefixId
in classProcessorDefinition<RouteDefinition>
- Parameters:
prefixId
- the prefix- Returns:
- the builder
-
noStreamCaching
public RouteDefinition noStreamCaching()
Disable stream caching for this route.- Returns:
- the builder
-
streamCaching
public RouteDefinition streamCaching()
Enable stream caching for this route.- Returns:
- the builder
-
streamCaching
public RouteDefinition streamCaching(String streamCache)
Enable stream caching for this route.- Parameters:
streamCache
- whether to use stream caching (true or false), the value can be a property placeholder- Returns:
- the builder
-
noTracing
public RouteDefinition noTracing()
Disable tracing for this route.- Returns:
- the builder
-
tracing
public RouteDefinition tracing()
Enable tracing for this route.- Returns:
- the builder
-
tracing
public RouteDefinition tracing(String tracing)
Enable tracing for this route.- Parameters:
tracing
- whether to use tracing (true or false), the value can be a property placeholder- Returns:
- the builder
-
messageHistory
public RouteDefinition messageHistory()
Enable message history for this route.- Returns:
- the builder
-
messageHistory
public RouteDefinition messageHistory(String messageHistory)
Enable message history for this route.- Parameters:
messageHistory
- whether to use message history (true or false), the value can be a property placeholder- Returns:
- the builder
-
logMask
public RouteDefinition logMask()
Enable security mask for Logging on this route.- Returns:
- the builder
-
logMask
public RouteDefinition logMask(String logMask)
Sets whether security mask for logging is enabled on this route.- Parameters:
logMask
- whether to enable security mask for Logging (true or false), the value can be a property placeholder- Returns:
- the builder
-
noMessageHistory
public RouteDefinition noMessageHistory()
Disable message history for this route.- Returns:
- the builder
-
noDelayer
public RouteDefinition noDelayer()
Disable delayer for this route.- Returns:
- the builder
-
delayer
public RouteDefinition delayer(long delay)
Enable delayer for this route.- Parameters:
delay
- delay in millis- Returns:
- the builder
-
errorHandler
public RouteDefinition errorHandler(String ref)
Installs the given error handler builder.- Parameters:
ref
- reference to existing error handler- Returns:
- the current builder with the error handler configured
-
errorHandler
public RouteDefinition errorHandler(org.apache.camel.ErrorHandlerFactory errorHandlerBuilder)
Installs the given error handler builder.- Parameters:
errorHandlerBuilder
- the error handler to be used by default for all child routes- Returns:
- the current builder with the error handler configured
-
noAutoStartup
public RouteDefinition noAutoStartup()
Disables this route from being auto started when Camel starts.- Returns:
- the builder
-
autoStartup
public RouteDefinition autoStartup(String autoStartup)
Sets the auto startup property on this route.- Parameters:
autoStartup
- whether to auto startup (true or false), the value can be a property placeholder- Returns:
- the builder
-
autoStartup
public RouteDefinition autoStartup(boolean autoStartup)
Sets the auto startup property on this route.- Parameters:
autoStartup
- - boolean indicator- Returns:
- the builder
-
precondition
public RouteDefinition precondition(String precondition)
Sets the predicate of the precondition in simple language to evaluate in order to determine if this route should be included or not.- Parameters:
precondition
- the predicate corresponding to the test to evaluate.- Returns:
- the builder
-
startupOrder
public 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. Camel will stop routes in reverse order when its stopping.- Overrides:
startupOrder
in classProcessorDefinition<RouteDefinition>
- Parameters:
order
- the order represented as a number- Returns:
- the builder
-
routePolicy
public RouteDefinition routePolicy(org.apache.camel.spi.RoutePolicy... policies)
Configures route policies for this route- Parameters:
policies
- the route policies- Returns:
- the builder
-
routePolicy
public RouteDefinition routePolicy(Supplier<org.apache.camel.spi.RoutePolicy> policy)
Configures route policy for this route- Parameters:
policy
- route policy- Returns:
- the builder
-
routePolicyRef
public RouteDefinition routePolicyRef(String routePolicyRef)
Configures a route policy for this route- Parameters:
routePolicyRef
- reference to aRoutePolicy
to lookup and use. You can specify multiple references by separating using comma.- Returns:
- the builder
-
shutdownRoute
public RouteDefinition shutdownRoute(org.apache.camel.ShutdownRoute shutdownRoute)
Configures a shutdown route option.- Parameters:
shutdownRoute
- the option to use when shutting down this route- Returns:
- the builder
-
shutdownRoute
public RouteDefinition shutdownRoute(String shutdownRoute)
Configures a shutdown route option.- Parameters:
shutdownRoute
- the option to use when shutting down this route- Returns:
- the builder
-
shutdownRunningTask
public RouteDefinition shutdownRunningTask(org.apache.camel.ShutdownRunningTask shutdownRunningTask)
Configures a shutdown running task option.- Parameters:
shutdownRunningTask
- the option to use when shutting down and how to act upon running tasks.- Returns:
- the builder
-
shutdownRunningTask
public RouteDefinition shutdownRunningTask(String shutdownRunningTask)
Configures a shutdown running task option.- Parameters:
shutdownRunningTask
- the option to use when shutting down and how to act upon running tasks.- Returns:
- the builder
-
inputType
public RouteDefinition inputType(String urn)
Declare the expected data type of the input message. If the actual message type is different at runtime, camel look for a requiredTransformer
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 examplejava:java.lang.String
,json:ABCOrder
.- Parameters:
urn
- input type URN- Returns:
- the builder
- See Also:
Transformer
-
inputTypeWithValidate
public RouteDefinition inputTypeWithValidate(String urn)
Declare the expected data type of the input message with content validation enabled. If the actual message type is different at runtime, camel look for a requiredTransformer
and apply if exists, and then appliesValidator
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 examplejava:java.lang.String
,json:ABCOrder
.- Parameters:
urn
- input type URN- Returns:
- the builder
- See Also:
Transformer
,Validator
-
inputType
public RouteDefinition inputType(Class clazz)
Declare the expected data type of the input message by Java class. If the actual message type is different at runtime, camel look for a requiredTransformer
and apply if exists.- Parameters:
clazz
- Class object of the input type- Returns:
- the builder
- See Also:
Transformer
-
inputTypeWithValidate
public RouteDefinition inputTypeWithValidate(Class clazz)
Declare the expected data type of the input message by Java class with content validation enabled. If the actual message type is different at runtime, camel look for a requiredTransformer
and apply if exists, and then appliesValidator
as well.- Parameters:
clazz
- Class object of the input type- Returns:
- the builder
- See Also:
Transformer
,Validator
-
outputType
public RouteDefinition outputType(String urn)
Declare the expected data type of the output message. If the actual message type is different at runtime, camel look for a requiredTransformer
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 examplejava:java.lang.String
,json:ABCOrder
.- Parameters:
urn
- output type URN- Returns:
- the builder
- See Also:
Transformer
-
outputTypeWithValidate
public RouteDefinition outputTypeWithValidate(String urn)
Declare the expected data type of the output message with content validation enabled. If the actual message type is different at runtime, Camel look for a requiredTransformer
and apply if exists, and then appliesValidator
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 examplejava:java.lang.String
,json:ABCOrder
.- Parameters:
urn
- output type URN- Returns:
- the builder
- See Also:
Transformer
,Validator
-
outputType
public RouteDefinition outputType(Class clazz)
Declare the expected data type of the output message by Java class. If the actual message type is different at runtime, camel look for a requiredTransformer
and apply if exists.- Parameters:
clazz
- Class object of the output type- Returns:
- the builder
- See Also:
Transformer
-
outputTypeWithValidate
public RouteDefinition outputTypeWithValidate(Class clazz)
Declare the expected data type of the ouput message by Java class with content validation enabled. If the actual message type is different at runtime, camel look for a requiredTransformer
and apply if exists, and then appliesValidator
as well.- Parameters:
clazz
- Class object of the output type- Returns:
- the builder
- See Also:
Transformer
,Validator
-
routeProperty
public RouteDefinition routeProperty(String key, String value)
Adds a custom property on the route.
-
setTemplateDefaultParameters
public void setTemplateDefaultParameters(Map<String,Object> templateDefaultParameters)
-
getRouteTemplateContext
public org.apache.camel.RouteTemplateContext getRouteTemplateContext()
-
setRouteTemplateContext
public void setRouteTemplateContext(org.apache.camel.RouteTemplateContext routeTemplateContext)
-
getResource
public org.apache.camel.spi.Resource getResource()
- Specified by:
getResource
in interfaceorg.apache.camel.spi.ResourceAware
-
setResource
public void setResource(org.apache.camel.spi.Resource resource)
- Specified by:
setResource
in interfaceorg.apache.camel.spi.ResourceAware
-
getInput
public FromDefinition getInput()
- Specified by:
getInput
in interfaceorg.apache.camel.NamedRoute
-
setInput
public void setInput(FromDefinition input)
Input to the route.
-
getOutputs
public List<ProcessorDefinition<?>> getOutputs()
- Overrides:
getOutputs
in classOutputDefinition<RouteDefinition>
-
setOutputs
public void setOutputs(List<ProcessorDefinition<?>> outputs)
Outputs are processors that determines how messages are processed by this route.- Overrides:
setOutputs
in classOutputDefinition<RouteDefinition>
-
getRouteConfigurationId
public String getRouteConfigurationId()
The route configuration id or pattern this route should use for configuration. Multiple id/pattern can be separated by comma.
-
setRouteConfigurationId
public void setRouteConfigurationId(String routeConfigurationId)
The route configuration id or pattern this route should use for configuration. Multiple id/pattern can be separated by comma.
-
addAppliedRouteConfigurationId
public void addAppliedRouteConfigurationId(String routeConfigurationId)
This is used internally by Camel to keep track which route configurations is applied when creating a route from this model. This method is not intended for Camel end users.
-
getAppliedRouteConfigurationIds
public Set<String> getAppliedRouteConfigurationIds()
This is used internally by Camel to keep track which route configurations is applied when creating a route from this model. This method is not intended for Camel end users.
-
getGroup
public String getGroup()
The group that this route belongs to; could be the name of the RouteBuilder class or be explicitly configured in the XML. May be null.
-
setGroup
@Metadata(label="advanced") public 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. May be null.
-
getNodePrefixId
public String getNodePrefixId()
Prefix to use for all node ids (not route id).
-
setNodePrefixId
@Metadata(label="advanced") public void setNodePrefixId(String nodePrefixId)
Sets a prefix to use for all node ids (not route id).
-
getStreamCache
public String getStreamCache()
Whether stream caching is enabled on this route.
-
setStreamCache
@Metadata(javaType="java.lang.Boolean") public void setStreamCache(String streamCache)
Whether stream caching is enabled on this route.
-
getTrace
public String getTrace()
Whether tracing is enabled on this route.
-
setTrace
@Metadata(javaType="java.lang.Boolean") public void setTrace(String trace)
Whether tracing is enabled on this route.
-
getMessageHistory
public String getMessageHistory()
Whether message history is enabled on this route.
-
setMessageHistory
@Metadata(label="advanced", javaType="java.lang.Boolean") public void setMessageHistory(String messageHistory)
Whether message history is enabled on this route.
-
getLogMask
public String getLogMask()
Whether security mask for Logging is enabled on this route.
-
setLogMask
@Metadata(label="advanced", javaType="java.lang.Boolean") public void setLogMask(String logMask)
Whether security mask for Logging is enabled on this route.
-
getDelayer
public String getDelayer()
Whether to slow down processing messages by a given delay in msec.
-
setDelayer
@Metadata(label="advanced", javaType="java.lang.Long") public void setDelayer(String delayer)
Whether to slow down processing messages by a given delay in msec.
-
getAutoStartup
public String getAutoStartup()
Whether to auto start this route
-
setAutoStartup
@Metadata(javaType="java.lang.Boolean", defaultValue="true") public void setAutoStartup(String autoStartup)
Whether to auto start this route
-
getPrecondition
public String getPrecondition()
The predicate of the precondition in simple language to evaluate in order to determine if this route should be included or not.- Specified by:
getPrecondition
in interfacePreconditionContainer
-
setPrecondition
@Metadata(label="advanced") public void setPrecondition(String precondition)
The predicate of the precondition in simple language to evaluate in order to determine if this route should be included or not.- Specified by:
setPrecondition
in interfacePreconditionContainer
-
getStartupOrder
public Integer getStartupOrder()
To configure the ordering of the routes being started
-
setStartupOrder
@Metadata(label="advanced", javaType="java.lang.Integer") public void setStartupOrder(Integer startupOrder)
To configure the ordering of the routes being started
-
setErrorHandlerRef
public void setErrorHandlerRef(String errorHandlerRef)
Sets the bean ref name of the error handler builder to use on this route
-
getErrorHandlerRef
public String getErrorHandlerRef()
Sets the bean ref name of the error handler builder to use on this route
-
setErrorHandlerFactoryIfNull
public void setErrorHandlerFactoryIfNull(org.apache.camel.ErrorHandlerFactory errorHandlerFactory)
Sets the error handler if one is not already set
-
setRoutePolicyRef
public void setRoutePolicyRef(String routePolicyRef)
Reference to customRoutePolicy
to use by the route. Multiple policies can be configured by separating values using comma.
-
getRoutePolicyRef
public String getRoutePolicyRef()
Reference to customRoutePolicy
to use by the route. Multiple policies can be configured by separating values using comma.
-
getRoutePolicies
public List<org.apache.camel.spi.RoutePolicy> getRoutePolicies()
-
setRoutePolicies
public void setRoutePolicies(List<org.apache.camel.spi.RoutePolicy> routePolicies)
-
getShutdownRoute
public String getShutdownRoute()
-
setShutdownRoute
@Metadata(label="advanced", javaType="org.apache.camel.ShutdownRoute", defaultValue="Default", enums="Default,Defer") public void setShutdownRoute(String shutdownRoute)
To control how to shutdown the route.
-
getShutdownRunningTask
public String getShutdownRunningTask()
To control how to shutdown the route.
-
setShutdownRunningTask
@Metadata(label="advanced", javaType="org.apache.camel.ShutdownRunningTask", defaultValue="CompleteCurrentTaskOnly", enums="CompleteCurrentTaskOnly,CompleteAllTasks") public void setShutdownRunningTask(String shutdownRunningTask)
To control how to shutdown the route.
-
getErrorHandlerFactory
public org.apache.camel.ErrorHandlerFactory getErrorHandlerFactory()
-
setErrorHandlerFactory
public void setErrorHandlerFactory(org.apache.camel.ErrorHandlerFactory errorHandlerFactory)
Sets the error handler to use with processors created by this builder
-
setRest
public void setRest(Boolean rest)
-
isRest
@Metadata(label="advanced") public Boolean isRest()
-
setTemplate
public void setTemplate(Boolean template)
This route is created from a route template.
-
isTemplate
@Metadata(label="advanced") public Boolean isTemplate()
-
getRestDefinition
public RestDefinition getRestDefinition()
-
setRestDefinition
public void setRestDefinition(RestDefinition restDefinition)
-
getRestBindingDefinition
public RestBindingDefinition getRestBindingDefinition()
-
setRestBindingDefinition
public void setRestBindingDefinition(RestBindingDefinition restBindingDefinition)
-
isContextScopedErrorHandler
public boolean isContextScopedErrorHandler()
-
setInputType
@Metadata(label="advanced") public void setInputType(InputTypeDefinition inputType)
-
getInputType
public InputTypeDefinition getInputType()
-
setOutputType
@Metadata(label="advanced") public void setOutputType(OutputTypeDefinition outputType)
-
getOutputType
public OutputTypeDefinition getOutputType()
-
getRouteProperties
public List<PropertyDefinition> getRouteProperties()
-
setRouteProperties
@Metadata(label="advanced") public void setRouteProperties(List<PropertyDefinition> routeProperties)
To set metadata as properties on the route.
-
fromUri
public static RouteDefinition fromUri(String uri)
-
fromEndpoint
public static RouteDefinition fromEndpoint(org.apache.camel.Endpoint endpoint)
-
-