public interface Model
Modifier and Type | Method and Description |
---|---|
void |
addHystrixConfiguration(String id,
HystrixConfigurationDefinition configuration)
Adds the Hystrix configuration
|
void |
addRestDefinitions(Collection<RestDefinition> restDefinitions,
boolean addToRoutes)
Adds a collection of rest definitions to the context
|
void |
addRestDefinitions(InputStream is,
boolean addToRoutes)
Adds a collection of rest 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. |
void |
addRouteDefinitions(InputStream is)
Adds a collection of route definitions to the context
Important: Each route in the same
CamelContext must have
an unique route 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.
|
HystrixConfigurationDefinition |
getHystrixConfiguration(String id)
Gets the Hystrix configuration by the given name.
|
ProcessorDefinition |
getProcessorDefinition(String id)
Gets the processor definition from any of the routes which with the given
id
|
<T extends ProcessorDefinition> |
getProcessorDefinition(String id,
Class<T> type)
Gets the processor definition from any of the routes which with the given
id
|
List<RestDefinition> |
getRestDefinitions()
Returns a list of the current REST 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
|
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
|
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 |
setHystrixConfiguration(HystrixConfigurationDefinition configuration)
Sets the default Hystrix configuration
|
void |
setHystrixConfigurations(List<HystrixConfigurationDefinition> configurations)
Sets the Hystrix 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 |
startRouteDefinitions()
Start all routes from this model.
|
List<RouteDefinition> getRouteDefinitions()
RouteDefinition getRouteDefinition(String id)
id
- id of the routevoid addRouteDefinitions(InputStream is) 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.is
- input stream with the route(s) definition to addException
- if the route definitions could not be added for
whatever reasonvoid 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<RestDefinition> getRestDefinitions()
void addRestDefinitions(InputStream is, boolean addToRoutes) throws Exception
is
- input stream with 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 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 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 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 startRouteDefinitions() throws Exception
Exception
void 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()
Apache Camel