com.ibm.commerce.security.commands
Class ResetPasswordAdministratorCmdImpl

java.lang.Object
  CacheableCommandImpl
      com.ibm.commerce.command.AbstractECTargetableCommand
          com.ibm.commerce.command.ControllerCommandImpl
              com.ibm.commerce.security.commands.ResetPasswordAdministratorCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, ResetPasswordAdministratorCmd

public class ResetPasswordAdministratorCmdImpl
extends ControllerCommandImpl
implements ResetPasswordAdministratorCmd

This task command is used by an administrator to reset the password of a shopper.

Before executing this task command, the methods listed below must be invoked.

  setLogonId
  setAdministratorPassword
  setRedirectURL
 
See Also:
Serialized Form

Field Summary
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.ResetPasswordAdministratorCmd
COPYRIGHT, defaultCommandClassName, NAME
Constructor Summary
ResetPasswordAdministratorCmdImpl()
Method Summary
java.lang.String getAdminPassword()
Retrieves the password of the administrator whose is resetting the shopper's password.
java.lang.String getLogonId()
Retrieves the logon ID of the shopper whose password needs to be reset.
java.lang.String getRedirectURL()
Retrieves the URL that the user should be redirected after successful password reset.
void performExecute()
Executes the command.
void setAdministratorPassword(java.lang.String strAdminPassword)
Sets the administrator's password, who will be resetting the password of the shopper.
void setLogonId(java.lang.String strLogonId)
Sets the logon ID of the shopper whose password will be reset.
void setRedirectURL(java.lang.String strRedirectURL)
Sets the URL to which 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
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
Field Detail

ERRTASK_NAME

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

ResetPasswordAdministratorCmdImpl

public ResetPasswordAdministratorCmdImpl()
Method Detail

getAdminPassword

public java.lang.String getAdminPassword()
Retrieves the password of the administrator whose is resetting the shopper's password.
Returns:
The administrator password.

getLogonId

public java.lang.String getLogonId()
Retrieves the logon ID of the shopper whose password needs to be reset.
Returns:
Logon ID.

getRedirectURL

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

performExecute

public void performExecute()
                    throws ECException
Executes the command. If account is not disabled, and the administrator's credentials supplied are valid, then generate a new random password and send it to the user. We use the VerifyCredentialsCmd to verify that the administrator's credentials were valid, the GeneratePasswordCmd to generate a new random password, and the SendPasswordNotificationCmd to send the new password to the user.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException

setAdministratorPassword

public void setAdministratorPassword(java.lang.String strAdminPassword)
Sets the administrator's password, who will be resetting the password of the shopper.
Specified by:
setAdministratorPassword in interface ResetPasswordAdministratorCmd
Parameters:
strAdminPassword - The administrator password.

setLogonId

public void setLogonId(java.lang.String strLogonId)
Sets the logon ID of the shopper whose password will be reset.
Specified by:
setLogonId in interface ResetPasswordAdministratorCmd

setRedirectURL

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

setRequestProperties

public void setRequestProperties(TypedProperty hshReqParameters)
                          throws ECApplicationException
Sets the request properties. Retrieves the logonId and administrator password from the request parameters provided.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ControllerCommandImpl
Parameters:
hshReqParameters - The request parameters.
Throws:
ECException
ECApplicationException

validateParameters

public void validateParameters()
                        throws ECException
Validates the parameters. Ensures that the redirectURL is specified, that the userType is administrator or siteAdministrator, that the logonId is specified and belongs to a registered user, and that the administrator password is specified.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException

Feedback