org.openeai.implementations.gateways.transroutergateway
Class TransRouterCommand


java.lang.Object

  |

  +--org.openeai.OpenEaiObject

        |

        +--org.openeai.jms.consumer.commands.ConsumerCommand

              |

              +--org.openeai.jms.consumer.commands.SyncCommandImpl

                    |

                    +--org.openeai.implementations.gateways.transroutergateway.TransRouterCommand

All Implemented Interfaces:
SyncCommand

public class TransRouterCommand
extends SyncCommandImpl
implements SyncCommand

OpenEAI Reference Implementation Enterprise Router.

The gateway consumes all synchronization messages published by authoritative systems and routes those messages to all interested end-points by executing this command.

These are the configuration parameters associated to this command. These are specified the Command's Configuration element in the deployment document associated to the gateway.

Property Name Required Description
ProducerConfigs yes This is the Sync-Error-Sync publisher that the Router will use when/if there are any errors while processing a message it consumes. It should be configured accordingly. All SyncCommand implementations require a PubSubProducer that must be named 'SyncErrorPublisher' that they use to publish Sync-Error-Sync message if errors occur when they're processing the message. This is useful for SyncCommand implementations in particular because they're generally ran unattended.
PropertyConfigs yes These are the properties that are used by the Sync-Error-Sync publisher they are required by all SyncCommand implementations. The name of the PropertyConfig must be 'SyncErrorSyncProperties' and they must include the 'SyncErrorSyncPrimedDocumentUri' property that points to a Sync-Error-Sync primed document.

The following configuration paramaters associated to the Enterprise Router command establish resources that will be used to route the messages consumed by the gateway to the appropriate end-points.

Property Name Required Description
MessagingComponents yes This is a container Element that provides a mechanism for specifying which MessageGateways will be routed to. It simply contains one or more MessageGateway Elements which are used by this command to establish AppConfig objects associated to each end-point. The AppConfig objects that get established will contain all the resources needed to route the messages to the end-points appropriately.
MessageGateway yes This Element is used to specify the name of the target gateway that will be routed to. It is also a container for the Configuration Element which is implemented by the AppConfig Java object and contains all initialized resources required to route the messages to the end points. The "id" attribute is used to specify the name of the end point. The Description element is used to provide a description of the end point. There should be a MessageGateway Element specified for each end-point that should be routed to.
Configuration yes This Element is implmemented by the AppConfig java object. This is the same configuration Element used by all other messaging components that use an AppConfig. This will contain the resources required to route to end points. Those resources include:
  • ProducerConfigs - PubSubProducers that are connected to the end-point's destination (Topic). This producer will be used to route the message. Additional producers could be specified here if needed. Additional producers could be needed by the RoutingCriteria class that gets executed to perform "content based" routing. If needed, they would be specified and configured here.
  • MessageObjectConfigs - This would be a list of all Message Objects that the end point is interested in. The router will retrieve the messageObject (e.g. - BasicPerson, BasicEmployee etc.) and messageRelease (e.g. - 1.0, 1.1 etc.) from the message consumed by the gateway and use that information to build a message object name that looks like this "BasicPerson.v1_0". If the end point's configuration contains a message object by that name, the router may route the message to that end point depending on whether or not the end-point has an Routing Criteria (content based routing rules) associated to it.
  • PropertyConfigs - These are a set of properties associated to the end point. There must be one PropertyConfig object named 'RoutingProperties' that this command uses to make decisions about how/if it should route to the end point. The Properties that may exist in this PropertyConfig element are:

    Property Name Required Description
    routeToTarget (true|false) no (default=true) This property is used to determine if the command should route to the end-point at all.
    provideTargetAppName (true|false) no (default=true) If true, the TargetInfo Element of the message routed by this command will include the name of the application that published the message.
    provideSourceControlArea (true|false) no (default=false) If true, the message that the command routes to the end-point will include the ControlAreaSync Element from the original message published by the authoritative source. This can be useful if the end-point wants to know the originating information such as the time stamp when the message was originally published.
    dumpOutput (true|false) no (default=false) If true, the router will dump the contents of the message it's routing prior to routing it. All commands have the ability dump the message consumed by the gateway. However, this is a little different in that it's actually going to dump the message that results from the routing process prior to routing it. This is generally something that should only be turned on during development/testing or when additional information is needed regarding the activities of the router.
    routingCriteriaClass.1-n no These properties are used to specify RoutingCriteriaCommand implementations that should be used to determine, based on content and other factors, if the message should be routed to the end point. Multiple classes may be specified, using "dot" notation, or some other distinguishing technique, in the name of the class. They will be executed in the order they're specified. Note, they are NOT currently executed based on the number to the right of the "dot". That is simply a technique used to specify multiple RoutingCriteria classes.

    If a routing criteria class(es) exist, this command will call the 'shouldRoute' method on the RoutingCriteriaCommand implementations passing the AppConfig object associated to the end-point and the XML Document built from the JMS Message consumed. Then, that RoutingCriteriaCommand can do whatever it likes to determine if the end point is interested in this message. This may include things a simple as verifying certain data items in the message or it may be something as complex as querying other authoritative sources for additional information that may not be supplied in the message consumed. These RoutingCriteriaCommands are intended to be very specific to the end point in question.

Version:
1.0 beta - 10 October 2002
Author:
Tod Jackson (tod@openeai.org)
See Also:
AppConfig, LoggerConfig, ConsumerConfig, CommandConfig, ProducerConfig, MessageObjectConfig, RoutingCriteriaCommand, RoutingCriteriaCommand.shouldRoute(AppConfig, Document)

Field Summary
 
Fields inherited from class org.openeai.jms.consumer.commands.ConsumerCommand
CREATE_ACTION, DELETE_ACTION, MESSAGE_ACTION, MESSAGE_CATEGORY, MESSAGE_OBJECT, MESSAGE_RELEASE, MESSAGE_TYPE, QUERY_ACTION, UPDATE_ACTION
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
TransRouterCommand(CommandConfig cConfig)
          Constructor
 
Method Summary
 void execute(int messageNumber, javax.jms.Message aMessage)
          Method used to implement business logic specific to a message or set of messages consumed by a OpenEAI PubSubConsumer or PointToPointConsumer.
 
Methods inherited from class org.openeai.jms.consumer.commands.SyncCommandImpl
getSyncErrorPublisher, getSyncErrorSyncDoc, getSyncErrorSyncPrimedDocumentUri, publishSyncError, publishSyncError, setSyncErrorSyncDoc, setSyncErrorSyncPrimedDocumentUri
 
Methods inherited from class org.openeai.jms.consumer.commands.ConsumerCommand
addAppConfig, buildError, convertToString, generateRelease, getAppConfig, getAppConfigs, getControlArea, getInboundXmlValidation, getMessageAction, getMessageBody, getMessageCategory, getMessageDumpDirectory, getMessageObject, getMessageRelease, getMessageType, getMsgComponents, getOutboundXmlValidation, initializeInput, setAppConfig, setInboundXmlValidation, setMessageDumpDirectory, setMsgComponents, setOutboundXmlValidation, setWriteToFile, writeMessageToFile, writeToFile
 
Methods inherited from class org.openeai.OpenEaiObject
addLog4jProperty, getAppName, getDebug, getFromAddr, getLog4jProperties, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setAppName, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransRouterCommand


public TransRouterCommand(CommandConfig cConfig)
                   throws java.lang.InstantiationException
Constructor

Method Detail

execute


public void execute(int messageNumber,
                    javax.jms.Message aMessage)
             throws CommandException
Description copied from interface: SyncCommand
Method used to implement business logic specific to a message or set of messages consumed by a OpenEAI PubSubConsumer or PointToPointConsumer. When a consumer consumes a message it determines which SyncCommand implementation to execute and calls this method passing the JMS Message. The command then retrieves the body of the message and converts that into an XML Document (org.jdom.Document). Then the command executes business logic appropriate to it based on the contents of the message.

Specified by:
execute in interface SyncCommand
Returns:
void

CommandException
See Also:
RequestMessage.execute


Copyright © 2002, OpenEAI Software Foundation