com.ibm.commerce.couponredemption.commands
Class CheckValidityCmdImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.couponredemption.commands.CheckValidityCmdImpl
All Implemented Interfaces:
CheckValidityCmd, ECCommand, TaskCommand

public class CheckValidityCmdImpl
extends TaskCommandImpl
implements CheckValidityCmd

The purpose of this command is to check each of the eCoupons for expiry and put the information in expired variable which is used by the calling commands.

The input to this command is :

For each cpwalletId the cppmnId is found out. Then the endDate is found out corresponding to this cppmn and if this endDate is after the current time, the coupon is not expired. These above steps are performed for each cpwalletId.


Field Summary
protected  java.lang.Long[] bcIds
           
protected  java.sql.Timestamp currentTimeStamp
           
protected  TypedProperty inParam
           
protected  TypedProperty outParam
           
protected  TypedProperty reqParam
           
protected  boolean[] validCoupons
           
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.couponredemption.commands.CheckValidityCmd
COPYRIGHT, defaultCommandClassName, Name
 
Constructor Summary
CheckValidityCmdImpl()
          CheckValidityCmdImpl constructor, call super.
 
Method Summary
 java.lang.Long[] getBcIds()
          Get the eCoupon ids.
 java.sql.Timestamp getCurrentTimeStamp()
          Get the current time.
 TypedProperty getRequestProperties()
          Get the request properties.
 TypedProperty getResponseProperties()
          Get the response properties.
 boolean[] getValidCoupons()
          Get valid eCoupons.
 void performExecute()
          The purpose of this command is to check each of the eCoupons for expiry and put the information in expired variable which is used by the calling commands.
 void setBcIds(java.lang.Long[] newBcIds)
          Set eCoupon ids.
 void setCurrentTimeStamp(java.sql.Timestamp newCurrentTimeStamp)
          Set current time.
 void setRequestProperties(TypedProperty param)
          Set thew request properties.
 void setValidCoupons(boolean[] newValidCoupons)
          Set valid eCoupons.
 void validateParameters()
          Check the parameters.
 
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

bcIds

protected java.lang.Long[] bcIds

currentTimeStamp

protected java.sql.Timestamp currentTimeStamp

inParam

protected TypedProperty inParam

outParam

protected TypedProperty outParam

reqParam

protected TypedProperty reqParam

validCoupons

protected boolean[] validCoupons
Constructor Detail

CheckValidityCmdImpl

public CheckValidityCmdImpl()
CheckValidityCmdImpl constructor, call super.
Method Detail

getBcIds

public java.lang.Long[] getBcIds()
Get the eCoupon ids.
Returns:
java.lang.Long

getCurrentTimeStamp

public java.sql.Timestamp getCurrentTimeStamp()
Get the current time.
Returns:
java.sql.Timestamp

getRequestProperties

public TypedProperty getRequestProperties()
Get the request properties.
Returns:
com.ibm.commerce.datatype.TypedProperty

getResponseProperties

public TypedProperty getResponseProperties()
Get the response properties.
Specified by:
getResponseProperties in interface CheckValidityCmd
Returns:
com.ibm.commerce.datatype.TypedProperty

getValidCoupons

public boolean[] getValidCoupons()
Get valid eCoupons.
Specified by:
getValidCoupons in interface CheckValidityCmd
Returns:
boolean[]

performExecute

public void performExecute()
                    throws ECException

The purpose of this command is to check each of the eCoupons for expiry and put the information in expired variable which is used by the calling commands.
For each cpwalletId the cppmnId is found out. Then the endDate is found out corresponding to this cppmn and if this endDate is after the current time, the coupon is not expired. These above steps are performed for each cpwalletId.

Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECCommand
Throws:
: - com.ibm.commerce.exception.ECException.

setBcIds

public void setBcIds(java.lang.Long[] newBcIds)
Set eCoupon ids.
Specified by:
setBcIds in interface CheckValidityCmd
Parameters:
newBcId - java.lang.Long

setCurrentTimeStamp

public void setCurrentTimeStamp(java.sql.Timestamp newCurrentTimeStamp)
Set current time.
Parameters:
newCurrentTimeStamp - java.sql.Timestamp

setRequestProperties

public void setRequestProperties(TypedProperty param)
Set thew request properties.
Specified by:
setRequestProperties in interface CheckValidityCmd
Parameters:
param - com.ibm.commerce.datatype.TypedProperty

setValidCoupons

public void setValidCoupons(boolean[] newValidCoupons)
Set valid eCoupons.
Parameters:
newValidCoupons - boolean[]

validateParameters

public void validateParameters()
                        throws ECException
Check the parameters.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECCommand
Throws:
ECException -