com.ibm.commerce.me.commands
Class RegisterRequisitionerCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.me.commands.RegisterRequisitionerCmdImpl
All Implemented Interfaces:
ECCommand, ECTargetableCommand, RegisterRequisitionerCmd, TaskCommand

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 Summary
static java.lang.String COPYRIGHT
          Copyright statement.
protected static java.lang.Object critsect
           
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.me.commands. RegisterRequisitionerCmd
defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
RegisterRequisitionerCmdImpl()
          RegisterRequisitionerCmdImpl constructor comment.
 
Method Summary
 java.lang.Integer getProtocolId()
          Gets the protocol id
  AccessVector getResources()
          Gets resources which contains organizations
 java.lang.Long getUsersId()
          Gets the userId
 boolean isRegisteredSuccessfully()
          Check if registered successfully.
 void performExecute()
          The business logic for this task command.
 void setBuyerId(long buyerId)
          Sets the buyerId (Id of the buyer org)
 void setDeptName(java.lang.String deptName)
          Sets the department name (if any) to which the requisitioner belong to.
 void setOrderStatusUrl(java.lang.String orderStatusUrl)
          Sets the orderstatusurl
 void setPostbackUrl(java.lang.String postbackUrl)
          Sets the postbackUrl
 void setProtocolId(java.lang.Integer protocol)
          Sets the requisitioner name
 void setReqId(java.lang.String reqId)
          Sets the requisitioner id
 void setReqName(java.lang.String reqName)
          Sets the buyer cookie
 void setSessionId(java.lang.String sessionId)
          Sets the buyer cookie
 void setSessionInfo( SessionInfo sessionInfo)
          Sets the sessionInfo
 void setSessionType(java.lang.String sessionType)
          Sets the session type
 void setSupplierId(long supplierId)
          Sets the supplierId
 void setUsersId(java.lang.Long userId)
          Sets the userId
 void validateParameters()
          Check whether all the required parameters are available authentication.
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

critsect

protected static java.lang.Object critsect
Constructor Detail

RegisterRequisitionerCmdImpl

public RegisterRequisitionerCmdImpl()
RegisterRequisitionerCmdImpl constructor comment.
Method Detail

getProtocolId

public java.lang.Integer getProtocolId()
Gets the protocol id
Returns:
protocolId The protocol id.

getResources

public AccessVector getResources()
                          throws ECException
Gets resources which contains organizations
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
resourceList The resource list that contains organizations.
Throws:
ECException - Rasied when any error occured.

getUsersId

public java.lang.Long getUsersId()
Gets the userId
Specified by:
getUsersId in interface RegisterRequisitionerCmd
Returns:
userId The user id

isRegisteredSuccessfully

public boolean isRegisteredSuccessfully()
Check if registered successfully. Once the command is completed, this method will be called to check whether the registration of the requisitioner is successfull.
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 check if all required parameters are correct first, if they do, then the method will try to find the requisitioner using requisitionerId, next, if requisitioner is registered then update the postbackUrl,sessionId, sessionType, the orderStatusUrl and commit the database changes.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException - Raised when application errors occured.

setBuyerId

public void setBuyerId(long buyerId)
Sets the buyerId (Id of the buyer org)
Specified by:
setBuyerId in interface RegisterRequisitionerCmd
Parameters:
buyerId - The buyer Id.

setDeptName

public void setDeptName(java.lang.String deptName)
Sets the department name (if any) to which the requisitioner belong to.
Specified by:
setDeptName in interface RegisterRequisitionerCmd
Parameters:
deptName - The department name.

setOrderStatusUrl

public void setOrderStatusUrl(java.lang.String orderStatusUrl)
Sets the orderstatusurl
Parameters:
orderStatusUrl - The order status URL.

setPostbackUrl

public void setPostbackUrl(java.lang.String postbackUrl)
Sets the postbackUrl
Specified by:
setPostbackUrl in interface RegisterRequisitionerCmd
Parameters:
postbackUrl - The URL that will be used to post back.

setProtocolId

public void setProtocolId(java.lang.Integer protocol)
Sets the requisitioner name
Specified by:
setProtocolId in interface RegisterRequisitionerCmd
Parameters:
protocol - The protocol id.

setReqId

public void setReqId(java.lang.String reqId)
Sets the requisitioner id
Specified by:
setReqId in interface RegisterRequisitionerCmd
Parameters:
reqId - The requisitioner id.

setReqName

public void setReqName(java.lang.String reqName)
Sets the buyer cookie

setSessionId

public void setSessionId(java.lang.String sessionId)
Sets the buyer cookie
Specified by:
setSessionId in interface RegisterRequisitionerCmd
Parameters:
sessionId - The buyer cookie

setSessionInfo

public void setSessionInfo(SessionInfo sessionInfo)
Sets the sessionInfo
Specified by:
setSessionInfo in interface RegisterRequisitionerCmd
Parameters:
sessionInfo - The com.ibm.commerce.me.datatype.SessionInfo.

setSessionType

public void setSessionType(java.lang.String sessionType)
Sets the session type
Parameters:
sessionType - The session type.

setSupplierId

public void setSupplierId(long supplierId)
Sets the supplierId
Specified by:
setSupplierId in interface RegisterRequisitionerCmd
Parameters:
supplierId - The supplier Id.

setUsersId

public void setUsersId(java.lang.Long userId)
Sets the userId
Parameters:
userId - The user id

validateParameters

public void validateParameters()
                        throws ECException
Check whether all the required parameters are available authentication. To see which all parameters are required for each authentication level see the comment for the class. The required parameters are: requisitionerId, buyerId and sessionInfo. requisitionerId and sessionInfo cannot be null. buyerId cannot equal to "-1".
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException.
ECException