public final class RouteDefinitionHelper extends Object
RouteDefinition
Utility methods to help preparing RouteDefinition
before they are added to
CamelContext
.Modifier and Type | Method and Description |
---|---|
static void |
forceAssignIds(CamelContext context,
List<RouteDefinition> routes)
Force assigning ids to the routes
|
static void |
forceAssignIds(CamelContext context,
ProcessorDefinition processor)
Force assigning ids to the give node and all its children (recursively).
|
static Set<String> |
gatherAllEndpointUris(CamelContext camelContext,
RouteDefinition route,
boolean includeInputs,
boolean includeOutputs,
boolean includeDynamic)
Gather all the endpoint uri's the route is using from the EIPs that has a static or dynamic endpoint defined.
|
static Set<String> |
gatherAllStaticEndpointUris(CamelContext camelContext,
RouteDefinition route,
boolean includeInputs,
boolean includeOutputs)
Gather all the endpoint uri's the route is using from the EIPs that has a static endpoint defined.
|
static void |
initParent(ProcessorDefinition parent) |
static void |
prepareRoute(ModelCamelContext context,
RouteDefinition route)
Prepares the route.
|
static void |
prepareRoute(ModelCamelContext context,
RouteDefinition route,
List<OnExceptionDefinition> onExceptions,
List<InterceptDefinition> intercepts,
List<InterceptFromDefinition> interceptFromDefinitions,
List<InterceptSendToEndpointDefinition> interceptSendToEndpointDefinitions,
List<OnCompletionDefinition> onCompletions)
Prepares the route which supports context scoped features such as onException, interceptors and onCompletions
This method does not mark the route as prepared afterwards.
|
static void |
prepareRouteForInit(RouteDefinition route,
List<ProcessorDefinition<?>> abstracts,
List<ProcessorDefinition<?>> lower) |
static void |
sanityCheckRoute(RouteDefinition route)
Sanity check the route, that it has input(s) and outputs.
|
static String |
validateUniqueIds(RouteDefinition target,
List<RouteDefinition> routes)
Validates that the target route has no duplicate id's from any of the existing routes.
|
public static Set<String> gatherAllStaticEndpointUris(CamelContext camelContext, RouteDefinition route, boolean includeInputs, boolean includeOutputs)
route
- the routeincludeInputs
- whether to include inputsincludeOutputs
- whether to include outputspublic static Set<String> gatherAllEndpointUris(CamelContext camelContext, RouteDefinition route, boolean includeInputs, boolean includeOutputs, boolean includeDynamic)
route
- the routeincludeInputs
- whether to include inputsincludeOutputs
- whether to include outputsincludeDynamic
- whether to include dynamic outputs which has been in use during routing at runtime, gathered from the RuntimeEndpointRegistry
.public static void forceAssignIds(CamelContext context, List<RouteDefinition> routes) throws Exception
context
- the camel contextroutes
- the routesException
- is thrown if error force assign ids to the routespublic static String validateUniqueIds(RouteDefinition target, List<RouteDefinition> routes)
target
- the target routeroutes
- the existing routespublic static void initParent(ProcessorDefinition parent)
public static void prepareRouteForInit(RouteDefinition route, List<ProcessorDefinition<?>> abstracts, List<ProcessorDefinition<?>> lower)
public static void prepareRoute(ModelCamelContext context, RouteDefinition route)
context
- the camel contextroute
- the routepublic static void prepareRoute(ModelCamelContext context, RouteDefinition route, List<OnExceptionDefinition> onExceptions, List<InterceptDefinition> intercepts, List<InterceptFromDefinition> interceptFromDefinitions, List<InterceptSendToEndpointDefinition> interceptSendToEndpointDefinitions, List<OnCompletionDefinition> onCompletions)
context
- the camel contextroute
- the routeonExceptions
- optional list of onExceptionsintercepts
- optional list of interceptorsinterceptFromDefinitions
- optional list of interceptFromsinterceptSendToEndpointDefinitions
- optional list of interceptSendToEndpointsonCompletions
- optional list onCompletionspublic static void sanityCheckRoute(RouteDefinition route)
route
- the routeIllegalArgumentException
- is thrown if the route is invalidpublic static void forceAssignIds(CamelContext context, ProcessorDefinition processor)
context
- the camel contextprocessor
- the nodeApache Camel