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


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

Direct Known Subclasses:
ApplicationSessionRequestCommand, EnterpriseSessionRequestCommand, EnterpriseUserPermissionRequestCommand, EnterpriseUserRequestCommand

public abstract class EnterpriseApplicationServiceCommand
extends RequestCommandImpl

This class is the ancestor of EnterpriseApplicationService commands defining fields and behavior common to all EnterpriseApplicationServiceCommands.

The majority of these methods are data persistence and retrieval methods used by multiple EnterpriseApplicationService commands for persisting and retrieving data from the EnterpriseApplicationService database and directory server tree. There are also some general convenience methods that are used by multiple EnterpriseApplicationService commands.

See the EnterpriseApplicationService database generation scripts for the complete definition of the structures of the EnterpriseApplicationService database.

Version:
1.0 beta - 18 October 2002
Author:
Steve Wheat (steve@openeai.org)

Field Summary
protected  boolean m_allowPurge
           
protected  EnterpriseConnectionPool m_connPool
           
protected  long m_maxIdleTime
           
protected  org.jdom.Document m_provideDoc
           
protected  org.jdom.Document 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
EnterpriseApplicationServiceCommand(CommandConfig cConfig)
          The constructor of all EnterpriseApplicationService commands retrieves one PropertyConfig object from AppConfig by type and gets and sets the command properties using that PropertyConfig object.
 
Method Summary
protected  void createSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession entSession)
           
protected  void createSession(java.lang.String appName, org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession)
           
protected  org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.NetId getEnterpriseId(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseUser entUser)
           
protected  java.lang.String getEnterpriseIdString(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseUser entUser)
           
protected  java.lang.String getExistingValidEnterpriseSessionId(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseUser entUser)
           
protected  boolean isMessageAuthentic(org.jdom.Element eControlArea)
          This method retrieves the SenderAppId and the AuthUserSignature from the ControlArea, queries EnterpriseApplicationService database to retrieve the official secret signature issued to the application named in the message (stored in APPLSVC.T_APPLICATION.SECRET_KEY), and compares the signature that appears in the message with the official signature retrieved from the database.
protected  boolean isSessionValid(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession)
           
protected  boolean isSessionValid(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession entSession)
           
protected  void purgeSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession)
           
protected  void purgeSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession entSession)
           
protected  org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession retrieveApplicationSession(java.lang.String sAppSessionId)
           
protected  org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession retrieveEnterpriseSession(java.lang.String sEntSessionId)
           
protected  org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseUser retrieveEnterpriseUser(java.lang.String principal, java.lang.String domain)
          This method retrieves and returns an EnterpriseUser object given the pricipal and domain of a NetId that belongs to the EnterpriseUser.
protected  void terminateSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession)
           
protected  void terminateSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession entSession)
           
protected  void updateSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession baselineAppSession, org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession newAppSession)
           
protected  void updateSessionActivity(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession)
           
protected  void updateSessionActivity(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession entSession)
           
protected  boolean validEnterpriseSessionExists(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseUser entUser)
           
 
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
 

Field Detail

m_responseDoc


protected org.jdom.Document m_responseDoc

m_provideDoc


protected org.jdom.Document m_provideDoc

m_connPool


protected EnterpriseConnectionPool m_connPool

m_maxIdleTime


protected long m_maxIdleTime

m_allowPurge


protected boolean m_allowPurge
Constructor Detail

EnterpriseApplicationServiceCommand


public EnterpriseApplicationServiceCommand(CommandConfig cConfig)
                                    throws java.lang.InstantiationException
The constructor of all EnterpriseApplicationService commands retrieves one PropertyConfig object from AppConfig by type and gets and sets the command properties using that PropertyConfig object. This means that all EnterpriseApplicationService commands must have one PropertyConfig object in their deployment descriptor. The name of that PropertyConfig object is irrelevant, because it is retrieved from AppConfig by type.

This constructor also initialized the response document and provide document used in replies as well as a database connection pool to the EnterpriseApplicationService database. There must be a DbConnectionPoolConfig with the name 'EasDbPool' for each EnterpriseApplicationService command.

Method Detail

isMessageAuthentic


protected final boolean isMessageAuthentic(org.jdom.Element eControlArea)
                                    throws CommandException
This method retrieves the SenderAppId and the AuthUserSignature from the ControlArea, queries EnterpriseApplicationService database to retrieve the official secret signature issued to the application named in the message (stored in APPLSVC.T_APPLICATION.SECRET_KEY), and compares the signature that appears in the message with the official signature retrieved from the database. If the signature in the message matches the official signature, the method returns a boolean value of true. If the signature does not match the official signature it returns a boolean value of false.

The specific databse query for the official signature of the named application is:

SELECT SECRET_KEY FROM APPLSVC.T_APPLICATION WHERE APPL_NAME=?

This means that each application that desires to use EnterpriseApplicationService commands must be registered with the EnterpriseApplicationService by generating and issuing them an official signature and creating an appropriate record for them in APPLSVC.T_APPLICATION that identifies the applicaiton with its official name and records its official signature.

CommandException

retrieveEnterpriseUser


protected final org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseUser retrieveEnterpriseUser(java.lang.String principal,
                                                                                                                     java.lang.String domain)
                                                                                                              throws CommandException
This method retrieves and returns an EnterpriseUser object given the pricipal and domain of a NetId that belongs to the EnterpriseUser. The EnterpriseUser is stored as a serialized XML string in APPLSCV.T_ENTERPRISE_USER.DATA_AREA.

The specific databse query for retrieving the EnterpriseUser is:

SELECT DATA_AREA FROM APPLSVC.T_ENTERPRISE_USER WHERE INST_ID = (SELECT INST_ID FROM APPLSVC.T_NET_ID_ASSIGNMENT WHERE NET_ID_ID = (SELECT NET_ID_ID FROM APPLSVC.T_NET_ID WHERE PRINCIPAL = ? AND DOMAIN = ?) AND TERMINATED_DATE IS NULL)

If a serialized EnterpriseUser object exists for the given NetId, this method builds an EnterpriseUser object from the XML string and returns it.

CommandException

retrieveApplicationSession


protected final org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession retrieveApplicationSession(java.lang.String sAppSessionId)
                                                                                                                      throws CommandException
CommandException

retrieveEnterpriseSession


protected final org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession retrieveEnterpriseSession(java.lang.String sEntSessionId)
                                                                                                                    throws CommandException
CommandException

createSession


protected final void createSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession entSession)
                            throws CommandException
CommandException

createSession


protected final void createSession(java.lang.String appName,
                                   org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession)
                            throws CommandException
CommandException

terminateSession


protected final void terminateSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession entSession)
                               throws CommandException
CommandException

terminateSession


protected final void terminateSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession)
                               throws CommandException
CommandException

purgeSession


protected final void purgeSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession entSession)
                           throws CommandException
CommandException

purgeSession


protected final void purgeSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession)
                           throws CommandException
CommandException

updateSessionActivity


protected final void updateSessionActivity(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession entSession)
                                    throws CommandException
CommandException

updateSessionActivity


protected final void updateSessionActivity(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession)
                                    throws CommandException
CommandException

updateSession


protected final void updateSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession baselineAppSession,
                                   org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession newAppSession)
                            throws CommandException
CommandException

isSessionValid


protected final boolean isSessionValid(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession entSession)
                                throws CommandException
CommandException

isSessionValid


protected final boolean isSessionValid(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession)
                                throws CommandException
CommandException

validEnterpriseSessionExists


protected final boolean validEnterpriseSessionExists(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseUser entUser)
                                              throws CommandException
CommandException

getExistingValidEnterpriseSessionId


protected final java.lang.String getExistingValidEnterpriseSessionId(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseUser entUser)
                                                              throws CommandException
CommandException

getEnterpriseIdString


protected final java.lang.String getEnterpriseIdString(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseUser entUser)

getEnterpriseId


protected final org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.NetId getEnterpriseId(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseUser entUser)


Copyright © 2002, OpenEAI Software Foundation