org.openeai.implementations.gateways.simple
Class FailureRequestCommand

java.lang.Object
  |
  +--org.openeai.OpenEaiObject
        |
        +--org.openeai.jms.consumer.commands.ConsumerCommand
              |
              +--org.openeai.jms.consumer.commands.RequestCommandImpl
                    |
                    +--org.openeai.implementations.gateways.simple.FailureRequestCommand
All Implemented Interfaces:
RequestCommand

public class FailureRequestCommand
extends RequestCommandImpl
implements RequestCommand

This class replies with a status of failure and an error to any request message.

Specifically, this command handles any request message and replies with a org.openeai.CoreMessaging/Generic/Response-Reply message. This command is intended to be deployed into gateways to return a predetermined error message when the application that the gateway exposes is intentionally unavailable.

Configuration Parameters:

This command expects exactly one properties object in the command configuration with the following properties. The properties object may have any name, because it is retrieved by type.

Name Required Description
responseDocumentUri yes URI for retrieving the primed org.openeai.CoreMessaging/Generic/Response-Reply document
errorType yes The value for the Error/@type attribute that will be returned in the reply. This may have a value of 'application' or 'system' according to the OpenEAI Message Protocol.
errorNumber yes The value for the Error/ErrorNumber element that will be returned in the reply. This may have any value desired by the administrator; however, this will most likely be an OpenEAI-2000 or other appropriate error message in the standard series of OpenEAI messages that convey the unavailability of a gateway or service.
errorDescription yes The value for the Error/ErrorDescription element appropriate to the error number specified by the errorNumber property.

Error Messages:

This command is intended to provide a reply with exactly one error. It could be any error, because the error is configurable as outlined in the configuration parameters above. However, since the purpose of this command is generally to communicate the temporary, intentional unavailability of an application, gateway, or service, the error will most frequently be a variant of the following:

Code Type Description Explanation
OpenEAI-2000 application Gateway, service, or application temporarily unavailable. [Name of the gateway, service, or application] is unavailable due to [state reason] and will be available again at approximately [state next available time]. This gateway, service, or underlying application is temporarily and intentionally unavailable for reasons that should be stated in the ErrorDescription.

Version:
3.0 beta - 21 November 2002
Author:
Steve Wheat (steve@openeai.org)

Field Summary
 
Fields inherited from class org.openeai.jms.consumer.commands.ConsumerCommand
CREATE_ACTION, DELETE_ACTION, MESSAGE_ACTION, MESSAGE_CATEGORY, MESSAGE_OBJECT, MESSAGE_RELEASE, MESSAGE_TYPE, QUERY_ACTION, UPDATE_ACTION
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
FailureRequestCommand(CommandConfig cConfig)
          The constructor
 
Method Summary
 javax.jms.Message execute(int messageNumber, javax.jms.Message aMessage)
          Method used to implement business logic specific to a message or set of messages consumed by a OpenEAI PointToPointConsumer.
 
Methods inherited from class org.openeai.jms.consumer.commands.RequestCommandImpl
buildReplyDocument, buildReplyDocumentWithErrors, buildReplyDocumentWithErrors, getMessage
 
Methods inherited from class org.openeai.jms.consumer.commands.ConsumerCommand
addAppConfig, buildError, convertToString, generateRelease, getAppConfig, getAppConfigs, getControlArea, getInboundXmlValidation, getMessageAction, getMessageBody, getMessageCategory, getMessageDumpDirectory, getMessageObject, getMessageRelease, getMessageType, getMsgComponents, getOutboundXmlValidation, initializeInput, setAppConfig, setInboundXmlValidation, setMessageDumpDirectory, setMsgComponents, setOutboundXmlValidation, setWriteToFile, writeMessageToFile, writeToFile
 
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

FailureRequestCommand

public FailureRequestCommand(CommandConfig cConfig)
                      throws java.lang.InstantiationException
The constructor

Method Detail

execute

public final javax.jms.Message execute(int messageNumber,
                                       javax.jms.Message aMessage)
                                throws CommandException
Description copied from interface: RequestCommand
Method used to implement business logic specific to a message or set of messages consumed by a OpenEAI PointToPointConsumer. When a consumer consumes a message it determines which RequestCommand implementation to execute and calls this method passing the JMS Message. The command then retrieves the body of the message and converts that into an XML Document (org.jdom.Document). Then the command executes business logic appropriate to it based on the contents of the message.

Specified by:
execute in interface RequestCommand
Returns:
Message the JMS Message that should be returned to the calling application after the command has performed its business logic.

CommandException
See Also:
SyncCommand.execute


Copyright © 2002, OpenEAI Software Foundation