com.ibm.commerce.utf.commands
Class CreateReturnPaymentTCCmdImpl

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

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


Field Summary
 java.lang.String policyName
           
 java.lang.Long policyReference
           
 java.lang.String policyType
           
 java.lang.String storeEntity
           
 java.lang.Long tradingId
           
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.utf.commands.CreateReturnPaymentTCCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Constructor Summary
CreateReturnPaymentTCCmdImpl()
           
 
Method Summary
 java.lang.String getPolicyName()
          Retrieves the policy name.
 java.lang.Long getPolicyReference()
          Retrieves the policy ID.
 java.lang.String getPolicyType()
          Retrieves the policy type.
 java.lang.String getStoreEntity()
          Retrieves the store or storegroup ID.
 java.lang.Long getTradingId()
          Retrieves the trading agreement ID.
 void performExecute()
          Creates the RefundPaymentMethod TC.
 void setPolicyName(java.lang.String newPolicyName)
          Stores the incoming value for the policy name.
 void setPolicyReference(java.lang.Long newPolicyReference)
          Stores the ID of the policy.
 void setPolicyType(java.lang.String newPolicyType)
          Stores the incoming value for the policy type.
 void setStoreEntity(java.lang.String newStoreEntity)
          Stores the store entity for which the 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 policy name has been provided. Verifies that a policy type has been provided. Verifies that a store entity ID has been provided for the policy. Verifies that the specified policy type is "ReturnPayment".
 
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

policyName

public java.lang.String policyName

policyReference

public java.lang.Long policyReference

policyType

public java.lang.String policyType

storeEntity

public java.lang.String storeEntity

tradingId

public java.lang.Long tradingId
Constructor Detail

CreateReturnPaymentTCCmdImpl

public CreateReturnPaymentTCCmdImpl()
Method Detail

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:

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

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