com.ibm.commerce.couponscheduler.commands
Class SchedCouponCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.couponscheduler.commands.SchedCouponCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, SchedCouponCmd

public class SchedCouponCmdImpl
extends ControllerCommandImpl
implements SchedCouponCmd

The purpose of this controller command is to mark the eCoupon promotions and eCoupons as EXPIRED depending on the expiry date of the coupon promotion. For each Coupon Promotion the end date is found out. If it is before the current timestamp the eCoupon promotion is marked as EXPIRED. The eCoupons corresponding to this promotion are also marked as EXPIRED. This command uses the CouponPromotionAccessBean and the CouponWalletAccessBean.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.commerce.command. ControllerCommandImpl
requestProperties, responseProperties, retriable, viewReqProperties
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.couponscheduler.commands. SchedCouponCmd
COPYRIGHT, defaultCommandClassName
 
Fields inherited from interface com.ibm.commerce.command. ECTargetableCommand
COPYRIGHT
 
Constructor Summary
SchedCouponCmdImpl()
          CleanDBCmdImpl constructor calls super.
 
Method Summary
  AccessVector getResources()
          Gets the resources for the eCoupon promotion.
 boolean isReadyToCallExecute()
          It always returns true.
 void performExecute()
          For each Coupon Promotion the end date is found out.
 void validateParameters()
          Empty method, no need to check for parameters in this command.
 
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, setRequestProperties, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, 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. ControllerCommand
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, 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, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 

Constructor Detail

SchedCouponCmdImpl

public SchedCouponCmdImpl()
CleanDBCmdImpl constructor calls super.
Method Detail

getResources

public AccessVector getResources()
                          throws ECSystemException
Gets the resources for the eCoupon promotion.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
the resources vector for the access control purpose.
Throws:
ECSystemException

isReadyToCallExecute

public boolean isReadyToCallExecute()
It always returns true.
Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Returns:
true

performExecute

public void performExecute()
                    throws ECException
For each Coupon Promotion the end date is found out. If it is before the current timestamp the eCoupon promotion is marked as EXPIRED. The eCoupons corresponding to this promotion are also marked as EXPIRED. This method uses the CouponPromotionAccessBean and the CouponWalletAccessBean.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException - If a problem is encountered while creating or finding an EJB

validateParameters

public void validateParameters()
                        throws ECException
Empty method, no need to check for parameters in this command.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException