org.openeai.jms.consumer.commands
Class SyncCommandImpl

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

public class SyncCommandImpl
extends ConsumerCommand

The "default" anscestor of all SyncCommands that are executed by a PubSubConsumer.

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, RequestCommandImpl, 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
SyncCommandImpl()
           
SyncCommandImpl(CommandConfig cConfig)
          Default constructor behavior that will apply to all SyncCommand implementations.
 
Method Summary
 PubSubProducer getSyncErrorPublisher()
          Get SyncErrorPublisher associated to this command.
 org.jdom.Document getSyncErrorSyncDoc()
          Returns the Sync-Error-Sync primed Document object built from the SyncErrorSyncPrimedDocument URI that will be used as the primed sync error sync Document used as a starting point when publishing Sync errors.
protected  java.lang.String getSyncErrorSyncPrimedDocumentUri()
          Returns the Sync-Error-Sync primed document URI that will be used to build the primed sync error sync Document used as a starting point when publishing Sync errors.
protected  void publishSyncError(org.jdom.Element senderControlArea, java.util.List errors)
          This method is used to publish a Sync-Error-Sync message when/if the Command has any errors during processing (during the 'execute' method).
protected  void publishSyncError(org.jdom.Element senderControlArea, java.util.List errors, java.lang.Throwable e)
          This method is used to publish a Sync-Error-Sync message when/if the Command has any errors during processing (during the 'execute' method).
 void setSyncErrorSyncDoc(org.jdom.Document doc)
          Sets the Sync-Error-Sync primed Document object built from the SyncErrorSyncPrimedDocument URI that will be used as the primed sync error sync Document used as a starting point when publishing Sync errors.
protected  void setSyncErrorSyncPrimedDocumentUri(java.lang.String uri)
          Sets the Sync-Error-Sync primed document URI that will be used to build the primed sync error sync Document used as a starting point when publishing Sync errors.
 
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

SyncCommandImpl

public SyncCommandImpl()

SyncCommandImpl

public SyncCommandImpl(CommandConfig cConfig)
                throws java.lang.InstantiationException
Default constructor behavior that will apply to all SyncCommand implementations. This is the constructor called by AppConfig/ConsumerConfig during gateway initialization. Calls the ConsumerCommand constructor. Additionally, this constructor verifies that the SyncCommand implementation being initialized contains the appropriate SyncErrorPublisher and SyncErrorSyncProperties objects in the CommandConfig object passed in.

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

getSyncErrorSyncPrimedDocumentUri

protected final java.lang.String getSyncErrorSyncPrimedDocumentUri()
Returns the Sync-Error-Sync primed document URI that will be used to build the primed sync error sync Document used as a starting point when publishing Sync errors.

Returns:
String the URI.

setSyncErrorSyncPrimedDocumentUri

protected final void setSyncErrorSyncPrimedDocumentUri(java.lang.String uri)
Sets the Sync-Error-Sync primed document URI that will be used to build the primed sync error sync Document used as a starting point when publishing Sync errors.

Parameters:
uri - String the URI.

setSyncErrorSyncDoc

public final void setSyncErrorSyncDoc(org.jdom.Document doc)
Sets the Sync-Error-Sync primed Document object built from the SyncErrorSyncPrimedDocument URI that will be used as the primed sync error sync Document used as a starting point when publishing Sync errors.

Parameters:
doc - Document the primed sync error document

getSyncErrorSyncDoc

public final org.jdom.Document getSyncErrorSyncDoc()
Returns the Sync-Error-Sync primed Document object built from the SyncErrorSyncPrimedDocument URI that will be used as the primed sync error sync Document used as a starting point when publishing Sync errors.

Returns:
Document the primed sync error document

getSyncErrorPublisher

public final PubSubProducer getSyncErrorPublisher()
Get SyncErrorPublisher associated to this command. It is called by commands when they need to publish a sync error via the publishSyncError method also defined in Command.

Returns:
PubSubProducer

publishSyncError

protected final void publishSyncError(org.jdom.Element senderControlArea,
                                      java.util.List errors,
                                      java.lang.Throwable e)
This method is used to publish a Sync-Error-Sync message when/if the Command has any errors during processing (during the 'execute' method).

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 published the message this Command consumed).

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 has occurred in the ScheduledCommand. This exception will be added to the list of errors passed in.

publishSyncError

protected final void publishSyncError(org.jdom.Element senderControlArea,
                                      java.util.List errors)
This method is used to publish a Sync-Error-Sync message when/if the Command has any errors during processing (during the 'execute' method).

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 published the message this Command consumed).

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.


Copyright © 2002,2003 OpenEAI Software Foundation