com.ibm.commerce.security.commands
Class ResetPasswordCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.security.commands.ResetPasswordCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, ResetPasswordCmd

public class ResetPasswordCmdImpl
extends ControllerCommandImpl
implements ResetPasswordCmd

This controller command is used to reset the password of a user.

Before executing this task command run the following set commands:

If the user is currently logged into the system, to reset their password the following set methods should be invoked before calling execute on the command.

    setLogonPassword
    setLogonPasswordOld
    setLogonPasswordVerify
    setRedirectURL

If the user is currently not logged into the system, to reset the password of the user's registered identity, the following set methods should be invoked before calling the execute method on the command.

    setLogonId
    setChallengeAnswer
    setRedirectURL
See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          Copyright statement.
static java.lang.String ERRTASK_NAME
          Error task name.
 
Fields inherited from class com.ibm.commerce.command. ControllerCommandImpl
requestProperties, responseProperties, retriable, viewReqProperties
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.security.commands. ResetPasswordCmd
defaultCommandClassName, NAME
 
Constructor Summary
ResetPasswordCmdImpl()
           
 
Method Summary
protected  java.lang.String getChallengeAnswer()
          Retrieves the answer to the challenge question; used to confirm identity.
protected  java.lang.String getErrorRedirectURL()
          Retrieves optional URL that the user should be redirected to on error conditions.
protected  java.lang.String getLogonId()
          Retrieves the logon ID of the shopper or administrator whose password needs to be reset.
protected  java.lang.String getLogonPassword()
          Retrieves the new password of the user whose password is being changed.
protected  java.lang.String getLogonPasswordOld()
          Retrieves the old password of the user whose password is being changed.
protected  java.lang.String getLogonPasswordVerify()
          Retrieves the confirm new password of the user whose password is being changed.
protected  java.lang.String getRedirectURL()
          Retrieves the URL to which the user should be redirected after a successful password reset.
 void performExecute()
          Executes the command.
 void setChallengeAnswer(java.lang.String strChallengeAnswer)
          Sets the answer to the challenge question; used to confirm identity.
 void setErrorRedirectURL(java.lang.String newErrorURL)
          Sets the URL specified in the request to redirect in cases of user errror.
 void setLogonId(java.lang.String strLogonId)
          Sets the logon ID of the shopper or administrator whose password needs to be reset.
 void setLogonPassword(java.lang.String strNewPassword)
          Sets the new password of the user whose password is being changed.
 void setLogonPasswordOld(java.lang.String strOldPassword)
          Sets the old password of the user whose password is being changed.
 void setLogonPasswordVerify(java.lang.String strNewPasswordVerify)
          Sets the confirm new password of the user whose password is being changed.
 void setRedirectURL(java.lang.String strRedirectURL)
          Sets the URL that the user should be redirected after successful password reset.
 void setRequestProperties( TypedProperty hshReqParameters)
          Sets the request properties.
 void validateParameters()
          Validates the parameters.
 
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
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, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.command. ControllerCommand
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command. AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command. ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 

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

ERRTASK_NAME

public static final java.lang.String ERRTASK_NAME
Error task name.
See Also:
Constant Field Values
Constructor Detail

ResetPasswordCmdImpl

public ResetPasswordCmdImpl()
Method Detail

getChallengeAnswer

protected java.lang.String getChallengeAnswer()
Retrieves the answer to the challenge question; used to confirm identity.
Returns:
The answer to the challenge question.

getErrorRedirectURL

protected java.lang.String getErrorRedirectURL()
Retrieves optional URL that the user should be redirected to on error conditions.
Returns:
URL which to redirect.

getLogonId

protected java.lang.String getLogonId()
Retrieves the logon ID of the shopper or administrator whose password needs to be reset.
Returns:
LoginID to be set.

getLogonPassword

protected java.lang.String getLogonPassword()
Retrieves the new password of the user whose password is being changed.
Returns:
New password.

getLogonPasswordOld

protected java.lang.String getLogonPasswordOld()
Retrieves the old password of the user whose password is being changed.
Returns:
Old password to be changed.

getLogonPasswordVerify

protected java.lang.String getLogonPasswordVerify()
Retrieves the confirm new password of the user whose password is being changed.
Returns:
Confirmation of new password.

getRedirectURL

protected java.lang.String getRedirectURL()
Retrieves the URL to which the user should be redirected after a successful password reset.
Returns:
URL which to redirect.

performExecute

public void performExecute()
                    throws ECException
Executes the command. If the user is a guest, then delegates to the ResetPasswordGuestCmd; if the user is registered, then delegates to the ResetPasswordRegisterCmd.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException

setChallengeAnswer

public void setChallengeAnswer(java.lang.String strChallengeAnswer)
Sets the answer to the challenge question; used to confirm identity.
Specified by:
setChallengeAnswer in interface ResetPasswordCmd
Parameters:
strChallengeAnswer - The answer to the challenge question.

setErrorRedirectURL

public void setErrorRedirectURL(java.lang.String newErrorURL)
Sets the URL specified in the request to redirect in cases of user errror.
Parameters:
newErrorURL - ErrorRedirectURL to be set.

setLogonId

public void setLogonId(java.lang.String strLogonId)
Sets the logon ID of the shopper or administrator whose password needs to be reset.
Specified by:
setLogonId in interface ResetPasswordCmd

setLogonPassword

public void setLogonPassword(java.lang.String strNewPassword)
Sets the new password of the user whose password is being changed.
Specified by:
setLogonPassword in interface ResetPasswordCmd
Parameters:
strNewPassword - Password.

setLogonPasswordOld

public void setLogonPasswordOld(java.lang.String strOldPassword)
Sets the old password of the user whose password is being changed.
Specified by:
setLogonPasswordOld in interface ResetPasswordCmd
Parameters:
strOldPassword - Old password to be changed.

setLogonPasswordVerify

public void setLogonPasswordVerify(java.lang.String strNewPasswordVerify)
Sets the confirm new password of the user whose password is being changed.
Specified by:
setLogonPasswordVerify in interface ResetPasswordCmd
Parameters:
strNewPasswordVerify - Confirmation of new password.

setRedirectURL

public void setRedirectURL(java.lang.String strRedirectURL)
Sets the URL that the user should be redirected after successful password reset.
Specified by:
setRedirectURL in interface ResetPasswordCmd
Parameters:
strRedirectURL - URL to redirect to.

setRequestProperties

public void setRequestProperties(TypedProperty hshReqParameters)
                          throws ECApplicationException
Sets the request properties. Gets the logonId, logonPasswordOld, logonPassword, logonPasswordVerify, and challengeAnswer from the supplied hshReqParameters.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ControllerCommandImpl
Parameters:
hshReqParameters - The request parameters.
Throws:
ECApplicationException

validateParameters

public void validateParameters()
                        throws ECException
Validates the parameters. Ensures that the redirectURL is specified, and sets the choice flag based on whether the user is a guest or registered.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException