com.ibm.commerce.utf.commands
Class CreateReturnChargeTCCmdImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.utf.commands.CreateReturnChargeTCCmdImpl
All Implemented Interfaces:
CreateReturnChargeTCCmd, ECCommand, TaskCommand

public class CreateReturnChargeTCCmdImpl
extends TaskCommandImpl
implements CreateReturnChargeTCCmd

Creates a Term and Condition 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


Field Summary
 java.lang.String returnApprovalPolicyName
           
 java.lang.String returnApprovalPolicyType
           
 java.lang.String returnApprovalStoreEntity
           
 java.lang.String returnChargePolicyName
           
 java.lang.String returnChargePolicyType
           
 java.lang.String returnChargeStoreEntity
           
 java.lang.Long tradingId
           
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.utf.commands.CreateReturnChargeTCCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Constructor Summary
CreateReturnChargeTCCmdImpl()
           
 
Method Summary
 java.lang.String getReturnApprovalPolicyName()
          Retrieves the ReturnApproval policy name.
 java.lang.String getReturnApprovalPolicyType()
          Retrieves the ReturnApproval policy type.
 java.lang.String getReturnApprovalStoreEntity()
          Retrieves the store or storegroup ID for the ReturnApproval policy.
 java.lang.String getReturnChargePolicyName()
          Retrieves the ReturnCharge policy name.
 java.lang.String getReturnChargePolicyType()
          Retrieves the ReturnCharge policy type.
 java.lang.String getReturnChargeStoreEntity()
          Retrieves the store or storegroup ID for the ReturnCharge policy.
 java.lang.Long getTradingId()
          Retrieves the trading agreement ID.
 void performExecute()
          Creates the ReturnCharge TC.
 void setReturnApprovalPolicyName(java.lang.String newReturnApprovalPolicyName)
          Stores the incoming value for the ReturnApproval policy name.
 void setReturnApprovalPolicyType(java.lang.String newReturnApprovalPolicyType)
          Stores the incoming value for the ReturnApproval policy type.
 void setReturnApprovalStoreEntity(java.lang.String newReturnApprovalStoreEntity)
          Stores the store entity for which the ReturnApproval policy has been specified.
 void setReturnChargePolicyName(java.lang.String newReturnChargePolicyName)
          Stores the incoming value for the ReturnCharge policy name.
 void setReturnChargePolicyType(java.lang.String newReturnChargePolicyType)
          Stores the incoming value for the ReturnCharge policy type.
 void setReturnChargeStoreEntity(java.lang.String newReturnChargeStoreEntity)
          Stores the store entity for which the ReturnCharge policy has been specified.
 void setTradingId(java.lang.Long newTradingId)
          Stores the trading agreement ID.
 void validateParameters()
          This method does the following:
Verifies that a trading agreement ID has been provided. Verifies that a ReturnCharge policy name has been provided. Verifies that a ReturnCharge policy type has been provided. Verifies that a store entity ID has been provided for the ReturnCharge policy. Verifies that a ReturnApproval policy name has been provided. Verifies that a ReturnApproval policy type has been provided. Verifies that a store entity ID has been provided for the ReturnApproval policy.
 
Methods inherited from class com.ibm.commerce.command.AbstractECCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, 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.ECCommand
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 

Field Detail

returnApprovalPolicyName

public java.lang.String returnApprovalPolicyName

returnApprovalPolicyType

public java.lang.String returnApprovalPolicyType

returnApprovalStoreEntity

public java.lang.String returnApprovalStoreEntity

returnChargePolicyName

public java.lang.String returnChargePolicyName

returnChargePolicyType

public java.lang.String returnChargePolicyType

returnChargeStoreEntity

public java.lang.String returnChargeStoreEntity

tradingId

public java.lang.Long tradingId
Constructor Detail

CreateReturnChargeTCCmdImpl

public CreateReturnChargeTCCmdImpl()
Method Detail

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:

Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECCommand
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.

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 AbstractECCommand
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.