com.ibm.commerce.utf.commands

Class CreateReturnChargeTCCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, CreateReturnChargeTCCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class CreateReturnChargeTCCmdImpl
    extends TaskCommandImpl
    implements CreateReturnChargeTCCmd
    Creates terms and conditions of type "ReturnCharge".

    Behaviour

    1. Verifies the existence of a return charge policy specified by the incoming parameters returnChargePolicyName , returnChargePolicyType, and returnChargeStoreEntity.
    2. Verifies the existence of a return approval policy specified by the incoming parameters returnApprovalPolicyName , returnApprovalPolicyType, and returnApprovalStoreEntity.
    3. Creates a ReturnCharge TC using the two policies.

    Exception conditions

    • If the trading agreement ID is not provided.
    • If even one of these parameters is not provided.
      1. Return Charge Policy Name.
      2. Return Charge Policy Type.
      3. The store entity for which the specified return charge policy has been defined.
      4. Return Approval Policy Name.
      5. Return Approval Policy Type.
      6. The store entity for which the specified return approval policy has been defined.
    This is the default implementation of the CreateReturnChargeTCCmd. This command uses the following AccessBeans:
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

        public java.lang.Long tradingId
        Trading ID.
      • returnApprovalPolicyName

        public java.lang.String returnApprovalPolicyName
        return approval policy name.
      • returnApprovalPolicyType

        public java.lang.String returnApprovalPolicyType
        return approval policy type.
      • returnApprovalStoreEntity

        public java.lang.String returnApprovalStoreEntity
        return approval store entity.
      • returnChargePolicyName

        public java.lang.String returnChargePolicyName
        return charge policy name.
      • returnChargePolicyType

        public java.lang.String returnChargePolicyType
        return charge policy type.
      • returnChargeStoreEntity

        public java.lang.String returnChargeStoreEntity
        return charge store entity.
    • Constructor Detail

      • CreateReturnChargeTCCmdImpl

        public CreateReturnChargeTCCmdImpl()
        Default constructor.
    • Method Detail

      • reset

        public void reset()
        Reset the command.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • getReturnApprovalPolicyName

        public java.lang.String getReturnApprovalPolicyName()
        Retrieves the ReturnApproval policy name.
        Returns:
        The name of the ReturnApproval policy.
      • getReturnApprovalPolicyType

        public java.lang.String getReturnApprovalPolicyType()
        Retrieves the ReturnApproval policy type.
        Returns:
        The type of the ReturnApproval policy.
      • getReturnApprovalStoreEntity

        public java.lang.String getReturnApprovalStoreEntity()
        Retrieves the store or storegroup ID for the ReturnApproval policy.
        Returns:
        The store or storegroup ID of the ReturnApproval policy.
      • getReturnChargePolicyName

        public java.lang.String getReturnChargePolicyName()
        Retrieves the ReturnCharge policy name.
        Returns:
        The name of the ReturnCharge policy.
      • getReturnChargePolicyType

        public java.lang.String getReturnChargePolicyType()
        Retrieves the ReturnCharge policy type.
        Returns:
        The type of the ReturnCharge policy.
      • getReturnChargeStoreEntity

        public java.lang.String getReturnChargeStoreEntity()
        Retrieves the store or storegroup ID for the ReturnCharge policy.
        Returns:
        The store or storegroup ID of the ReturnCharge policy.
      • getTradingId

        public java.lang.Long getTradingId()
        Retrieves the trading agreement ID.
        Returns:
        The ID of the trading agreement.
      • performExecute

        public void performExecute()
                            throws ECException
        Creates the ReturnCharge TC. This method does the following:
        • Verifies the existence of the specified ReturnCharge policy.
        • Verifies the existence of the specified ReturnApproval policy.
        • Composes an XML element for the ReturnCharge TC that conforms to the Trading DTD.
        • Creates the ReturnCharge TC using the XML element and the supplied trading agreement ID.

        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECApplicationException - If the specified ReturnCharge policy does not exist for the specified store entity or its store group(in case the store entity is a store).
        If the specified ReturnApproval policy does not exist for the specified store entity or its store group(in case the store entity is a store).
        If an application error occurs while creating the TC.
        ECSystemException - If a system error occurs while creating the TC.
        ECException
        See Also:
        ECCommand#performExecute()
      • setReturnApprovalPolicyName

        public void setReturnApprovalPolicyName(java.lang.String newReturnApprovalPolicyName)
        Stores the incoming value for the ReturnApproval policy name.
        Specified by:
        setReturnApprovalPolicyName in interface CreateReturnChargeTCCmd
        Parameters:
        newPolicyName - The name of the ReturnApproval policy.
      • setReturnApprovalPolicyType

        public void setReturnApprovalPolicyType(java.lang.String newReturnApprovalPolicyType)
        Stores the incoming value for the ReturnApproval policy type.
        Specified by:
        setReturnApprovalPolicyType in interface CreateReturnChargeTCCmd
        Parameters:
        newPolicyType - The type of the ReturnApproval policy.
      • setReturnApprovalStoreEntity

        public void setReturnApprovalStoreEntity(java.lang.String newReturnApprovalStoreEntity)
        Stores the store entity for which the ReturnApproval policy has been specified.
        Specified by:
        setReturnApprovalStoreEntity in interface CreateReturnChargeTCCmd
        Parameters:
        newStoreEntity - The Store or StoreGroup ID of the ReturnApproval policy.
      • setReturnChargePolicyName

        public void setReturnChargePolicyName(java.lang.String newReturnChargePolicyName)
        Stores the incoming value for the ReturnCharge policy name.
        Specified by:
        setReturnChargePolicyName in interface CreateReturnChargeTCCmd
        Parameters:
        newPolicyName - The name of the ReturnCharge policy.
      • setReturnChargePolicyType

        public void setReturnChargePolicyType(java.lang.String newReturnChargePolicyType)
        Stores the incoming value for the ReturnCharge policy type.
        Specified by:
        setReturnChargePolicyType in interface CreateReturnChargeTCCmd
        Parameters:
        newPolicyType - The type of the ReturnCharge policy.
      • setReturnChargeStoreEntity

        public void setReturnChargeStoreEntity(java.lang.String newReturnChargeStoreEntity)
        Stores the store entity for which the ReturnCharge policy has been specified.
        Specified by:
        setReturnChargeStoreEntity in interface CreateReturnChargeTCCmd
        Parameters:
        newStoreEntity - The Store or StoreGroup ID of the ReturnCharge policy.
      • setTradingId

        public void setTradingId(java.lang.Long newTradingId)
        Stores the trading agreement ID.
        Specified by:
        setTradingId in interface CreateReturnChargeTCCmd
        Parameters:
        newTradingId - The trading agreement ID.
      • validateParameters

        public void validateParameters()
                                throws ECException
        This method does the following:
        1. Verifies that a trading agreement ID has been provided.
        2. Verifies that a ReturnCharge policy name has been provided.
        3. Verifies that a ReturnCharge policy type has been provided.
        4. Verifies that a store entity ID has been provided for the ReturnCharge policy.
        5. Verifies that a ReturnApproval policy name has been provided.
        6. Verifies that a ReturnApproval policy type has been provided.
        7. Verifies that a store entity ID has been provided for the ReturnApproval policy.

        Specified by:
        validateParameters in interface ECCommand
        Overrides:
        validateParameters in class AbstractECTargetableCommand
        Throws:
        ECApplicationException -
        • If the trading agreement ID has not been provided.
        • If the ReturnCharge policy name has not been provided.
        • If the ReturnCharge policy type has not been provided.
        • If the store entityID has not been provided for the ReturnCharge policy.
        • If the ReturnApproval policy name has not been provided.
        • If the ReturnApproval policy type has not been provided.
        • If the store entityID has not been provided for the ReturnApproval policy.
        ECException
        See Also:
        ECCommand#validateParameters()