public class Route extends Object
Specifies the Route
including the route conditions and the routing of a
particular route for the RouterMediator
. This stores the properties of a particular
route and will be used by the RouterMedaitor
in order to route the messages.
This stores the routing path as a Target
whihc can contain either a sequence or
else and endpoint as the routing path and in the endpoint case the message will be delivered to
the specified endpoint
RouterMediator
,
Target
Modifier and Type | Field and Description |
---|---|
static int |
ROUTE_NOT_MACHING_STATE
The state of the
Route after calling the doRoute method is this
particular route over the specified message does not match the conditions specified in this
route. |
static int |
ROUTED_AND_DROPPED_STATE
The state of the
Route after calling the doRoute method is; this
particular route over the specified message matches the conditions specified in this
route and hence the message is routed, at the same time the message must not go through any
other matching routes within this router. |
static int |
ROUTED_WITH_BREAK_STATE
The state of the
Route after calling the doRoute method is; this
particular route over the specified message matches the conditions specified in this
route and hence the message is routed, and the message should not go though any more routes
within this router. |
static int |
ROUTED_WITH_CONTINUE_STATE
The state of the
Route after calling the doRoute method is; this
particular route over the specified message matches the conditions specified in this
route and hence the message is routed, but the message may go through any other matching
routes within this router for further routing. |
static int |
UNEXPECTED_ROUTING_STATE
The state of the routing, when there is an error in routing after executing the
doRoute method. |
Constructor and Description |
---|
Route() |
Modifier and Type | Method and Description |
---|---|
int |
doRoute(org.apache.synapse.MessageContext synCtx,
org.apache.synapse.SynapseLog synLog)
Routes the message in to the specified
target whihc can be one of the
sequence or else and endpoint after checking whether the conditions
specified in this route matches the provided message. |
org.apache.synapse.util.xpath.SynapseXPath |
getExpression() |
Pattern |
getMatch() |
org.apache.synapse.mediators.eip.Target |
getTarget() |
boolean |
isBreakRouter() |
boolean |
isMatching(org.apache.synapse.MessageContext synCtx,
org.apache.synapse.SynapseLog synLog)
Checks whether this route is matching for the given message or not.
|
void |
setBreakRouter(boolean breakRouter) |
void |
setExpression(org.apache.synapse.util.xpath.SynapseXPath expression) |
void |
setMatch(Pattern match) |
void |
setTarget(org.apache.synapse.mediators.eip.Target target) |
public static final int ROUTE_NOT_MACHING_STATE
The state of the Route
after calling the doRoute
method is this
particular route over the specified message does not match the conditions specified in this
route.
public static final int ROUTED_WITH_BREAK_STATE
The state of the Route
after calling the doRoute
method is; this
particular route over the specified message matches the conditions specified in this
route and hence the message is routed, and the message should not go though any more routes
within this router.
public static final int ROUTED_WITH_CONTINUE_STATE
The state of the Route
after calling the doRoute
method is; this
particular route over the specified message matches the conditions specified in this
route and hence the message is routed, but the message may go through any other matching
routes within this router for further routing.
public static final int ROUTED_AND_DROPPED_STATE
The state of the Route
after calling the doRoute
method is; this
particular route over the specified message matches the conditions specified in this
route and hence the message is routed, at the same time the message must not go through any
other matching routes within this router.
public static final int UNEXPECTED_ROUTING_STATE
The state of the routing, when there is an error in routing after executing the
doRoute
method.
public boolean isMatching(org.apache.synapse.MessageContext synCtx, org.apache.synapse.SynapseLog synLog)
Checks whether this route is matching for the given message or not. In general if the
expression
is provided without a match
then the presence of a
element or attribute in the message specified by the expression
will be taken as
matching
If both the expression
and the match
is provided then the
evaluated string value of the expression
over the message will be matched
againset the given regular expression match
to test whether the string value is
matching for the pattern or not
synCtx
- message to be matched to check the route conditionpublic int doRoute(org.apache.synapse.MessageContext synCtx, org.apache.synapse.SynapseLog synLog)
Routes the message in to the specified target
whihc can be one of the
sequence
or else and endpoint
after checking whether the conditions
specified in this route matches the provided message.
Also if this particular router specifies the breakRouter
to be false then the
specified status will be returned to not to break the route and route further matchings in
the router. Otherwise it will break the route
synCtx
- message to be routedisMatching(org.apache.synapse.MessageContext, SynapseLog)
public Pattern getMatch()
public void setMatch(Pattern match)
public org.apache.synapse.util.xpath.SynapseXPath getExpression()
public void setExpression(org.apache.synapse.util.xpath.SynapseXPath expression)
public boolean isBreakRouter()
public void setBreakRouter(boolean breakRouter)
public org.apache.synapse.mediators.eip.Target getTarget()
public void setTarget(org.apache.synapse.mediators.eip.Target target)
Copyright © 2017 WSO2. All rights reserved.