com.ibm.commerce.contract.commands

Class ContractCloseCmdImpl

  • 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.contract.commands.ContractCloseCmdImpl
  • All Implemented Interfaces:
    com.ibm.commerce.command.AccCommand, com.ibm.commerce.command.ControllerCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, ContractCloseCmd, com.ibm.commerce.security.Protectable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command


    public class ContractCloseCmdImpl
    extends com.ibm.commerce.command.ControllerCommandImpl
    implements ContractCloseCmd
    This is the default implementation of the ContractCloseCmd controller command (WebSphere Commerce Enterprise only).

    Input parameters:

    Name Description
    contractId The contract ID. It is mandatory.

    Output parameters:

    None.

    Behaviour:

    This command closes the specified contract by changing its contract state to Closed. A contract can be closed if it is in one of the following states: Approved, Active, Suspended.

    Access Beans used:

    • ContractAccessBean
    • TradingAttachmentRelationAccessBean
    • StoreContractAccessBean
    • com.ibm.commerce.common.objects.StoreJDBCHelperAccessBean
    • com.ibm.commerce.contract.objects.ContractJDBCHelperAccessBean
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.Long getContractId()
      Gets the id of the contract to be closed.
      com.ibm.commerce.accesscontrol.AccessVector getResources()
      Gets the access vector accessed by this command.
      void performExecute()
      Executes the business logic of this command implementation.
      void setContractId(java.lang.Long contractId)
      Sets the ID of the contract to be closed.
      void setRequestProperties(com.ibm.commerce.datatype.TypedProperty aRequestProperties)
      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
      • Methods inherited from interface com.ibm.commerce.security.Protectable

        fulfills, getOwner
    • Field Detail

      • CLASSNAME

        public static final java.lang.String CLASSNAME
        The full name of this class.
        See Also:
        Constant Field Values
      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ContractCloseCmdImpl

        public ContractCloseCmdImpl()
    • Method Detail

      • getContractId

        public java.lang.Long getContractId()
        Gets the id of the contract to be closed.
        Returns:
        id of the contract to be closed
      • 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 ContractAccessBean of the contract to be closed.

        Specified by:
        getResources in interface com.ibm.commerce.command.ECCommand
        Overrides:
        getResources in class com.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
        Executes the business logic of this command implementation. The method closes 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 com.ibm.commerce.command.ECCommand
        Overrides:
        performExecute in class com.ibm.commerce.command.AbstractECTargetableCommand
        Throws:
        com.ibm.commerce.exception.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 following exception be thrown when trying to get store and store relationship information from the specified contract: CreateException, RemoteException, SQLException, FinderException, NameException.
        See Also:
        ManageStoreCmdImpl.performExecute(), UpdateStoreRelationshipStateCmdImpl.performExecute(), UpdateRegistryCmdImpl.performExecute(), AbstractECTargetableCommand#performExecute()
      • setContractId

        public void setContractId(java.lang.Long contractId)
        Sets the ID of the contract to be closed.
        Specified by:
        setContractId in interface ContractCloseCmd
        Parameters:
        contractId - ID of the contract to be closed
      • setRequestProperties

        public void setRequestProperties(com.ibm.commerce.datatype.TypedProperty aRequestProperties)
                                  throws com.ibm.commerce.exception.ECApplicationException
        Sets the request properties of this command implementation.
        Specified by:
        setRequestProperties in interface com.ibm.commerce.command.ControllerCommand
        Overrides:
        setRequestProperties in class com.ibm.commerce.command.ControllerCommandImpl
        Parameters:
        aRequestProperties - An TypedProperty object contains the input parameters. For this default implementation, contractId is required parameter.
        Throws:
        com.ibm.commerce.exception.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 com.ibm.commerce.exception.ECException
        Extracts and validates the input parameters of this command implementation. Validates the contract to check if it is in right state for this process.
        Specified by:
        validateParameters in interface com.ibm.commerce.command.ECCommand
        Overrides:
        validateParameters in class com.ibm.commerce.command.AbstractECTargetableCommand
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_WRONG_CONTRACT_STATE if the contract is not in one of the following states: Active, Suspended, Approved. Raised with message _ERR_CONTRACT_OBJECT_NOT_FOUND if the contract cannot be found. It is based on the provided contract id.
        See Also:
        AbstractECTargetableCommand.validateParameters()