org.openeai.afa
Class ScheduledCommandImpl


java.lang.Object

  |

  +--org.openeai.OpenEaiObject

        |

        +--org.openeai.afa.ScheduledCommandImpl

Direct Known Subclasses:
MoaGenScheduledCommand, TestSuiteScheduledCommand

public class ScheduledCommandImpl
extends OpenEaiObject

This is the parent class of all ScheduledCommands. These commands are Java components that are used to execute specific business logic associated to a given Schedule. It provides convenience methods for its decendants.

Version:
3.0 beta2 - 28 January 2003
Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)
See Also:
Schedule, ScheduledCommand

Field Summary
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
ScheduledCommandImpl(CommandConfig cConfig)
          Constructor
 
Method Summary
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.
 AppConfig getAppConfig()
          Get AppConfig associated to this command.
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  boolean getOutboundXmlValidation()
          Get outbound xml validation.
 PubSubProducer getSyncErrorPublisher()
          Get SyncErrorPublisher associated to this command.
protected  java.lang.String getSyncErrorSyncPrimedDocumentUri()
          Returns the SyncErrorSync primed document that will be used if this ScheduledCommand needs to publish a Sync-Error-Sync messages if errors occur during the execution of the command.
protected  void publishSyncError(java.lang.String action, java.util.List errors)
          This method is used to publish a Sync-Error-Sync message when/if the ScheduledCommand has any errors during processing (during the 'execute' method).
protected  void publishSyncError(java.lang.String action, java.util.List errors, java.lang.Throwable e)
          This method is used to publish a Sync-Error-Sync message when/if the ScheduledCommand has any errors during processing (during the 'execute' method).
protected  void setAppConfig(AppConfig aConfig)
          Set AppConfig associated to this command.
protected  void setInboundXmlValidation(boolean validate)
          Set inbound xml validation.
protected  void setOutboundXmlValidation(boolean validate)
          Set outbound xml validation.
protected  void setSyncErrorSyncPrimedDocumentUri(java.lang.String uri)
          Sets the SyncErrorSync primed document that will be used if this ScheduledCommand needs to publish a Sync-Error-Sync messages if errors occur during the execution of the command.
 
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

ScheduledCommandImpl


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

Method Detail

setInboundXmlValidation


protected void setInboundXmlValidation(boolean validate)
Set inbound xml validation. This is used to determine whether or not to validate the xml document as when it's first consumed. It is called in the constructor of the ScheduledCommandImpl.


getInboundXmlValidation


protected boolean getInboundXmlValidation()
Get inbound xml validation. This is used to determine whether or not to validate the xml document as when it's first consumed.

Returns:
boolean

setOutboundXmlValidation


protected void setOutboundXmlValidation(boolean validate)
Set outbound xml validation. This is used to determine whether or not to validate the xml document before it's returned or routed. It is called in the constructor of ScheduledCommandImpl.


getOutboundXmlValidation


protected boolean getOutboundXmlValidation()
Get outbound xml validation. This is used to determine whether or not to validate the xml document before it's returned or routed. It is called by commands...

Returns:
boolean

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 ScheduledCommandImpl.

Returns:
PubSubProducer

setAppConfig


protected void setAppConfig(AppConfig aConfig)
Set AppConfig associated to this command. It is called in the constructor of ScheculedCommandImpl.


getAppConfig


public final AppConfig getAppConfig()
Get AppConfig associated to this command. It is called by commands.

Returns:
AppConfig

getSyncErrorSyncPrimedDocumentUri


protected java.lang.String getSyncErrorSyncPrimedDocumentUri()
Returns the SyncErrorSync primed document that will be used if this ScheduledCommand needs to publish a Sync-Error-Sync messages if errors occur during the execution of the command.

Returns:
String the document URI to the primed Sync-Error-Sync document

setSyncErrorSyncPrimedDocumentUri


protected void setSyncErrorSyncPrimedDocumentUri(java.lang.String uri)
Sets the SyncErrorSync primed document that will be used if this ScheduledCommand needs to publish a Sync-Error-Sync messages if errors occur during the execution of the command.


publishSyncError


protected void publishSyncError(java.lang.String action,
                                java.util.List errors,
                                java.lang.Throwable e)
This method is used to publish a Sync-Error-Sync message when/if the ScheduledCommand has any errors during processing (during the 'execute' method).


publishSyncError


protected void publishSyncError(java.lang.String action,
                                java.util.List errors)
This method is used to publish a Sync-Error-Sync message when/if the ScheduledCommand has any errors during processing (during the 'execute' method).


buildError


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.

Returns:
org.openeai.moa.objects.Error the error object that gets built.

getControlArea


protected org.jdom.Element getControlArea(org.jdom.Element root)
This method looks at the document and returns the appropriate ControlArea. Since there can be three different control areas based on the message (ControlAreaRequest, ControlAreaReply and ControlAreaSync) we need to have some intelligence built in when retrieving the element from the document. Clients should never need to call this method directly.

Parameters:
root - org.jdom.Element the root element of the document
Returns:
Element the ControlArea element (may be ControlAreaRequest, ControlAreaReply or ControlAreaSync depending on the doc)


Copyright © 2002, OpenEAI Software Foundation