public class SubscriptionCreateChildOrderSchedulerCmdImpl extends AbstractSubscriptionScheduledActionCmdImpl
Constructor and Description |
---|
SubscriptionCreateChildOrderSchedulerCmdImpl() |
Modifier and Type | Method and Description |
---|---|
protected com.ibm.commerce.foundation.common.datatypes.ScheduleInfoType | buildScheduleInfo(Subscription subscription)
This method builds the fulfillment schedule to compute the next occurrence for the given schedule.
|
protected java.util.Date | computeNextOccurrence(Subscription subscription, com.ibm.commerce.foundation.common.datatypes.ScheduleInfoType fulfillmentSchedule)
This method will compute the next fulfillment date based on the schedule information.
|
protected java.lang.String | createChildRecurringOrder(Subscription subscription)
This method will create a child order for the recurring parent order.
|
protected java.lang.String | createChildSubscriptionOrder(Subscription subscription)
This method will create a child order for the subscription parent order.
|
protected void | createSubscriptionJob()
This method will create a job in the scheduler table to create the next child order for the subscription or recurring order.
|
protected void | findSubscriptionTemplateIdentifier()
This method will get the subscription template id required for a subscription order to create the child order.
|
protected CommerceFoundationFactory | getCommerceFoundationFactory()
This method will return the instance of commerce foundation factory.
|
int | getDelayBetweenRetries()
This will return the delay in seconds for the retries for the states to execute.
|
protected java.lang.Integer | getFinalStateForSubscription()
This will help the scheduler to get the final state of the subscription.
|
protected java.lang.Integer | getInitialState()
This method is used to set the initial state in the scheduler.
|
protected int | getMaximumNumberOfRetriesForState(java.lang.Integer state)
This method will help the scheduler to get the maximum number of retries for the state.
|
protected java.lang.String | getSchedulerType(com.ibm.commerce.foundation.common.datatypes.ScheduleInfoType fulfillmentSchedule)
This method will return the scheduler type which will be used to create the instance of ScheduleEvaluateCmd
|
protected void | handleBackOrderException(OrderException exception)
This method will handle the back order exception flow.
|
protected void | handleBadInventoryException(OrderException exception)
This method will handle the bad inventory exception flow.
|
protected void | handleCatEntryMarkForDeleteException(OrderException exception)
This method will handle the catalog entry mark for delete exception flow.
|
protected void | handleCatEntryNotBuyableException(OrderException exception)
This method will handle the catalog entry not buy able exception flow.
|
protected void | handleCreateChildOrderException(java.lang.Exception exception)
This method will handle all the order exception flows for the create child order.
|
protected void | handleException(java.lang.Exception exception)
This method will handle the unknown exception by canceling the subscription caused this exception.
|
protected void | handlePaymentFailureException(OrderException exception)
This method will handle the payment failure exception flow.
|
protected void | handleSKUException(OrderException exception)
This method will handle the exception when a product is being added to the shopping cart.
|
protected void | handleStateRetry(AbstractSubscriptionScheduledActionCmdImpl.StackEntry stateToRetry)
This method handles the retry for the given state.
|
protected boolean | isExceptionRetriable(java.lang.Exception exceptionToCheck)
This method will help the scheduler to know whether an exception can be re tried.
|
protected void | notifyMerchant()
This method will send an e-mail to the merchant to notify about the various exceptions.
|
protected void | processSubscriptionState(AbstractSubscriptionScheduledActionCmdImpl.StackEntry entry)
This method will execute the business logic for the scheduled action.
|
protected java.lang.String | recalculateChildOrder(Subscription subscription)
This method will return the value of needRecalculate for creating child order.
|
protected void | recoverState(AbstractSubscriptionScheduledActionCmdImpl.StackEntry completedState)
This method will implement the logic for recovering form the given state in case of exceptions.
|
protected void | updateSubscription()
This method will update the subscription with the attributes such as next fulfillment date, status etc once the child order is created.If the job completes successfully then the state will be updated to create schedule job.
|
public SubscriptionCreateChildOrderSchedulerCmdImpl()
protected void processSubscriptionState(AbstractSubscriptionScheduledActionCmdImpl.StackEntry entry)
protected void findSubscriptionTemplateIdentifier()
protected java.lang.String createChildRecurringOrder(Subscription subscription)
protected java.lang.String createChildSubscriptionOrder(Subscription subscription)
protected void updateSubscription()
protected void createSubscriptionJob()
protected void handleCreateChildOrderException(java.lang.Exception exception)
protected java.lang.Integer getFinalStateForSubscription()
protected int getMaximumNumberOfRetriesForState(java.lang.Integer state)
protected void handleStateRetry(AbstractSubscriptionScheduledActionCmdImpl.StackEntry stateToRetry)
protected boolean isExceptionRetriable(java.lang.Exception exceptionToCheck)
protected void recoverState(AbstractSubscriptionScheduledActionCmdImpl.StackEntry completedState)
protected java.lang.Integer getInitialState()
protected java.lang.String recalculateChildOrder(Subscription subscription)
public int getDelayBetweenRetries()
protected void handleBackOrderException(OrderException exception)
protected void handleBadInventoryException(OrderException exception)
protected void handleCatEntryNotBuyableException(OrderException exception)
protected void handleCatEntryMarkForDeleteException(OrderException exception)
protected void handlePaymentFailureException(OrderException exception)
protected void handleSKUException(OrderException exception)
protected void handleException(java.lang.Exception exception)
protected void notifyMerchant()
protected CommerceFoundationFactory getCommerceFoundationFactory()
protected com.ibm.commerce.foundation.common.datatypes.ScheduleInfoType buildScheduleInfo(Subscription subscription)
protected java.util.Date computeNextOccurrence(Subscription subscription, com.ibm.commerce.foundation.common.datatypes.ScheduleInfoType fulfillmentSchedule)
protected java.lang.String getSchedulerType(com.ibm.commerce.foundation.common.datatypes.ScheduleInfoType fulfillmentSchedule)