public interface Model
Modifier and Type | Method and Description |
---|---|
void |
addFaultToleranceConfiguration(String id,
FaultToleranceConfigurationDefinition configuration)
Adds the MicroProfile Fault Tolerance configuration
|
void |
addHystrixConfiguration(String id,
HystrixConfigurationDefinition configuration)
Adds the Hystrix configuration
|
void |
addModelLifecycleStrategy(ModelLifecycleStrategy modelLifecycleStrategy)
Adds the given model lifecycle strategy to be used.
|
void |
addResilience4jConfiguration(String id,
Resilience4jConfigurationDefinition configuration)
Adds the Resilience4j configuration
|
void |
addRestDefinitions(Collection<RestDefinition> restDefinitions,
boolean addToRoutes)
Adds a collection of rest definitions to the context
|
void |
addRouteConfiguration(RouteConfigurationDefinition routesConfiguration)
Adds a single route configuration definition to the context
|
void |
addRouteConfigurations(List<RouteConfigurationDefinition> routesConfigurations)
Adds a collection of route configuration definitions to the context
|
void |
addRouteDefinition(RouteDefinition routeDefinition)
Add a route definition to the context
Important: Each route in the same
CamelContext must have an unique route id. |
void |
addRouteDefinitions(Collection<RouteDefinition> routeDefinitions)
Adds a collection of route definitions to the context
Important: Each route in the same
CamelContext must have an unique route id. |
String |
addRouteFromTemplate(String routeId,
String routeTemplateId,
Map<String,Object> parameters)
Adds a new route from a given route template
|
String |
addRouteFromTemplate(String routeId,
String routeTemplateId,
org.apache.camel.RouteTemplateContext routeTemplateContext)
Adds a new route from a given route template
|
void |
addRouteTemplateDefinition(RouteTemplateDefinition routeTemplateDefinition)
Add a route definition to the context
Important: Each route template in the same
CamelContext must have an unique route id. |
void |
addRouteTemplateDefinitionConverter(String templateIdPattern,
RouteTemplateDefinition.Converter converter)
Add a converter to translate a
RouteTemplateDefinition to a RouteDefinition . |
void |
addRouteTemplateDefinitions(Collection<RouteTemplateDefinition> routeTemplateDefinitions)
Adds a collection of route template definitions to the context
Important: Each route in the same
CamelContext must have an unique route template id. |
void |
addServiceCallConfiguration(String serviceName,
ServiceCallConfigurationDefinition configuration)
Adds the service call configuration
|
Map<String,DataFormatDefinition> |
getDataFormats()
Gets the data formats that can be referenced in the routes.
|
FaultToleranceConfigurationDefinition |
getFaultToleranceConfiguration(String id)
Gets the MicroProfile Fault Tolerance configuration by the given name.
|
HystrixConfigurationDefinition |
getHystrixConfiguration(String id)
Gets the Hystrix configuration by the given name.
|
List<ModelLifecycleStrategy> |
getModelLifecycleStrategies()
Returns the model lifecycle strategies used to handle lifecycle notifications
|
org.apache.camel.spi.ModelReifierFactory |
getModelReifierFactory()
Gets the
ModelReifierFactory |
ProcessorDefinition<?> |
getProcessorDefinition(String id)
Gets the processor definition from any of the routes which with the given id
|
<T extends ProcessorDefinition<T>> |
getProcessorDefinition(String id,
Class<T> type)
Gets the processor definition from any of the routes which with the given id
|
Resilience4jConfigurationDefinition |
getResilience4jConfiguration(String id)
Gets the Resilience4j configuration by the given name.
|
List<RestDefinition> |
getRestDefinitions()
Returns a list of the current REST definitions
|
List<RouteConfigurationDefinition> |
getRouteConfigurationDefinitions()
Returns a list of the current route configuration definitions
|
RouteDefinition |
getRouteDefinition(String id)
Gets the route definition with the given id
|
List<RouteDefinition> |
getRouteDefinitions()
Returns a list of the current route definitions
|
Function<RouteDefinition,Boolean> |
getRouteFilter()
Gets the current route filter
|
RouteTemplateDefinition |
getRouteTemplateDefinition(String id)
Gets the route template definition with the given id
|
List<RouteTemplateDefinition> |
getRouteTemplateDefinitions()
Returns a list of the current route template definitions
|
ServiceCallConfigurationDefinition |
getServiceCallConfiguration(String serviceName)
Gets the service call configuration by the given name.
|
List<TransformerDefinition> |
getTransformers()
Gets the transformers that can be referenced in the routes.
|
List<ValidatorDefinition> |
getValidators()
Gets the validators that can be referenced in the routes.
|
void |
removeRouteDefinition(RouteDefinition routeDefinition)
Removes a route definition from the context - stopping any previously running routes if any of them are actively
running
|
void |
removeRouteDefinitions(Collection<RouteDefinition> routeDefinitions)
Removes a collection of route definitions from the context - stopping any previously running routes if any of
them are actively running
|
void |
removeRouteTemplateDefinition(RouteTemplateDefinition routeTemplateDefinition)
Removes a route template definition from the context
|
void |
removeRouteTemplateDefinitions(Collection<RouteTemplateDefinition> routeTemplateDefinitions)
Removes a collection of route template definitions from the context
|
DataFormatDefinition |
resolveDataFormatDefinition(String name)
Resolve a data format definition given its name
|
void |
setDataFormats(Map<String,DataFormatDefinition> dataFormats)
Sets the data formats that can be referenced in the routes.
|
void |
setFaultToleranceConfiguration(FaultToleranceConfigurationDefinition configuration)
Sets the default MicroProfile Fault Tolerance configuration
|
void |
setFaultToleranceConfigurations(List<FaultToleranceConfigurationDefinition> configurations)
Sets the MicroProfile Fault Tolerance configurations
|
void |
setHystrixConfiguration(HystrixConfigurationDefinition configuration)
Sets the default Hystrix configuration
|
void |
setHystrixConfigurations(List<HystrixConfigurationDefinition> configurations)
Sets the Hystrix configurations
|
void |
setModelReifierFactory(org.apache.camel.spi.ModelReifierFactory modelReifierFactory)
Sets a custom
ModelReifierFactory |
void |
setResilience4jConfiguration(Resilience4jConfigurationDefinition configuration)
Sets the default Resilience4j configuration
|
void |
setResilience4jConfigurations(List<Resilience4jConfigurationDefinition> configurations)
Sets the Resilience4j configurations
|
void |
setRouteFilter(Function<RouteDefinition,Boolean> filter)
Sets a custom route filter to use for filtering unwanted routes when routes are added.
|
void |
setRouteFilterPattern(String include,
String exclude)
Used for filtering routes routes matching the given pattern, which follows the following rules: - Match by route
id - Match by route input endpoint uri The matching is using exact match, by wildcard and regular expression as
documented by
PatternHelper.matchPattern(String, String) . |
void |
setServiceCallConfiguration(ServiceCallConfigurationDefinition configuration)
Sets the default service call configuration
|
void |
setServiceCallConfigurations(List<ServiceCallConfigurationDefinition> configurations)
Sets the service call configurations
|
void |
setTransformers(List<TransformerDefinition> transformers)
Sets the transformers that can be referenced in the routes.
|
void |
setValidators(List<ValidatorDefinition> validators)
Sets the validators that can be referenced in the routes.
|
void addModelLifecycleStrategy(ModelLifecycleStrategy modelLifecycleStrategy)
modelLifecycleStrategy
- the strategyList<ModelLifecycleStrategy> getModelLifecycleStrategies()
void addRouteConfigurations(List<RouteConfigurationDefinition> routesConfigurations)
routesConfigurations
- the route configuration(s) definition to addvoid addRouteConfiguration(RouteConfigurationDefinition routesConfiguration)
routesConfiguration
- the route configuration to addList<RouteConfigurationDefinition> getRouteConfigurationDefinitions()
List<RouteDefinition> getRouteDefinitions()
RouteDefinition getRouteDefinition(String id)
id
- id of the routevoid addRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws Exception
CamelContext
must have an unique route id. If you use
the API from CamelContext
or Model
to add routes, then any new routes which has a route id that
matches an old route, then the old route is replaced by the new route.routeDefinitions
- the route(s) definition to addException
- if the route definitions could not be added for whatever reasonvoid addRouteDefinition(RouteDefinition routeDefinition) throws Exception
CamelContext
must have an unique route id. If you use
the API from CamelContext
or Model
to add routes, then any new routes which has a route id that
matches an old route, then the old route is replaced by the new route.routeDefinition
- the route definition to addException
- if the route definition could not be added for whatever reasonvoid removeRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws Exception
routeDefinitions
- route(s) definitions to removeException
- if the route definitions could not be removed for whatever reasonvoid removeRouteDefinition(RouteDefinition routeDefinition) throws Exception
routeDefinition
- route definition to removeException
- if the route definition could not be removed for whatever reasonList<RouteTemplateDefinition> getRouteTemplateDefinitions()
RouteTemplateDefinition getRouteTemplateDefinition(String id)
id
- id of the route templatevoid addRouteTemplateDefinitions(Collection<RouteTemplateDefinition> routeTemplateDefinitions) throws Exception
CamelContext
must have an unique route template id.routeTemplateDefinitions
- the route template(s) definition to addException
- if the route template definitions could not be added for whatever reasonvoid addRouteTemplateDefinition(RouteTemplateDefinition routeTemplateDefinition) throws Exception
CamelContext
must have an unique route id.routeTemplateDefinition
- the route template definition to addException
- if the route template definition could not be added for whatever reasonvoid removeRouteTemplateDefinitions(Collection<RouteTemplateDefinition> routeTemplateDefinitions) throws Exception
routeTemplateDefinitions
- route template(s) definitions to removeException
- if the route template definitions could not be removed for whatever reasonvoid removeRouteTemplateDefinition(RouteTemplateDefinition routeTemplateDefinition) throws Exception
routeTemplateDefinition
- route template definition to removeException
- if the route template definition could not be removed for whatever reasonvoid addRouteTemplateDefinitionConverter(String templateIdPattern, RouteTemplateDefinition.Converter converter)
RouteTemplateDefinition
to a RouteDefinition
.templateIdPattern
- the route template ut to whom a pattern should eb appliedconverter
- the RouteTemplateDefinition.Converter
used to convert a
RouteTemplateDefinition
to a RouteDefinition
String addRouteFromTemplate(String routeId, String routeTemplateId, Map<String,Object> parameters) throws Exception
routeId
- the id of the new route to add (optional)routeTemplateId
- the id of the route template (mandatory)parameters
- parameters to use for the route template when creating the new routeException
- is thrown if error creating and adding the new routeString addRouteFromTemplate(String routeId, String routeTemplateId, org.apache.camel.RouteTemplateContext routeTemplateContext) throws Exception
routeId
- the id of the new route to add (optional)routeTemplateId
- the id of the route template (mandatory)routeTemplateContext
- the route template context (mandatory)Exception
- is thrown if error creating and adding the new routeList<RestDefinition> getRestDefinitions()
void addRestDefinitions(Collection<RestDefinition> restDefinitions, boolean addToRoutes) throws Exception
restDefinitions
- the rest(s) definition to addaddToRoutes
- whether the rests should also automatically be added as routesException
- if the rest definitions could not be created for whatever reasonvoid setDataFormats(Map<String,DataFormatDefinition> dataFormats)
dataFormats
- the data formatsMap<String,DataFormatDefinition> getDataFormats()
DataFormatDefinition resolveDataFormatDefinition(String name)
name
- the data format definition name or a reference to it in the Registry
ProcessorDefinition<?> getProcessorDefinition(String id)
id
- id of the processor definition<T extends ProcessorDefinition<T>> T getProcessorDefinition(String id, Class<T> type)
id
- id of the processor definitiontype
- the processor definition typeClassCastException
- is thrown if the type is not correct typevoid setValidators(List<ValidatorDefinition> validators)
validators
- the validatorsHystrixConfigurationDefinition getHystrixConfiguration(String id)
id
- id of the configuration, or null to return the default configurationvoid setHystrixConfiguration(HystrixConfigurationDefinition configuration)
configuration
- the configurationvoid setHystrixConfigurations(List<HystrixConfigurationDefinition> configurations)
configurations
- the configuration listvoid addHystrixConfiguration(String id, HystrixConfigurationDefinition configuration)
id
- name of the configurationconfiguration
- the configurationResilience4jConfigurationDefinition getResilience4jConfiguration(String id)
id
- id of the configuration, or null to return the default configurationvoid setResilience4jConfiguration(Resilience4jConfigurationDefinition configuration)
configuration
- the configurationvoid setResilience4jConfigurations(List<Resilience4jConfigurationDefinition> configurations)
configurations
- the configuration listvoid addResilience4jConfiguration(String id, Resilience4jConfigurationDefinition configuration)
id
- name of the configurationconfiguration
- the configurationFaultToleranceConfigurationDefinition getFaultToleranceConfiguration(String id)
id
- id of the configuration, or null to return the default configurationvoid setFaultToleranceConfiguration(FaultToleranceConfigurationDefinition configuration)
configuration
- the configurationvoid setFaultToleranceConfigurations(List<FaultToleranceConfigurationDefinition> configurations)
configurations
- the configuration listvoid addFaultToleranceConfiguration(String id, FaultToleranceConfigurationDefinition configuration)
id
- name of the configurationconfiguration
- the configurationList<ValidatorDefinition> getValidators()
void setTransformers(List<TransformerDefinition> transformers)
transformers
- the transformersList<TransformerDefinition> getTransformers()
ServiceCallConfigurationDefinition getServiceCallConfiguration(String serviceName)
serviceName
- name of service, or null to return the default configurationvoid setServiceCallConfiguration(ServiceCallConfigurationDefinition configuration)
configuration
- the configurationvoid setServiceCallConfigurations(List<ServiceCallConfigurationDefinition> configurations)
configurations
- the configuration listvoid addServiceCallConfiguration(String serviceName, ServiceCallConfigurationDefinition configuration)
serviceName
- name of the serviceconfiguration
- the configurationvoid setRouteFilterPattern(String include, String exclude)
PatternHelper.matchPattern(String, String)
. For example to only include routes which starts
with foo in their route id's, use: include=foo* And to exclude routes which starts from JMS endpoints, use:
exclude=jms:* Exclude takes precedence over include.include
- the include patternexclude
- the exclude patternvoid setRouteFilter(Function<RouteDefinition,Boolean> filter)
filter
- the filterFunction<RouteDefinition,Boolean> getRouteFilter()
org.apache.camel.spi.ModelReifierFactory getModelReifierFactory()
ModelReifierFactory
void setModelReifierFactory(org.apache.camel.spi.ModelReifierFactory modelReifierFactory)
ModelReifierFactory
Apache Camel