Class SubscriptionCancelScheduledActionImpl

  • All Implemented Interfaces:, ECCommand, ECTargetableCommand, TaskCommand, SubscriptionScheduledActionCmd,,,,,,

    public class SubscriptionCancelScheduledActionImpl
    extends AbstractSubscriptionScheduledActionCmdImpl
    This class will be called by the scheduler to cancel a subscription or a recurring order. It performs the cancellation as a 3 step process wherein, it first cancels the parent order and then deletes all the future scheduled jobs of the subscription. It then updates the state of the subscription as the final step. Initially the state of the action will be updated to SubscriptionServerConstants.TRANSIENT_STATE_CANCEL_ORDER. As the first step the class will attempt to cancel the parent order or a recurring order or the parent order item of a subscription by invoking the cancelParentOrder method. In case of subscriptions, the shopper is refunded some amount proportional to the number of shipments remaining. Once this is successful, the state will be updated to SubscriptionServerConstants.TRANSIENT_STATE_DELETE_JOBS_AFTER_ORDER_CANCEL . The second step is to delete all the future scheduled jobs of the subscription by invoking the deleteSubscriptionJobs method. Once this is successful, the method will update the state to SubscriptionServerConstants.TRANSIENT_STATE_CANCEL_SUBSCRIPTION. The third step is to update the status of the subscription to CANCELLED. In case of any known order exception while canceling the parent order, this class will notify the merchant by sending a mail with the reason for the exception.
    See Also:
    Serialized Form
    • Field Detail


        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SubscriptionCancelScheduledActionImpl

        public SubscriptionCancelScheduledActionImpl()
        Default constructor for the class.
    • Method Detail

      • getDelayBetweenRetries

        public int getDelayBetweenRetries()
        This method sets a static delay of 0 seconds for retries
        The number of seconds between retries