com.ibm.commerce.subscription.commands
Class SubscriptionCancelOrderCmdImpl
- java.lang.Object
-
- com.ibm.websphere.command.TargetableCommandImpl
-
- com.ibm.websphere.command.CacheableCommandImpl
-
- com.ibm.commerce.command.MeasuredCacheableCommandImpl
-
- com.ibm.commerce.command.AbstractECTargetableCommand
-
- com.ibm.commerce.command.TaskCommandImpl
-
- com.ibm.commerce.subscription.commands.SubscriptionCancelOrderCmdImpl
-
- All Implemented Interfaces:
- com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, SubscriptionCancelOrderCmd, 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 SubscriptionCancelOrderCmdImpl extends TaskCommandImpl implements SubscriptionCancelOrderCmd
This class implements the methods to cancel the parent order of a recurring order and the parent order item in case of subscription. In case of subscriptions, it additionally handles refunds as subscriptions provide upfront payment. This class takes into account the amount paid and the number of shipments received by the shopper before the cancellation, to calculate the refund amount. Before cancelling the parent order or the parent order item, it checks to see if any child orders were created for the recurring order or subscription. It sends a cancel request to the order only if no child orders have been created.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
COPYRIGHT
IBM copyright field.-
Fields inherited from interface com.ibm.commerce.subscription.commands.SubscriptionCancelOrderCmd
defaultCommandClassName, NAME
-
-
Constructor Summary
Constructors Constructor and Description SubscriptionCancelOrderCmdImpl()
Default constructor for the class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.String
getSubscriptionIdentifier()
Returns the subscription ID.void
performExecute()
This method invokes theprocessRecurringOrderParentOrderCancel
method to cancel parent orders of recurring orders or theprocessSubscriptionParentOrderItemCancel
method to cancel parent order item of subscriptionsvoid
processRecurringOrderParentOrderCancel(java.lang.String orderId, java.lang.String subscriptionId, Subscription phySubscription)
This method is used to cancel the parent order of a recurring ordervoid
processSubscriptionParentOrderItemCancel(java.lang.String orderId, java.lang.String orderItemId, java.lang.String subscriptionId, Subscription phySubscription)
This method is used to cancel the parent order item of a subscriptionvoid
setSubscriptionIdentifier(java.lang.String subscriptionId)
Sets the ID of the subscription whose parent order or parent order item is to be canceled.void
validateParameters()
This method checks if the subscription ID provided is valid.-
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
Methods inherited from class com.ibm.websphere.command.CacheableCommandImpl
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
-
Methods inherited from class com.ibm.websphere.command.TargetableCommandImpl
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.websphere.command.CacheableCommand
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
-
Methods inherited from interface com.ibm.websphere.command.TargetableCommand
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
-
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
-
-
-
Field Detail
-
COPYRIGHT
public static final java.lang.String COPYRIGHT
IBM copyright field.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SubscriptionCancelOrderCmdImpl
public SubscriptionCancelOrderCmdImpl()
Default constructor for the class.
-
-
Method Detail
-
processSubscriptionParentOrderItemCancel
public void processSubscriptionParentOrderItemCancel(java.lang.String orderId, java.lang.String orderItemId, java.lang.String subscriptionId, Subscription phySubscription) throws OrderException
This method is used to cancel the parent order item of a subscription- Specified by:
processSubscriptionParentOrderItemCancel
in interfaceSubscriptionCancelOrderCmd
- Parameters:
orderId
- The ID of the order being cancelledorderItemId
- The ID of the order item being cancelledsubscriptionId
- The ID of the subscription being cancelledphySubscription
- The subscription physical data object- Throws:
OrderException
-
processRecurringOrderParentOrderCancel
public void processRecurringOrderParentOrderCancel(java.lang.String orderId, java.lang.String subscriptionId, Subscription phySubscription) throws OrderException
This method is used to cancel the parent order of a recurring order- Specified by:
processRecurringOrderParentOrderCancel
in interfaceSubscriptionCancelOrderCmd
- Parameters:
orderId
- The order ID to be cancelledsubscriptionId
- The ID of the subscription being cancelledphySubscription
- The subscription physical data object- Throws:
OrderException
-
validateParameters
public void validateParameters() throws ECException
This method checks if the subscription ID provided is valid.- Specified by:
validateParameters
in interfaceECCommand
- Overrides:
validateParameters
in classAbstractECTargetableCommand
- Throws:
ECException
-
performExecute
public void performExecute() throws ECException
This method invokes theprocessRecurringOrderParentOrderCancel
method to cancel parent orders of recurring orders or theprocessSubscriptionParentOrderItemCancel
method to cancel parent order item of subscriptions- Specified by:
performExecute
in interfaceECCommand
- Specified by:
performExecute
in interfacecom.ibm.websphere.command.TargetableCommand
- Overrides:
performExecute
in classAbstractECTargetableCommand
- Throws:
ECException
-
getSubscriptionIdentifier
public java.lang.String getSubscriptionIdentifier()
Returns the subscription ID.- Returns:
- The subscription ID
-
setSubscriptionIdentifier
public void setSubscriptionIdentifier(java.lang.String subscriptionId)
Sets the ID of the subscription whose parent order or parent order item is to be canceled.- Specified by:
setSubscriptionIdentifier
in interfaceSubscriptionCancelOrderCmd
- Parameters:
subscriptionId
- The subscription ID.
-
-