|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.openeai.OpenEaiObject
|
+--org.openeai.jms.consumer.commands.ConsumerCommand
The "default" anscestor of all Commands that are executed by either PubSubConsumer or PointToPointConsumer.
Organizations can add an additional layer between this class and the command implementations they develop or they can even eliminate the use of this class altogether. This class provides many useful convenience methods that are commonly needed by all command implementations. Additional common routines will be added to this layer as time goes by...
RequestCommandImpl,
RequestCommand,
SyncCommandImpl,
SyncCommand| Field Summary | |
protected static java.lang.String |
CREATE_ACTION
|
protected static java.lang.String |
DELETE_ACTION
|
protected static java.lang.String |
MESSAGE_ACTION
|
protected static java.lang.String |
MESSAGE_CATEGORY
|
protected static java.lang.String |
MESSAGE_OBJECT
|
protected static java.lang.String |
MESSAGE_RELEASE
|
protected static java.lang.String |
MESSAGE_TYPE
|
protected static java.lang.String |
QUERY_ACTION
|
protected static java.lang.String |
UPDATE_ACTION
|
| Fields inherited from class org.openeai.OpenEaiObject |
logger |
| Constructor Summary | |
ConsumerCommand()
|
|
ConsumerCommand(CommandConfig cConfig)
Default constructor behavior that will apply to all command implementations. |
|
| Method Summary | |
protected void |
addAppConfig(AppConfig aConfig)
|
protected Error |
buildError(java.lang.String errType,
java.lang.String errNumber,
java.lang.String errDescription)
Builds a single Error object that can be added to the ArrayList of errors (or for any other reason) to pass to the publishSyncError method. |
protected java.lang.String |
convertToString(org.jdom.Document doc)
|
java.lang.String |
generateRelease(java.lang.String release)
Takes the release number passed in which is generally pulled from a message passed to a command and converts it into a release number that can be used for naming conventions in configuration documents. |
AppConfig |
getAppConfig()
Get AppConfig associated to this command. |
protected java.util.Vector |
getAppConfigs()
|
protected org.jdom.Element |
getControlArea(org.jdom.Element root)
This method looks at the document and returns the appropriate ControlArea. |
protected boolean |
getInboundXmlValidation()
Get inbound xml validation. |
protected java.lang.String |
getMessageAction(org.jdom.Document inDoc)
Returns the value of the 'messageAction' Attribute from the ControlArea in the Document passed in. |
java.lang.String |
getMessageBody(org.jdom.Document inDoc)
Returns the messageBody that was built during the initializeInput method call. |
protected java.lang.String |
getMessageCategory(org.jdom.Document inDoc)
Returns the value of the 'messageCategory' Attribute from the ControlArea in the Document passed in. |
protected java.lang.String |
getMessageDumpDirectory()
Returns the messageDumpDirectory variable that will be the target of the writeMessageToFile call if the command needs to write the incoming message to a file. |
protected java.lang.String |
getMessageObject(org.jdom.Document inDoc)
Returns the value of the 'messageObject' Attribute from the ControlArea in the Document passed in. |
protected java.lang.String |
getMessageRelease(org.jdom.Document inDoc)
Returns the value of the 'messageRelease' Attribute from the ControlArea in the Document passed in. |
protected java.lang.String |
getMessageType(org.jdom.Document inDoc)
Returns the value of the 'messageType' Attribute from the ControlArea in the Document passed in. |
java.util.HashMap |
getMsgComponents()
Returns the HashMap that is a list of Messaging Components (gateways) that this command needs to know about. |
protected boolean |
getOutboundXmlValidation()
Get outbound xml validation. |
protected org.jdom.Document |
initializeInput(int messageNumber,
javax.jms.Message aMessage)
Gets the message body from the JMS message passed in and creates an XML document from that data. |
protected void |
setAppConfig(AppConfig aConfig)
Set AppConfig associated to this command. |
protected void |
setInboundXmlValidation(boolean validate)
Set inbound xml validation. |
protected void |
setMessageDumpDirectory(java.lang.String dumpDir)
Sets the messageDumpDirectory variable that will be the target of the writeMessageToFile call if the command needs to write the incoming message to a file. |
void |
setMsgComponents(java.util.HashMap components)
Sets the HashMap that is a list of Messaging Components (gateways) that this command needs to know about. |
protected void |
setOutboundXmlValidation(boolean validate)
Set outbound xml validation. |
protected void |
setWriteToFile(boolean writeToFile)
Sets the writeToFile variable that will be used by the commands to determine if they should write the message to a file. |
protected void |
writeMessageToFile(java.lang.String msgObject,
org.jdom.Document doc,
java.lang.String msgDumpDir)
Used by decendant commands to serialize a message passed to the command to the file system. |
protected boolean |
writeToFile()
Returns the writeToFile variable that will be used by the commands to determine if they should write the message to a file. |
| 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 |
| Field Detail |
protected static final java.lang.String MESSAGE_ACTION
protected static final java.lang.String MESSAGE_CATEGORY
protected static final java.lang.String MESSAGE_OBJECT
protected static final java.lang.String MESSAGE_RELEASE
protected static final java.lang.String MESSAGE_TYPE
protected static final java.lang.String CREATE_ACTION
protected static final java.lang.String DELETE_ACTION
protected static final java.lang.String QUERY_ACTION
protected static final java.lang.String UPDATE_ACTION
| Constructor Detail |
public ConsumerCommand()
public ConsumerCommand(CommandConfig cConfig)
throws java.lang.InstantiationException
java.lang.InstantiationException - if errors occur during initialization.| Method Detail |
protected java.lang.String getMessageCategory(org.jdom.Document inDoc)
protected java.lang.String getMessageObject(org.jdom.Document inDoc)
protected java.lang.String getMessageAction(org.jdom.Document inDoc)
protected java.lang.String getMessageType(org.jdom.Document inDoc)
protected java.lang.String getMessageRelease(org.jdom.Document inDoc)
protected org.jdom.Document initializeInput(int messageNumber,
javax.jms.Message aMessage)
throws javax.jms.JMSException
javax.jms.JMSExceptionprotected void setMessageDumpDirectory(java.lang.String dumpDir)
protected java.lang.String getMessageDumpDirectory()
protected void setWriteToFile(boolean writeToFile)
protected boolean writeToFile()
public final java.lang.String getMessageBody(org.jdom.Document inDoc)
protected void setAppConfig(AppConfig aConfig)
public final AppConfig getAppConfig()
protected void setInboundXmlValidation(boolean validate)
protected boolean getInboundXmlValidation()
protected void setOutboundXmlValidation(boolean validate)
protected boolean getOutboundXmlValidation()
protected void addAppConfig(AppConfig aConfig)
protected java.util.Vector getAppConfigs()
public final void setMsgComponents(java.util.HashMap components)
public final java.util.HashMap getMsgComponents()
protected void writeMessageToFile(java.lang.String msgObject,
org.jdom.Document doc,
java.lang.String msgDumpDir)
throws java.io.IOException
java.io.IOException
protected Error buildError(java.lang.String errType,
java.lang.String errNumber,
java.lang.String errDescription)
protected java.lang.String convertToString(org.jdom.Document doc)
throws java.io.IOException
java.io.IOExceptionpublic final java.lang.String generateRelease(java.lang.String release)
For example, the messageRelease attribute in the message consumed is "1.0", this method will convert that to "v1_0" which is a common naming convention that's been used by many of the OpenEAI reference implementation applications/gateways. The gateway has a message object with this release appended to its name in its configuration document. For example, "BasicPerson.v1_0". Then, the command can retrieve message objects from its AppConfig without having to hard code any names etc. instead, it can rely on the contents of the message and use that information to derive the necessary name.
protected org.jdom.Element getControlArea(org.jdom.Element root)
root - org.jdom.Element the root element of the document
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||