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
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 voidaddAppliedRouteConfigurationId(String routeConfigurationId)This is used internally by Camel to keep track which route configurations is applied when creating a route from this model.RouteDefinitionautoStartup(boolean autoStartup)Sets the auto startup property on this route.RouteDefinitionautoStartup(String autoStartup)Sets the auto startup property on this route.RouteDefinitiondelayer(long delay)Enable delayer for this route.RouteDefinitionerrorHandler(String ref)Installs the given error handler builder.RouteDefinitionerrorHandler(org.apache.camel.ErrorHandlerFactory errorHandlerBuilder)Installs the given error handler builder.RouteDefinitionfrom(String uri)Creates an input to the routeRouteDefinitionfrom(EndpointConsumerBuilder endpoint)Creates an input to the routeRouteDefinitionfrom(org.apache.camel.Endpoint endpoint)Creates an input to the routestatic RouteDefinitionfromEndpoint(org.apache.camel.Endpoint endpoint)voidfromRest(String uri)This route is created from the REST DSL.static RouteDefinitionfromUri(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.StringgetAutoStartup()Whether to auto start this routeStringgetDelayer()Whether to slow down processing messages by a given delay in msec.StringgetEndpointUrl()org.apache.camel.ErrorHandlerFactorygetErrorHandlerFactory()StringgetErrorHandlerRef()Sets the bean ref name of the error handler builder to use on this routeStringgetGroup()The group that this route belongs to; could be the name of the RouteBuilder class or be explicitly configured in the XML.FromDefinitiongetInput()InputTypeDefinitiongetInputType()StringgetLabel()Returns a label to describe this node such as the expression if some kind of expression nodeStringgetLogMask()Whether security mask for Logging is enabled on this route.StringgetMessageHistory()Whether message history is enabled on this route.List<ProcessorDefinition<?>>getOutputs()OutputTypeDefinitiongetOutputType()StringgetPrecondition()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.ResourcegetResource()RestBindingDefinitiongetRestBindingDefinition()RestDefinitiongetRestDefinition()StringgetRouteConfigurationId()The route configuration id or pattern this route should use for configuration.StringgetRouteId()List<org.apache.camel.spi.RoutePolicy>getRoutePolicies()StringgetRoutePolicyRef()Reference to customRoutePolicyto use by the route.List<PropertyDefinition>getRouteProperties()org.apache.camel.RouteTemplateContextgetRouteTemplateContext()StringgetShortName()StringgetShutdownRoute()StringgetShutdownRunningTask()To control how to shutdown the route.IntegergetStartupOrder()To configure the ordering of the routes being startedStringgetStreamCache()Whether stream caching is enabled on this route.Map<String,Object>getTemplateParameters()StringgetTrace()Whether tracing is enabled on this route.RouteDefinitiongroup(String name)Set the group name for this routeRouteDefinitioninputType(Class clazz)Declare the expected data type of the input message by Java class.RouteDefinitioninputType(String urn)Declare the expected data type of the input message.RouteDefinitioninputTypeWithValidate(Class clazz)Declare the expected data type of the input message by Java class with content validation enabled.RouteDefinitioninputTypeWithValidate(String urn)Declare the expected data type of the input message with content validation enabled.booleanisContextScopedErrorHandler()booleanisPrepared()Check if the route has been preparedBooleanisRest()BooleanisTemplate()RouteDefinitionlogMask()Enable security mask for Logging on this route.RouteDefinitionlogMask(String logMask)Sets whether security mask for logging is enabled on this route.voidmarkPrepared()Marks the route definition as prepared.voidmarkUnprepared()Marks the route definition as un-prepared.RouteDefinitionmessageHistory()Enable message history for this route.RouteDefinitionmessageHistory(String messageHistory)Enable message history for this route.RouteDefinitionnoAutoStartup()Disables this route from being auto started when Camel starts.RouteDefinitionnoDelayer()Disable delayer for this route.RouteDefinitionnoMessageHistory()Disable message history for this route.RouteDefinitionnoStreamCaching()Disable stream caching for this route.RouteDefinitionnoTracing()Disable tracing for this route.RouteDefinitionoutputType(Class clazz)Declare the expected data type of the output message by Java class.RouteDefinitionoutputType(String urn)Declare the expected data type of the output message.RouteDefinitionoutputTypeWithValidate(Class clazz)Declare the expected data type of the ouput message by Java class with content validation enabled.RouteDefinitionoutputTypeWithValidate(String urn)Declare the expected data type of the output message with content validation enabled.RouteDefinitionprecondition(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.voidresetPrepare()Reset internal state before preparing routeRouteDefinitionrouteConfigurationId(String routeConfigurationId)The route configuration id or pattern this route should use for configuration.RouteDefinitionrouteDescription(String description)Set the route description for this routeRouteDefinitionrouteGroup(String group)Set the route group for this routeRouteDefinitionrouteId(String id)Set the route id for this routeRouteDefinitionroutePolicy(Supplier<org.apache.camel.spi.RoutePolicy> policy)Configures route policy for this routeRouteDefinitionroutePolicy(org.apache.camel.spi.RoutePolicy... policies)Configures route policies for this routeRouteDefinitionroutePolicyRef(String routePolicyRef)Configures a route policy for this routeRouteDefinitionrouteProperty(String key, String value)Adds a custom property on the route.voidsetAutoStartup(String autoStartup)Whether to auto start this routevoidsetDelayer(String delayer)Whether to slow down processing messages by a given delay in msec.voidsetErrorHandlerFactory(org.apache.camel.ErrorHandlerFactory errorHandlerFactory)Sets the error handler to use with processors created by this buildervoidsetErrorHandlerFactoryIfNull(org.apache.camel.ErrorHandlerFactory errorHandlerFactory)Sets the error handler if one is not already setvoidsetErrorHandlerRef(String errorHandlerRef)Sets the bean ref name of the error handler builder to use on this routevoidsetGroup(String group)The group that this route belongs to; could be the name of the RouteBuilder class or be explicitly configured in the XML.voidsetInput(FromDefinition input)Input to the route.voidsetInputType(InputTypeDefinition inputType)voidsetLogMask(String logMask)Whether security mask for Logging is enabled on this route.voidsetMessageHistory(String messageHistory)Whether message history is enabled on this route.voidsetOutputs(List<ProcessorDefinition<?>> outputs)Outputs are processors that determines how messages are processed by this route.voidsetOutputType(OutputTypeDefinition outputType)voidsetPrecondition(String precondition)The predicate of the precondition in simple language to evaluate in order to determine if this route should be included or not.voidsetResource(org.apache.camel.spi.Resource resource)voidsetRest(Boolean rest)voidsetRestBindingDefinition(RestBindingDefinition restBindingDefinition)voidsetRestDefinition(RestDefinition restDefinition)voidsetRouteConfigurationId(String routeConfigurationId)The route configuration id or pattern this route should use for configuration.voidsetRoutePolicies(List<org.apache.camel.spi.RoutePolicy> routePolicies)voidsetRoutePolicyRef(String routePolicyRef)Reference to customRoutePolicyto use by the route.voidsetRouteProperties(List<PropertyDefinition> routeProperties)To set metadata as properties on the route.voidsetRouteTemplateContext(org.apache.camel.RouteTemplateContext routeTemplateContext)voidsetShutdownRoute(String shutdownRoute)To control how to shutdown the route.voidsetShutdownRunningTask(String shutdownRunningTask)To control how to shutdown the route.voidsetStartupOrder(Integer startupOrder)To configure the ordering of the routes being startedvoidsetStreamCache(String streamCache)Whether stream caching is enabled on this route.voidsetTemplate(Boolean template)This route is created from a route template.voidsetTemplateParameters(Map<String,Object> templateParameters)voidsetTrace(String trace)Whether tracing is enabled on this route.RouteDefinitionshutdownRoute(String shutdownRoute)Configures a shutdown route option.RouteDefinitionshutdownRoute(org.apache.camel.ShutdownRoute shutdownRoute)Configures a shutdown route option.RouteDefinitionshutdownRunningTask(String shutdownRunningTask)Configures a shutdown running task option.RouteDefinitionshutdownRunningTask(org.apache.camel.ShutdownRunningTask shutdownRunningTask)Configures a shutdown running task option.RouteDefinitionstartupOrder(int order)Configures the startup order for this routeRouteDefinitionstreamCaching()Enable stream caching for this route.RouteDefinitionstreamCaching(String streamCache)Enable stream caching for this route.StringtoString()RouteDefinitiontracing()Enable tracing for this route.RouteDefinitiontracing(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, 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, 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, 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:
toStringin classOutputDefinition<RouteDefinition>
-
getShortName
public String getShortName()
- Specified by:
getShortNamein interfaceorg.apache.camel.NamedNode- Overrides:
getShortNamein classOutputDefinition<RouteDefinition>
-
getLabel
public String getLabel()
Description copied from class:ProcessorDefinitionReturns a label to describe this node such as the expression if some kind of expression node- Specified by:
getLabelin interfaceorg.apache.camel.NamedNode- Overrides:
getLabelin classProcessorDefinition<RouteDefinition>
-
getRouteId
public String getRouteId()
- Specified by:
getRouteIdin interfaceorg.apache.camel.NamedRoute
-
getEndpointUrl
public String getEndpointUrl()
- Specified by:
getEndpointUrlin 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:
routeGroupin classProcessorDefinition<RouteDefinition>- Parameters:
group- the route group- Returns:
- the builder
-
routeId
public RouteDefinition routeId(String id)
Set the route id for this route- Overrides:
routeIdin classProcessorDefinition<RouteDefinition>- Parameters:
id- the route id- Returns:
- the builder
-
routeDescription
public RouteDefinition routeDescription(String description)
Set the route description for this route- Overrides:
routeDescriptionin classProcessorDefinition<RouteDefinition>- Parameters:
description- the route description- 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:
startupOrderin 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 aRoutePolicyto 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 requiredTransformerand 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 requiredTransformerand apply if exists, and then appliesValidatoras 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 requiredTransformerand 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 requiredTransformerand apply if exists, and then appliesValidatoras 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 requiredTransformerand 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 requiredTransformerand apply if exists, and then appliesValidatoras 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 requiredTransformerand 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 requiredTransformerand apply if exists, and then appliesValidatoras 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.
-
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:
getResourcein interfaceorg.apache.camel.spi.ResourceAware
-
setResource
public void setResource(org.apache.camel.spi.Resource resource)
- Specified by:
setResourcein interfaceorg.apache.camel.spi.ResourceAware
-
getInput
public FromDefinition getInput()
- Specified by:
getInputin interfaceorg.apache.camel.NamedRoute
-
setInput
public void setInput(FromDefinition input)
Input to the route.
-
getOutputs
public List<ProcessorDefinition<?>> getOutputs()
- Overrides:
getOutputsin classOutputDefinition<RouteDefinition>
-
setOutputs
public void setOutputs(List<ProcessorDefinition<?>> outputs)
Outputs are processors that determines how messages are processed by this route.- Overrides:
setOutputsin 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.
-
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", defaultValue="true") 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:
getPreconditionin 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:
setPreconditionin 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 customRoutePolicyto use by the route. Multiple policies can be configured by separating values using comma.
-
getRoutePolicyRef
public String getRoutePolicyRef()
Reference to customRoutePolicyto 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)
-
-