public class OrderBaseCmdImpl extends ControllerCommandImpl
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
Copyright statement.
|
Constructor and Description |
---|
OrderBaseCmdImpl() |
Modifier and Type | Method and Description |
---|---|
protected void | checkAndCSRLock(java.lang.Long orderId)
This method checks and locks the resource.
|
protected void | checkAndCSRLock(java.lang.Long[] orderIds)
Check and lock the resource.
|
protected void | checkAndUnlock(java.lang.Long orderId)
This method checks and unlocks the resource.
|
protected void | checkAndUnlock(java.lang.Long[] orderIds)
This method checks and unlocks the resource.
|
protected void | checkAndUnlock(java.lang.Long[] orderIds, boolean donotCheckCSR)
This method checks and unlocks the resource.
|
protected void | checkAndUnlock(java.lang.Long orderId, boolean donotCheckCSR)
This method checks and unlocks the resource.
|
protected void | checkLock(java.lang.Long orderId)
This method checks if the order is locked by the current CSR.
|
protected void | checkLock(java.lang.Long[] orderIds)
This method checks if the order is locked by the current CSR.
|
protected void | checkThreshold(com.ibm.commerce.order.utils.ThresholdCheckContext context)
Performs a check to see if the threshold has been exceeded in the given context.
|
protected com.ibm.commerce.order.utils.AdminConfigLoader<com.ibm.commerce.order.utils.OrderThreshold.Part> | getAdminConfigLoader()
Returns the object that is used to get thresholds.
|
protected OrderLockingHelper | getOrderLockingHelper()
This method gets the com.ibm.commerce.order.utils.OrderLockingHelper instance.
|
protected boolean | isThresholdAcceptable(com.ibm.commerce.order.utils.ThresholdCheckContext context)
Returns whether the threshold in the given context has been exceeded.
|
protected void | lock(java.lang.Long orderId)
This method locks the order resource.
|
protected void | lock(java.lang.Long[] orderIds)
This method locks the order resource.
|
protected boolean | lock(java.lang.Long[] orderIds, boolean takeOverLock)
This method locks the resource if it is not locked.
|
protected boolean | lock(java.lang.Long orderId, boolean takeOverLock)
This method locks the resource if it is not locked.
|
protected void | thresholdExceeded(com.ibm.commerce.order.utils.ThresholdCheckContext context)
Takes some action to react to a threshold that has been exceeded.
|
protected void | unlock(java.lang.Long orderId)
This method unlocks the order resource.
|
protected void | unlock(java.lang.Long[] orderIds)
This method unlocks the order resource.
|
public static final java.lang.String COPYRIGHT
protected OrderLockingHelper getOrderLockingHelper()
protected void checkAndCSRLock(java.lang.Long orderId) throws ECException
protected void checkAndUnlock(java.lang.Long orderId) throws ECException
protected void checkAndUnlock(java.lang.Long orderId, boolean donotCheckCSR) throws ECException
protected void checkLock(java.lang.Long orderId) throws ECException
protected void checkAndCSRLock(java.lang.Long[] orderIds) throws ECException
protected void checkAndUnlock(java.lang.Long[] orderIds) throws ECException
protected void checkAndUnlock(java.lang.Long[] orderIds, boolean donotCheckCSR) throws ECException
protected void checkLock(java.lang.Long[] orderIds) throws ECException
protected boolean lock(java.lang.Long orderId, boolean takeOverLock) throws ECException
protected boolean lock(java.lang.Long[] orderIds, boolean takeOverLock) throws ECException
protected void lock(java.lang.Long orderId) throws ECException
protected void lock(java.lang.Long[] orderIds) throws ECException
protected void unlock(java.lang.Long orderId) throws ECException
protected void unlock(java.lang.Long[] orderIds) throws ECException
protected com.ibm.commerce.order.utils.AdminConfigLoader<com.ibm.commerce.order.utils.OrderThreshold.Part> getAdminConfigLoader()
protected final void checkThreshold(com.ibm.commerce.order.utils.ThresholdCheckContext context) throws ECException
The different situations that result in a call to this method are described by the constants in OrderThreshold. See ThresholdCheckContext for instructions on how to create a ThresholdCheckContext.
This method cannot be overridden, in order to ensure that the basic flow of "check" followed by "action" is performed. However, the "check" and "action" steps can both be customized by overriding the corresponding methods. In order to customize, override isThresholdAcceptable(ThresholdCheckContext) or thresholdExceeded(ThresholdCheckContext).
protected boolean isThresholdAcceptable(com.ibm.commerce.order.utils.ThresholdCheckContext context)
The default behavior depends on the type of threshold. For a quantity, the value will be directly compared with the threshold. For a non-quantity threshold, the value will be added to the current amount and compared with the threshold.
protected void thresholdExceeded(com.ibm.commerce.order.utils.ThresholdCheckContext context) throws ECException
The default behavior is to throw an exception with an error message that explains the problem to the user (by calling ThresholdCheckContext.throwDefaultException()). A message is also written to the log file for the administrator (by calling ThresholdCheckContext.log(Logger, String)).