Class ColumnMatchDataRouter

java.lang.Object
org.jumpmind.symmetric.route.AbstractDataRouter
org.jumpmind.symmetric.route.ColumnMatchDataRouter
All Implemented Interfaces:
IBuiltInExtensionPoint, IExtensionPoint, IDataRouter

public class ColumnMatchDataRouter extends AbstractDataRouter implements IDataRouter, IBuiltInExtensionPoint
This data router is invoked when the router_type='column'. The router_expression is always a name value pair of a column on the table that is being synchronized to the value it should be matched with.

The value can be a constant. In the data router the value of the new data is always represented by a string so all comparisons are done in the format that SymmetricDS transmits.

The column name used for the match is the upper case column name if the current value is being compared. The upper case column name prefixed by OLD_ can be used if the comparison is being done of the old data.

For example, if the column on a table is named STATUS you can specify that you want to router when STATUS=OK by specifying such for the router_expression. If you wanted to route when only the old value for STATUS=OK you would specify OLD_STATUS=OK.

The value can also be one of the following expressions:

  1. :NODE_ID
  2. :EXTERNAL_ID
  3. :NODE_GROUP_ID
  4. :REDIRECT_NODE
  5. :{column name}
NODE_ID, EXTERNAL_ID, and NODE_GROUP_ID are instructions for the column matcher to select nodes that have a NODE_ID, EXTERNAL_ID or NODE_GROUP_ID that are equal to the value on the column.

REDIRECT_NODE is an instruction to match the specified column to a registrant_external_id on registration_redirect and return the associated registration_node_id in the list of node id to route to. For example, if the 'price' table was being routed to to a region 1 node based on the store_id, the store_id would be the external_id of a node in the registration_redirect table and the router_expression for trigger entry for the 'price' table would be 'store_id=:REDIRECT_NODE' and the router_type would be 'column'.