Package org.jumpmind.symmetric.route
Class BshDataRouter
java.lang.Object
org.jumpmind.symmetric.route.AbstractDataRouter
org.jumpmind.symmetric.route.BshDataRouter
- All Implemented Interfaces:
IBuiltInExtensionPoint
,IExtensionPoint
,IDataRouter
This data router is invoked when the router_type is 'bsh'. The router_expression is always a bean shell expression. See
the bean shell site for information about the capabilities of the bean shell scripting language.
Bound to the interpreter are the names of both the current and old column values. They can be used in the expression. They should always be referenced using
upper case. Also bound to the interpreter is a
Collection
of targetNodes. The script is expected to add the the list of target nodes a list of the
node_ids that should be routed to.-
Field Summary
FieldsFields inherited from class org.jumpmind.symmetric.route.AbstractDataRouter
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
bind
(bsh.Interpreter interpreter, DataMetaData dataMetaData, Set<Node> nodes, Set<String> targetNodes, Set<String> boundVariableNames, boolean initialLoad) protected bsh.Interpreter
getInterpreter
(SimpleRouterContext context) boolean
Override if a router is able to route non-DML DataEventTypes.routeToNodes
(SimpleRouterContext context, DataMetaData dataMetaData, Set<Node> nodes, boolean initialLoad, boolean initialLoadSelectUsed, TriggerRouter triggerRouter) Methods inherited from class org.jumpmind.symmetric.route.AbstractDataRouter
addNodeId, completeBatch, contextCommitted, getDataAsObject, getDataAsString, getDataMap, getDataObjectMap, getNewDataAsObject, getNewDataAsString, getNullData, getOldDataAsObject, getOldDataAsString, getPkDataAsObject, getPkDataAsString, isConfigurable, testColumnNamesMatchValues, toExternalIds, toNodeIds
-
Field Details
-
engine
-
-
Constructor Details
-
BshDataRouter
-
-
Method Details
-
routeToNodes
public Set<String> routeToNodes(SimpleRouterContext context, DataMetaData dataMetaData, Set<Node> nodes, boolean initialLoad, boolean initialLoadSelectUsed, TriggerRouter triggerRouter) - Specified by:
routeToNodes
in interfaceIDataRouter
-
getInterpreter
-
eval
-
bind
protected void bind(bsh.Interpreter interpreter, DataMetaData dataMetaData, Set<Node> nodes, Set<String> targetNodes, Set<String> boundVariableNames, boolean initialLoad) throws bsh.EvalError - Throws:
bsh.EvalError
-
bind
protected void bind(bsh.Interpreter interpreter, Set<String> boundVariableNames, String name, Object value) throws bsh.EvalError - Throws:
bsh.EvalError
-
isDmlOnly
public boolean isDmlOnly()Description copied from class:AbstractDataRouter
Override if a router is able to route non-DML DataEventTypes.- Specified by:
isDmlOnly
in interfaceIDataRouter
- Overrides:
isDmlOnly
in classAbstractDataRouter
-