org.openeai.implementations.services.eas.commands
Class EnterpriseUserRequestCommand


java.lang.Object

  |

  +--org.openeai.OpenEaiObject

        |

        +--org.openeai.jms.consumer.commands.ConsumerCommand

              |

              +--org.openeai.jms.consumer.commands.RequestCommandImpl

                    |

                    +--org.openeai.implementations.services.eas.commands.EnterpriseApplicationServiceCommand

                          |

                          +--org.openeai.implementations.services.eas.commands.EnterpriseUserRequestCommand

All Implemented Interfaces:
RequestCommand

public class EnterpriseUserRequestCommand
extends EnterpriseApplicationServiceCommand
implements RequestCommand

This class implements part of the message support of the EnterpriseApplicationService.

Specifically, this command handles org.openeai.CoreApplication/EnterpriseUser/Query-Request messages and replies with an org.openeai.CoreApplication/EnterpriseUser/Provide-Reply.

1. org.openeai.CoreApplication/EnterpriseUser/Query-Request

Consults tables APPLSVC.T_NET_ID, APPLSVC.T_NET_ID_ASSIGNMENT, and APPLSVC.T_ENTERPRISE_USER to determine if an EnterpriseUser object exists for the NetId in the EnterpriseUser/Query-Request. See the retrieveEnterpriseUser method of the EnterpriseApplicationServiceCommand for details on how the EnterpriseUser is retrieved from the enterprise application service database.

If an EnterpriseUser does not exist for the NetId, it returns an org.openeai.CoreApplication/EnterpriseUser/Provide-Reply with a status of success and an empty data area as prescribed by the OpenEAI Message Protocol.

If an EnterpriseUser does exist for the NetId, it returns an org.openeai.CoreApplication/EnterpriseUser/Provide-Reply with a status of success and a data area containing the EnterpriseUser as prescribed by the OpenEAI Message Protocol.

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
provideDocumentUri yes URI for retrieving the primed org.openeai.CoreApplication/EnterpriseUser/Provide-Reply document
responseDocumentUri yes URI for retrieving the primed org.openeai.CoreMessaging/Generic/Response-Reply document

Error Messages:

Code Type Description Explanation
OpenEAI-1001 application Unsupported message object: [unsupported message object name]. This command expects '[supported message object name(s)]'. (in this case 'EnterpriseUser') Somehow the wrong message object name is getting placed into the message by the sending application or it is sending the wrong message entirely.
OpenEAI-1002 application Unsupported message action: [unsupported message action name]. This command only supports '[supported message action name(s)]'. (in this case 'query') Somehow the wrong message action name is getting placed into the message by the sending application or it is sending the wrong message entirely. This command only supports Query-Requests.
OpenEAI-1003 application Invalid query element found in the Query-Request message. This command expects '[name of the expected query object(s)]'. (in this case 'NetId') A null or inappropriate query object is getting placed into the message by the sending application or it is sending the wrong message entirely. This command only supports EnterpriseUser/Query-Request, which must have a NetId as the query object.
OpenEAI-1004 application Inauthentic request message. The request message does not appear to come from an application that is authorized to make the request. Verify that the SenderAppId and AuthUserSignature in the request message sent in match the appropriate application name and secret application signature in the EnterpriseApplicationService database (in table APPLSVC.T_APPLICATION).

More background: There are several ways to authentication messages. In the case of the EnterpriseApplicationService, administrators issue a secret signature to each application that is authorized to use the EnterpriseApplicationService in addition to all of the normal security principals and credentials that are always established for directory server and broker access. All applications that use the EnterpriseApplication configure themselves to send that secret signature in the AuthUserSignature element of the ControlArea of each message they send. The command authenticates the message by comparing the AuthUserSignature and SenderAppId in the ControlArea of each message to the EnterpriseApplicationService database, specifically APPLSVC.T_APPLICATION, which contains records identifying authorized applications with their secret signatures. For details on how request authentication is performed see the authenticateMessage(Element) method of EnterpriseApplicationServiceCommand.

OpenEAI-1005 system Error authenticating request message. The exception is: [SQLException message]. Some type of database error occurred while attempting to retrieve the application signature from the EnterpriseApplicationService database to compare it with the signature found in the message. Consult the detail of the SQLException message to get a better idea of what precisely is wrong. The database may be unavailable, there may be a problem with the query the command is using, or there may be a data error or inconsistency in the data in the EnterpriseApplicationService database.
EnterpriseApplicationService-1001 system Error retrieving the EnterpriseUser from the database. The exception is: [SQLException message]. Some type of database error occurred while attempting to retrieve the EnterpriseUser from the EnterpriseApplicationService database. Consult the detail of the SQLException message to get a better idea of what precisely is wrong. The database may be unavailable, there may be a problem with the query the command is using, or there may be a data error or inconsistency in the data in the EnterpriseApplicationService database.
EnterpriseApplicationService-1002 application Error building NetId object from the NetId element in the Query-Request message. The exception is: [EnterpriseLayoutException message]. There was an error building a NetId XmlEnterpriseObject from the NetId element used as the query object in the incoming Query-Request message. There is most likely bad data in this NetId element or its children or the element (and therefore the entire message) is not well formed and valid. Verify that the message is well formed and valid and consult the appropriate EnterpriseObjects document for the NetId object to verify that the data being passed is allowable.
EnterpriseApplicationService-1003 application Error building EnterpriseUser element from the EnterpriseUser object returned from the EnterpriseApplicationService database. The exception is: [EnterpriseLayoutException message]. There was an error serializing the EnterpriseUser XmlEnterpriseObject that was retrieved from the EnterpriseApplicationService database to an XML string to be placed into the Provide-Reply message. Verify that the EnterpriseUser object that is stored in the database for this person is well formed and has allowable values.

Version:
1.0 beta - 18 October 2002
Author:
Steve Wheat (steve@openeai.org)
See Also:
EnterpriseApplicationServiceCommand.retrieveEnterpriseUser(java.lang.String, java.lang.String), EnterpriseApplicationServiceCommand#authenticateMessage, EnterpriseApplicationServiceCommand

Field Summary
 
Fields inherited from class org.openeai.implementations.services.eas.commands.EnterpriseApplicationServiceCommand
m_allowPurge, m_connPool, m_maxIdleTime, m_provideDoc, m_responseDoc
 
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
EnterpriseUserRequestCommand(CommandConfig cConfig)
          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.implementations.services.eas.commands.EnterpriseApplicationServiceCommand
createSession, createSession, getEnterpriseId, getEnterpriseIdString, getExistingValidEnterpriseSessionId, isMessageAuthentic, isSessionValid, isSessionValid, purgeSession, purgeSession, retrieveApplicationSession, retrieveEnterpriseSession, retrieveEnterpriseUser, terminateSession, terminateSession, updateSession, updateSessionActivity, updateSessionActivity, validEnterpriseSessionExists
 
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

EnterpriseUserRequestCommand


public EnterpriseUserRequestCommand(CommandConfig cConfig)
                             throws java.lang.InstantiationException
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