com.ibm.commerce.account.commands
Class AccountDeleteCmdImpl
- java.lang.Object
-
- com.ibm.websphere.command.CacheableCommandImpl
-
- com.ibm.commerce.command.MeasuredCacheableCommandImpl
-
- com.ibm.commerce.command.AbstractECTargetableCommand
-
- com.ibm.commerce.command.ControllerCommandImpl
-
- com.ibm.commerce.account.commands.AccountDeleteCmdImpl
-
- All Implemented Interfaces:
- AccountDeleteCmd, com.ibm.commerce.command.AccCommand, com.ibm.commerce.command.ControllerCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, com.ibm.commerce.security.Protectable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command
public class AccountDeleteCmdImpl extends com.ibm.commerce.command.ControllerCommandImpl implements AccountDeleteCmd
This is the default implementation of theAccountDeleteCmd
controller command.Input parameters:
Name Description accountId
The account IDs to be deleted. It is mandatory. redirecturl
The redirect url after this command is executed successfully. It is optional. Output parameters:
None.Behaviour:
- For each account passed in , set the account state to suspended and mark for deletion to 1; Then set the trading information for this account, including setting state to inactive and mark for deletion to 1.
- If a redirect URL is not provided, the command will use the AccountListView after successful execution.
Task commands called:
None.Access Beans used:
TradingAgreementAccessBean
AccountAccessBean
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
COPYRIGHT
The IBM copyright notice field.-
Fields inherited from interface com.ibm.commerce.account.commands.AccountDeleteCmd
defaultCommandClassName, NAME
-
-
Constructor Summary
Constructors Constructor and Description AccountDeleteCmdImpl()
Constructor for AccountDeleteCmdImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description com.ibm.commerce.accesscontrol.AccessVector
getResources()
Gets the access vector accessed by this command.void
performExecute()
This method executes the business logic of this command implementation.void
setAccountIds(java.lang.Long[] anAccountIds)
Sets the list of account IDs.void
setRequestProperties(com.ibm.commerce.datatype.TypedProperty requestProperties)
Sets the request properties of this command implementation.void
validateParameters()
Extracts and validates the input parameters of this command implementation.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
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, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
-
-
-
Field Detail
-
COPYRIGHT
public static final java.lang.String COPYRIGHT
The IBM copyright notice field.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AccountDeleteCmdImpl
public AccountDeleteCmdImpl()
Constructor for AccountDeleteCmdImpl.
-
-
Method Detail
-
getResources
public com.ibm.commerce.accesscontrol.AccessVector getResources() throws com.ibm.commerce.exception.ECException
Gets the access vector accessed by this command. The default implementation returns a vector of AccountAccessBean objects of the business accounts to be deleted.- Specified by:
getResources
in interfacecom.ibm.commerce.command.ECCommand
- Overrides:
getResources
in classcom.ibm.commerce.command.AbstractECTargetableCommand
- Returns:
- AccessVector - a vector of resource action pairs
- Throws:
com.ibm.commerce.exception.ECException
- See Also:
AbstractECTargetableCommand.getResources()
-
performExecute
public void performExecute() throws com.ibm.commerce.exception.ECException
This method executes the business logic of this command implementation.- Specified by:
performExecute
in interfacecom.ibm.commerce.command.ECCommand
- Overrides:
performExecute
in classcom.ibm.commerce.command.AbstractECTargetableCommand
- Throws:
com.ibm.commerce.exception.ECException
- Raised with message _ERR_FINDER_EXCEPTION if the FinderException occurred. Raised with message _ERR_REMOTE_EXCEPTION if the RemoteException occurred. Raised with message _ERR_NAMING_EXCEPTION if the NamingException occurred. Raised with message _ERR_CREATE_EXCEPTION if the CreateException occurred.- See Also:
AbstractECTargetableCommand#performExecute()
-
setAccountIds
public void setAccountIds(java.lang.Long[] anAccountIds)
Sets the list of account IDs.- Specified by:
setAccountIds
in interfaceAccountDeleteCmd
- Parameters:
anAccountIds
- an array of the account IDs which will be deleted
-
setRequestProperties
public void setRequestProperties(com.ibm.commerce.datatype.TypedProperty requestProperties) throws com.ibm.commerce.exception.ECException
Sets the request properties of this command implementation.- Specified by:
setRequestProperties
in interfacecom.ibm.commerce.command.ControllerCommand
- Overrides:
setRequestProperties
in classcom.ibm.commerce.command.ControllerCommandImpl
- Parameters:
requestProperties
- An TypedProperty object contains the input parameters. For this default implementation, the accountId is the required parameter. URL and redirecturl are optional parameters- Throws:
com.ibm.commerce.exception.ECApplicationException
- Raised with message _ERR_MISSING_CMD_PARAMETER if accountId parameter is missing. Raised with message _ERR_NUMBER_FORMAT_EXCEPTION if the provided business account IDs cannot be converted to Long object.com.ibm.commerce.exception.ECException
- See Also:
ControllerCommandImpl.setRequestProperties(TypedProperty)
-
validateParameters
public void validateParameters() throws com.ibm.commerce.exception.ECException
Extracts and validates the input parameters of this command implementation. It validates the business account or accounts to check if they exist.- Specified by:
validateParameters
in interfacecom.ibm.commerce.command.ECCommand
- Overrides:
validateParameters
in classcom.ibm.commerce.command.AbstractECTargetableCommand
- Throws:
com.ibm.commerce.exception.ECException
- Raised with message _ERR_ACCOUNT_OBJECT_NOT_FOUND if one of the specified business accounts cannot be found. Raised with message _ERR_FINDER_EXCEPTION if the FinderException occurred. Raised with message _ERR_REMOTE_EXCEPTION if the RemoteException occurred. Raised with message _ERR_NAMING_EXCEPTION if the NamingException occurred. Raised with message _ERR_CREATE_EXCEPTION if the CreateException occurred.- See Also:
AbstractECTargetableCommand.validateParameters()
-
-