org.openeai.jms.consumer.commands
Class RequestCommandImpl

java.lang.Object
  extended by org.openeai.OpenEaiObject
      extended by org.openeai.jms.consumer.commands.ConsumerCommand
          extended by org.openeai.jms.consumer.commands.RequestCommandImpl

public class RequestCommandImpl
extends ConsumerCommand

The "default" anscestor of all RequestCommands that are executed by a 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 RequestCommand implementations. Additional common routines will be added to this layer as time goes by...

Version:
3.0 - 28 January 2003

Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)
See Also:
ConsumerCommand, RequestCommand, SyncCommandImpl, SyncCommand

Field Summary
 
Fields inherited from class org.openeai.jms.consumer.commands.ConsumerCommand
BASELINE_DATA, CREATE_ACTION, DATA_AREA, DELETE_ACTION, DELETE_DATA, logger, MESSAGE_ACTION, MESSAGE_CATEGORY, MESSAGE_OBJECT, MESSAGE_RELEASE, MESSAGE_TYPE, NEW_DATA, QUERY_ACTION, SENDER, TEST_ID, UPDATE_ACTION
 
Constructor Summary
RequestCommandImpl()
           
RequestCommandImpl(CommandConfig cConfig)
          Default constructor behavior that will apply to all RequestCommand implementations.
 
Method Summary
 java.lang.String buildReplyDocument(org.jdom.Element senderControlArea, org.jdom.Document replyDoc)
          This method is used to build a standard reply document that contains data specified by the command returning the reply (during it's 'execute' method execution).
protected  java.lang.String buildReplyDocumentWithErrors(org.jdom.Element senderControlArea, org.jdom.Document replyDoc, java.util.List errors)
          This method is used to build a reply document that contains error specified by the command returning the reply (during it's 'execute' method execution).
protected  java.lang.String buildReplyDocumentWithErrors(org.jdom.Element senderControlArea, org.jdom.Document replyDoc, java.util.List errors, java.lang.Throwable e)
          This method is used to build a reply document that contains error specified by the command returning the reply (during it's 'execute' method execution).
protected  javax.jms.Message getMessage(javax.jms.TextMessage msg, java.lang.String replyContents)
          Adds the supplied reply contents to the supplied message, and returns the message.
protected  java.util.ArrayList logErrors(java.lang.String errNumber, java.lang.String errMessage, org.jdom.Document inDoc)
           
protected  java.util.ArrayList logErrors(java.lang.String errNumber, java.lang.String errMessage, java.lang.Throwable e, org.jdom.Document inDoc)
           
 
Methods inherited from class org.openeai.jms.consumer.commands.ConsumerCommand
addAppConfig, buildError, convertToString, extractTestId, generateRelease, getAppConfig, getAppConfigs, getControlArea, getInboundXmlValidation, getMessageAction, getMessageBody, getMessageCategory, getMessageDumpDirectory, getMessageObject, getMessageRelease, getMessageType, getMsgComponents, getOutboundXmlValidation, initializeInput, setAppConfig, setInboundXmlValidation, setMessageDumpDirectory, setMsgComponents, setOutboundXmlValidation, setWriteToFile, shutdown, writeMessageToFile, writeToFile
 
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
 

Constructor Detail

RequestCommandImpl

public RequestCommandImpl()

RequestCommandImpl

public RequestCommandImpl(CommandConfig cConfig)
                   throws java.lang.InstantiationException
Default constructor behavior that will apply to all RequestCommand implementations. This is the constructor called by AppConfig/ConsumerConfig during gateway initialization. Calls the ConsumerCommand constructor.

Parameters:
cConfig - CommandConfig the CommandConfig Java object that wraps the CommandConfig Element from the deployment document.
Throws:
java.lang.InstantiationException - if errors occur during initialization.
Method Detail

getMessage

protected final javax.jms.Message getMessage(javax.jms.TextMessage msg,
                                             java.lang.String replyContents)
                                      throws CommandException
Adds the supplied reply contents to the supplied message, and returns the message.

Parameters:
msg - the message to which reply contents are to be added
replyContents - the reply contents to add to the message
Throws:
CommandException

buildReplyDocumentWithErrors

protected final java.lang.String buildReplyDocumentWithErrors(org.jdom.Element senderControlArea,
                                                              org.jdom.Document replyDoc,
                                                              java.util.List errors)
This method is used to build a reply document that contains error specified by the command returning the reply (during it's 'execute' method execution). This is the data (containing the error(s)) that will be returned to the requesting application.

Parameters:
senderControlArea - Element the control area from the message consumed by the Command. This will be used to determine the message action and Requesting message id information (the messaging component that produced the request this Command consumed).

replyDoc - Document the 'primed' reply document being returned. This will typically be either a Generic-Response-Reply document or a 'response-reply' document specific to the message object/action being processed (e.g. InstitutionalIdentity-Response-Reply).

errors - java.util.List a List of org.openeai.moa.objects.Error objects that have been built with the appropriate error number, error type and error descriptions.

buildReplyDocumentWithErrors

protected final java.lang.String buildReplyDocumentWithErrors(org.jdom.Element senderControlArea,
                                                              org.jdom.Document replyDoc,
                                                              java.util.List errors,
                                                              java.lang.Throwable e)
This method is used to build a reply document that contains error specified by the command returning the reply (during it's 'execute' method execution). This is the data (containing the error(s)) that will be returned to the requesting application. This method also accepts an Exception that can be passed that will be 'appended' to the list of errors being returned in the reply document. This method should be used if an Exception is caught during the 'execution' of the command.

Parameters:
senderControlArea - Element the control area from the message consumed by the Command. This will be used to determine the message action and Requesting message id information (the messaging component that produced the request this Command consumed).

replyDoc - Document the 'primed' reply document being returned. This will typically be either a Generic-Response-Reply document or a 'response-reply' document specific to the message object/action being processed (e.g. InstitutionalIdentity-Response-Reply).

errors - java.util.List a List of org.openeai.moa.objects.Error objects that have been built with the appropriate error number, error type and error descriptions.

e - Throwable an Exception that occurrred.

buildReplyDocument

public final java.lang.String buildReplyDocument(org.jdom.Element senderControlArea,
                                                 org.jdom.Document replyDoc)
This method is used to build a standard reply document that contains data specified by the command returning the reply (during it's 'execute' method execution). This is the data that will be returned to the requesting application. It 'augments' the current contents of the reply document passed in with dynamic ControlAreaReply information.

Parameters:
senderControlArea - Element the control area from the message consumed by the Command. This will be used to determine the message action and Requesting message id information (the messaging component that produced the request this Command consumed).

replyDoc - Document the 'primed' reply document being returned. This will typically be either a Generic-Response-Reply document or a 'response-reply' document specific to the message object/action being processed (e.g. InstitutionalIdentity-Response-Reply).

logErrors

protected java.util.ArrayList logErrors(java.lang.String errNumber,
                                        java.lang.String errMessage,
                                        java.lang.Throwable e,
                                        org.jdom.Document inDoc)

logErrors

protected java.util.ArrayList logErrors(java.lang.String errNumber,
                                        java.lang.String errMessage,
                                        org.jdom.Document inDoc)


Copyright © 2002,2003 OpenEAI Software Foundation