com.ibm.commerce.utf.commands

Class CreateReturnPaymentTCCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, CreateReturnPaymentTCCmd, 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 CreateReturnPaymentTCCmdImpl
    extends TaskCommandImpl
    implements CreateReturnPaymentTCCmd
    Creates terms and conditions of type "RefundPaymentMethod".

    Behaviour

    1. Verifies the existence of a return payment policy specified by the incoming parameters policyName , policyType, and storeEntity.
    2. Creates a RefundPayment TC using the specified policy.

    Exception conditions

    • If the trading agreement ID is not provided.
    • If any one of these parameters is not provided.
      1. Policy Name.
      2. Policy Type.
      3. The store entity for which the specified policy has been defined.
    This is the default implementation of the CreateReturnPaymentTCCmd. 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
      • policyName

        public java.lang.String policyName
        Policy name.
      • policyType

        public java.lang.String policyType
        Policy type.
      • storeEntity

        public java.lang.String storeEntity
        Store entity.
      • tradingId

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

        public java.lang.Long policyReference
        Policy reference.
    • Constructor Detail

      • CreateReturnPaymentTCCmdImpl

        public CreateReturnPaymentTCCmdImpl()
        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
      • getPolicyName

        public java.lang.String getPolicyName()
        Retrieves the policy name.
        Returns:
        The name of the policy.
      • getPolicyReference

        public java.lang.Long getPolicyReference()
        Retrieves the policy ID.
        Returns:
        The ID of the policy.
      • getPolicyType

        public java.lang.String getPolicyType()
        Retrieves the policy type.
        Returns:
        The type of the policy.
      • getStoreEntity

        public java.lang.String getStoreEntity()
        Retrieves the store or storegroup ID.
        Returns:
        The store or storegroup ID of the 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 RefundPaymentMethod TC. This method does the following:
        • Verifies the existence of the specified ReturnPayment policy.
        • Composes an XML element for the RefundPaymentMethod TC that conforms to the Trading DTD.
        • Creates the RefundPaymentMethod 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 ReturnPayment 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()
      • setPolicyName

        public void setPolicyName(java.lang.String newPolicyName)
        Stores the incoming value for the policy name.
        Specified by:
        setPolicyName in interface CreateReturnPaymentTCCmd
        Parameters:
        newPolicyName - The name of the policy.
      • setPolicyReference

        public void setPolicyReference(java.lang.Long newPolicyReference)
        Stores the ID of the policy.
        Parameters:
        newPolicyType - The ID of the policy.
      • setPolicyType

        public void setPolicyType(java.lang.String newPolicyType)
        Stores the incoming value for the policy type.
        Specified by:
        setPolicyType in interface CreateReturnPaymentTCCmd
        Parameters:
        newPolicyType - The type of the policy.
      • setStoreEntity

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

        public void setTradingId(java.lang.Long newTradingId)
        Stores the trading agreement ID.
        Specified by:
        setTradingId in interface CreateReturnPaymentTCCmd
        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 policy name has been provided.
        3. Verifies that a policy type has been provided.
        4. Verifies that a store entity ID has been provided for the policy.
        5. Verifies that the specified policy type is "ReturnPayment".

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