|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openeai.OpenEaiObject
org.openeai.jms.consumer.commands.ConsumerCommand
public class 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 |
BASELINE_DATA
|
protected static java.lang.String |
CREATE_ACTION
|
protected static java.lang.String |
DATA_AREA
|
protected static java.lang.String |
DELETE_ACTION
|
protected static java.lang.String |
DELETE_DATA
|
static org.apache.log4j.Category |
logger
|
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 |
NEW_DATA
|
protected static java.lang.String |
QUERY_ACTION
|
protected static java.lang.String |
SENDER
|
protected static java.lang.String |
TEST_ID
|
protected static java.lang.String |
UPDATE_ACTION
|
| 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)
|
protected TestId |
extractTestId(java.lang.String testIdObjectName,
org.jdom.Element eControlArea)
Returns the test ID extracted from the supplied document. |
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. |
void |
shutdown()
|
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 |
|---|
getAppName, getDebug, getFromAddr, 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 |
|---|
public static org.apache.log4j.Category logger
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
protected static final java.lang.String DATA_AREA
protected static final java.lang.String NEW_DATA
protected static final java.lang.String DELETE_DATA
protected static final java.lang.String BASELINE_DATA
protected static final java.lang.String TEST_ID
protected static final java.lang.String SENDER
| Constructor Detail |
|---|
public ConsumerCommand()
public ConsumerCommand(CommandConfig cConfig)
throws java.lang.InstantiationException
cConfig - CommandConfig the CommandConfig Java object that wraps the CommandConfig
Element from the deployment document.
java.lang.InstantiationException - if errors occur during initialization.| Method Detail |
|---|
protected java.lang.String getMessageCategory(org.jdom.Document inDoc)
inDoc - Document the Document object that was created from the JMS Message
passed to the exeucte method of the command being executed.
protected java.lang.String getMessageObject(org.jdom.Document inDoc)
inDoc - Document the Document object that was created from the JMS Message
passed to the exeucte method of the command being executed.
protected java.lang.String getMessageAction(org.jdom.Document inDoc)
inDoc - Document the Document object that was created from the JMS Message
passed to the exeucte method of the command being executed.
protected java.lang.String getMessageType(org.jdom.Document inDoc)
inDoc - Document the Document object that was created from the JMS Message
passed to the exeucte method of the command being executed.
protected java.lang.String getMessageRelease(org.jdom.Document inDoc)
inDoc - Document the Document object that was created from the JMS Message
passed to the exeucte method of the command being executed.
protected org.jdom.Document initializeInput(int messageNumber,
javax.jms.Message aMessage)
throws javax.jms.JMSException
messageNumber - intaMessage - JMS Message
javax.jms.JMSExceptionprotected void setMessageDumpDirectory(java.lang.String dumpDir)
dumpDir - Stringprotected java.lang.String getMessageDumpDirectory()
protected void setWriteToFile(boolean writeToFile)
writeToFile - booleanprotected boolean writeToFile()
public final java.lang.String getMessageBody(org.jdom.Document inDoc)
protected void setAppConfig(AppConfig aConfig)
aConfig - AppConfigpublic final AppConfig getAppConfig()
protected void setInboundXmlValidation(boolean validate)
validate - protected boolean getInboundXmlValidation()
protected void setOutboundXmlValidation(boolean validate)
validate - protected boolean getOutboundXmlValidation()
protected void addAppConfig(AppConfig aConfig)
protected java.util.Vector getAppConfigs()
public final void setMsgComponents(java.util.HashMap components)
components - HashMap a HashMap containing AppConfigs for end points of intrest to this command.
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
msgObject - String the name of the message object contained in the messagedoc - Document the XML document being serializemsgDumpDir - String the path to which the file should be written.
java.io.IOException
protected Error buildError(java.lang.String errType,
java.lang.String errNumber,
java.lang.String errDescription)
errType - String error Type ('application' or 'system')errNumber - String error NumbererrDescription - String error Description
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.
release - String the messageRelease pulled from the message (e.g. - 1.0, 2.0 etc.)
protected org.jdom.Element getControlArea(org.jdom.Element root)
root - org.jdom.Element the root element of the document
protected TestId extractTestId(java.lang.String testIdObjectName,
org.jdom.Element eControlArea)
This data is then used by the OpenEAI TestSuite Application to correlate the Sync message published to the Request message that precipitated the Sync message and verify that the appropriate Sync message is published.
testIdObjectName - the name of the TestId object as specified in this
Command's AppConfig (Configuration Element).eControlArea - the Control Area element from which to extract a test ID.
public void shutdown()
throws CommandException
CommandException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||