com.ibm.commerce.orderquotation.commands
Class GetCredentialsCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.orderquotation.commands.GetCredentialsCmdImpl
All Implemented Interfaces:
ECCommand, ECTargetableCommand, GetCredentialsCmd, TaskCommand

public class GetCredentialsCmdImpl
extends TaskCommandImpl
implements GetCredentialsCmd

Get the credentials (userId, password) for the calling user.

If the (UserDistributorUserId, UserDistributorPasswordEncrypted (unencrypted)) for the user is (uuuu, pppp) then the results for each example input values of (userId, password) would be:

input (userId, password) = (id, xyz)
output credentials (userId, password) = (id, xyz) - use passed in values.
input (userId, password) = (id, )
output credentials (userId, password) = (id, ) - use passed in values because id != uuuu.
input (userId, password) = (uuuu, abc)
output credentials (userId, password) = (uuuu, abc) - use passed in values.
input (userId, password) = (uuuu, )
output credentials (userId, password) = (uuuu, pppp) - use user profile password if userid matches.
input (userId, password) = (, secret)
output credentials (userId, password) = (uuuu, secret) - use user profile userid if not specified.
input (userId, password) = (, )
output credentials (userId, password) = (uuuu, pppp) - use user profile userid and password.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.orderquotation.commands. GetCredentialsCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECTargetableCommand
COPYRIGHT
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
GetCredentialsCmdImpl()
          Constructor for GetCredentialsCmdImpl
 
Method Summary
 java.lang.String getPasswordForCredentials()
          Get the password to use on the credentials.
 java.lang.String getUserIdForCredentials()
          Get the user id to use on the credentials.
 void performExecute()
          Execute the command.
 void reset()
          Resets the command.
 void setPassword(java.lang.String thePassword)
          Set the user's password.
 void setReferralStoreId(java.lang.Integer theStoreId)
          Set the referral store id for the credentials.
 void setUserId(java.lang.String theUserId)
          Set the user id.
 void validateParameters()
          Check mandatory parameters.
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetCredentialsCmdImpl

public GetCredentialsCmdImpl()
Constructor for GetCredentialsCmdImpl
Method Detail

performExecute

public void performExecute()
                    throws ECException
Execute the command.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException - These exceptions are allowed to percolate.

reset

public void reset()
Resets the command.
Overrides:
reset in class AbstractECTargetableCommand

validateParameters

public void validateParameters()
                        throws ECException
Check mandatory parameters.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECApplicationException - Raised with message _ERR_BAD_MISSING_CMD_PARAMETER if the store id is not specified.
ECException

setUserId

public void setUserId(java.lang.String theUserId)
Set the user id.
Specified by:
setUserId in interface GetCredentialsCmd
Parameters:
theUserId - (Optional) The user id. If not specified the "UserDistributorUserId" attribute of the commandContext user profile will be used.

setPassword

public void setPassword(java.lang.String thePassword)
Set the user's password.
Specified by:
setPassword in interface GetCredentialsCmd
Parameters:
thePassword - (Optional) The password. If not specified the "UserDistributorPasswordEncrypted" attribute (unencrypted) of the commandContext user profile will be used.

setReferralStoreId

public void setReferralStoreId(java.lang.Integer theStoreId)
Set the referral store id for the credentials.
Specified by:
setReferralStoreId in interface GetCredentialsCmd
Parameters:
theStoreId - The distributor's store id.

getUserIdForCredentials

public java.lang.String getUserIdForCredentials()
Get the user id to use on the credentials.
Specified by:
getUserIdForCredentials in interface GetCredentialsCmd
Returns:
The user id to use on the credentials.

getPasswordForCredentials

public java.lang.String getPasswordForCredentials()
Get the password to use on the credentials.
Specified by:
getPasswordForCredentials in interface GetCredentialsCmd
Returns:
The password to use on the credentials.