com.ibm.commerce.contract.commands
Class ContractCancelCmdImpl
java.lang.Object
CacheableCommandImpl
com.ibm.commerce.command.AbstractECTargetableCommand
com.ibm.commerce.command.ControllerCommandImpl
com.ibm.commerce.contract.commands.ContractCancelCmdImpl
- All Implemented Interfaces:
- AccCommand, ContractCancelCmd, ControllerCommand, ECCommand, ECTargetableCommand, Protectable
- public class ContractCancelCmdImpl
- extends ControllerCommandImpl
- implements ContractCancelCmd
This is the default implementation of the ContractCancel command (WebSphere Commerce Business Edition only). This command cancels the specified contract by changing its contract state to Cancelled. This command does not remove the contract from the database. A contract can be cancelled any time exception the contract in Draft, DeploymentInProgress, or Closed state. The following AccessBeans are used in this default implementation: ContractAccessBean, TradingAgreementAccessBean,StoreContractAccessBean, StoreJDBCHelperAccessBean().findStoresCreatedByContract(contractId), ContractJDBCHelperAccessBean().findStoreIdsInStoreContractByContractId(contractId)
- See Also:
- com.ibm.commerce.store.commands.ManageStoreCmdImpl, com.ibm.commerce.store.commands.UpdateStoreRelationshipStateCmdImpl, UpdateRegistryCmd, ContractDeleteCmdImpl, Serialized Form
Field Summary |
static java.lang.String |
CLASSNAME
The name of the default implementation. |
static java.lang.String |
COPYRIGHT
IBM copyright notice field. |
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, 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.ECCommand |
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties |
COPYRIGHT
public static final java.lang.String COPYRIGHT
- IBM copyright notice field.
- See Also:
- Constant Field Values
CLASSNAME
public static final java.lang.String CLASSNAME
- The name of the default implementation.
- See Also:
- Constant Field Values
ContractCancelCmdImpl
public ContractCancelCmdImpl()
getContractId
public java.lang.Long getContractId()
- Gets the id of the cancelled contract.
-
- Specified by:
- getContractId in interface ContractCancelCmd
-
- Returns:
- the id of the cancelled contract
getResources
public AccessVector getResources()
throws ECException
- Gets the access vector accessed by this command. The default implementation returns ContractAccessBean of the contract to be canceled.
-
- Specified by:
- getResources in interface ECCommand
- Overrides:
- getResources in class AbstractECTargetableCommand
-
- Returns:
- AccessVector - a vector of resource action pairs
- Throws:
- ECException
- See Also:
- AbstractECTargetableCommand.getResources()
performExecute
public void performExecute()
throws ECException
- The method cancels the specified contract. If there is a store created by this contract. The status of the store will be set to "Suspended", and the state of the store relationship if it has will be set to "Inactive".
-
- Specified by:
- performExecute in interface ECCommand
- Overrides:
- performExecute in class AbstractECTargetableCommand
-
- Throws:
- ECException - Raised with message _ERR_UPDATE_STORE_STATUS whenever the error occurs in ManageStoreCmd. see that command for detail Raised with message _ERR_UPDATE_STORE_RELATIONSHIP_STATE whenever the error occurs in UpdateStoreRelationshipStateCmd. see that command for detail. Raised with message _ERR_UPDATE_STORE_OR_STORE_RELATIONSHIP_STATE if one of the follwing exception be thrown when trying to get store and store relationship information from the specified contract: CreateException, RemoteException, SQLException, FinderException, NameException.
- See Also:
- com.ibm.commerce.store.commands.ManageStoreCmdImpl#performExecute(), com.ibm.commerce.store.commands.UpdateStoreRelationshipStateCmdImpl#performExecute(), ECCommand.performExecute(), ContractDeleteCmdImpl.performExecute(), AbstractECTargetableCommand.performExecute()
setContractId
public void setContractId(java.lang.Long contractId)
- Sets the id of the contract to be cancelled.
-
- Specified by:
- setContractId in interface ContractCancelCmd
-
- Parameters:
- contractId - the id of the contract
setDeleteContract
public void setDeleteContract(boolean deleteFlag)
- Sets whether the contract should be deleted.
-
- Specified by:
- setDeleteContract in interface ContractCancelCmd
-
- Parameters:
- deleteFlag - true if the contract should be deleted, false otherwise
setRequestProperties
public void setRequestProperties(TypedProperty aRequestProperties)
throws ECApplicationException
- Retrieves input parameters from the request properties.
-
- Specified by:
- setRequestProperties in interface ControllerCommand
- Overrides:
- setRequestProperties in class ControllerCommandImpl
-
- Parameters:
- aRequestProperties - An TypedProperty object contains the input parameters. For this default implementation, contractId is required parameter. An optional boolean parameter is "deleteContract". if this parameter is not provided. a false value will be set to.
- Throws:
- ECApplicationException - Raised with message _ERR_MISSING_CMD_PARAMETER when contractId is missed from the URL. Raised with message _ERR_NUMBER_FORMAT_EXCEPTION if the contractId provided from the URL do not match its type.
- See Also:
- ControllerCommandImpl.setRequestProperties(TypedProperty)
validateParameters
public void validateParameters()
throws ECException
- Validates the contract to check if it is in right state for this process.
-
- Specified by:
- validateParameters in interface ECCommand
- Overrides:
- validateParameters in class AbstractECTargetableCommand
-
- Throws:
- ECException - Raised with message _ERR_WRONG_CONTRACT_STATE if the contract is in one of the following states: Cancel, Closed, Draft, DeploymentInProgress. Raised with message _ERR_CONTRACT_OBJECT_NOT_FOUND if the contract cannot be found based on the provided contract id.
- See Also:
- AbstractECTargetableCommand.validateParameters()
Feedback
(C) Copyright IBM Corporation 1996, 2005. All Rights Reserved.