com.ibm.commerce.me.commands

Class RegisterRequisitionerCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, RegisterRequisitionerCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class RegisterRequisitionerCmdImpl
    extends TaskCommandImpl
    implements RegisterRequisitionerCmd
    This is the implementation of RegisterRequisitionerCmd. It retrieves the requisitioning user if they are already registered, and registers them as a new requisitioning user if they are not registered. The RegisterRequisitioner command is called by the PunchOutSetup and BatchOrderRequest commands after successfully authenticating the PunchOutSetupRequest and PurchaseOrderRequest messages.
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        Copyright statement.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RegisterRequisitionerCmdImpl

        public RegisterRequisitionerCmdImpl()
        The RegisterRequisitionerCmdImpl constructor calls its parents constructor.
    • Method Detail

      • getProtocolId

        public java.lang.Integer getProtocolId()
        This method gets the protocol ID.
        Returns:
        protocolId The protocol ID.
      • getUsersId

        public java.lang.Long getUsersId()
        This method gets the user ID.
        Specified by:
        getUsersId in interface RegisterRequisitionerCmd
        Returns:
        userId The user ID
      • isRegisteredSuccessfully

        public boolean isRegisteredSuccessfully()
        This method checks if a requisitioner registered successfully. Once the command is completed, this method is called to check whether the registration of the requisitioner succeeded.
        Specified by:
        isRegisteredSuccessfully in interface RegisterRequisitionerCmd
        Returns:
        true If the requisitioner is registered successfully; false otherwise.
      • performExecute

        public void performExecute()
                            throws ECException
        The business logic for this task command. This method will verify the required parameters and then lookup the requisitioner using the requisitioner ID. If the requisitioner is registered then update the postbackUrl, sessionId, sessionType, orderStatusUrl and commit the database changes.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException - Raised when application errors occur.
      • setBuyerId

        public void setBuyerId(long aBuyerId)
        This method sets the buyer ID (ID of the buyer organization).
        Specified by:
        setBuyerId in interface RegisterRequisitionerCmd
        Parameters:
        aBuyerId - The buyer ID.
      • setDeptName

        public void setDeptName(java.lang.String aDeptName)
        This method sets the department name (if any) to which the requisitioner belongs to.
        Specified by:
        setDeptName in interface RegisterRequisitionerCmd
        Parameters:
        aDeptName - The department name.
      • setOrderStatusUrl

        public void setOrderStatusUrl(java.lang.String anOrderStatusUrl)
        This method sets the order status URL.
        Parameters:
        anOrderStatusUrl - The order status URL.
      • setPostbackUrl

        public void setPostbackUrl(java.lang.String aPostbackUrl)
        This method sets the postback URL.
        Specified by:
        setPostbackUrl in interface RegisterRequisitionerCmd
        Parameters:
        aPostbackUrl - The URL to use to post back.
      • setProtocolId

        public void setProtocolId(java.lang.Integer aProtocol)
        This method sets the protocol ID.
        Specified by:
        setProtocolId in interface RegisterRequisitionerCmd
        Parameters:
        aProtocol - The requisitioner name.
      • setReqId

        public void setReqId(java.lang.String aReqId)
        This method sets the requisitioner ID.
        Specified by:
        setReqId in interface RegisterRequisitionerCmd
        Parameters:
        aReqId - The requisitioner ID.
      • setReqName

        public void setReqName(java.lang.String aReqName)
        This method sets the requisitioner name.
        Parameters:
        aReqName - The buyer cookie.
      • setSessionId

        public void setSessionId(java.lang.String aSessionId)
        This method sets the session ID.
        Specified by:
        setSessionId in interface RegisterRequisitionerCmd
        Parameters:
        aSessionId - The buyer cookie
      • setSessionType

        public void setSessionType(java.lang.String aSessionType)
        This method sets the session type.
        Parameters:
        aSessionType - The session type.
      • setSupplierId

        public void setSupplierId(long aSupplierId)
        This method sets the supplier ID.
        Specified by:
        setSupplierId in interface RegisterRequisitionerCmd
        Parameters:
        aSupplierId - The supplier ID.
      • setUsersId

        public void setUsersId(java.lang.Long aUserId)
        This method sets the user ID.
        Parameters:
        aUserId - The user ID.
      • validateParameters

        public void validateParameters()
                                throws ECException
        This method checks whether all the required parameters are available for authentication. To view the required parameters for each authentication level, see the comments for the class. The required parameters are: requisitionerId, buyerId, and sessionInfo. The requisitionerId and sessionInfo cannot be null. The buyerId cannot equal "-1".

        Specified by:
        validateParameters in interface ECCommand
        Overrides:
        validateParameters in class AbstractECTargetableCommand
        Throws:
        ECException - Raised when there is no reqId parameter provided to this command.