Class BasicShippingRuleProcessor
java.lang.Object
com.softslate.commerce.businessobjects.core.BaseBusinessObject
com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
com.softslate.commerce.businessobjects.shipping.BasicShippingRuleProcessor
- All Implemented Interfaces:
BusinessObject
,BusinessProcessor
,ShippingRuleProcessor
public class BasicShippingRuleProcessor
extends BaseBusinessProcessor
implements ShippingRuleProcessor
Processes business logic having to do with shipping rules. Created in the
Struts layer in response to requests for viewing, editing, adding, and
deleting discounts.
BasicShippingRuleProcessor
is the default implementation of
the ShippingRuleProcessor
interface for the application.
- Author:
- Jason McWilliams
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddShippingRule
(Map parameters) void
applyDiscount
(Map method, OrderShippingRule osr) void
applyDiscountToMatchingMethods
(Collection availableMethods, OrderShippingRule osr) void
applyDiscountToNotMatchingMethods
(Collection availableMethods, OrderShippingRule osr) void
applyShippingDiscountsToAvailableMethods
(Collection orderShippingRules, Collection availableMethods) void
void
createLeftOverPackage
(int quantity, double weight, double leftOverTotal) void
createMethodLimit
(ShippingRule sr, ShippingRuleRange srr, OrderItem oi) int
createPackage
(ShippingRule sr, ShippingRuleRange srr, OrderItem oi, int currentQuantity, boolean firstRule) void
createPossibleDiscount
(ShippingRule sr, ShippingRuleRange srr, OrderItem oi) void
deleteShippingRule
(Map parameters) boolean
editDeleteShippingRules
(Map parameters) editShippingRule
(Map parameters) findAvailableShippingProcessors
(Collection availableMethods, int orderID) getShippingRulesBySkuIDs
(Collection skuIDs) getSkuIDs
(OrderItem oi, Collection matchingSkus) boolean
isShippingRuleOk
(ShippingRule shippingRule, OrderItem oi) loadShippingRuleFromID
(Map parameters) loadShippingRulesAndCount
(Map parameters) processAddItems
(Collection newOrderItems) void
processAllowMethods
(Collection orderShippingRules, Collection availableMethods) processEditItem
(Collection newOrderItems) void
processMethodLimits
(OrderItem oi, Collection rules) processOnCheckout
(Map parameters) processOrderComplete
(Map parameters) int
processPackages
(OrderItem oi, Collection rules) void
processPossibleDiscounts
(OrderItem oi, Collection rules) processShippingRules
(Collection newOrderItems) processSkuShippingRules
(Collection orderItems) boolean
rangeMatch
(ShippingRuleRange srr, OrderItem oi) void
removeShippingMethodFromAvailableList
(Collection hasToBe, Collection availableMethods) void
removeShippingMethodFromAvailableList
(Map removeMethod, Collection availableMethods) Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
formatDateTime, formatPrice, getAppComponents, getAppSettings, getAttributeIDs, getBusinessObjectFactory, getDaoFactory, getEventBus, getInjector, getProductIDs, getSettings, getUser, initialize, isProcessorClassActive, loadMatchingSkus, parseDateTime, parseResponseData, prepareRequestData, sendHTTPGet, sendHTTPPost, sendHTTPPost, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setEventBus, setInjector, setSettings, setUser, updateOrderTotals, updateOrderTotals, updateOrderTotals, utils
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initialize
Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessProcessor
getAppComponents, getAppSettings, getBusinessObjectFactory, getDaoFactory, getEventBus, getInjector, getSettings, getUser, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setEventBus, setInjector, setSettings, setUser, utils
-
Field Details
-
log
static org.apache.commons.logging.Log log
-
-
Constructor Details
-
BasicShippingRuleProcessor
public BasicShippingRuleProcessor()
-
-
Method Details
-
loadShippingRulesAndCount
- Specified by:
loadShippingRulesAndCount
in interfaceShippingRuleProcessor
- Throws:
Exception
-
addShippingRule
- Specified by:
addShippingRule
in interfaceShippingRuleProcessor
- Throws:
Exception
-
loadShippingRuleFromID
- Specified by:
loadShippingRuleFromID
in interfaceShippingRuleProcessor
- Throws:
Exception
-
editShippingRule
- Specified by:
editShippingRule
in interfaceShippingRuleProcessor
- Throws:
Exception
-
editDeleteShippingRules
- Specified by:
editDeleteShippingRules
in interfaceShippingRuleProcessor
- Throws:
Exception
-
deleteShippingRule
- Specified by:
deleteShippingRule
in interfaceShippingRuleProcessor
- Throws:
Exception
-
findAvailableShippingProcessors
public Collection findAvailableShippingProcessors(Collection availableMethods, int orderID) throws Exception - Specified by:
findAvailableShippingProcessors
in interfaceShippingRuleProcessor
- Throws:
Exception
-
applyShippingDiscountsToAvailableMethods
public void applyShippingDiscountsToAvailableMethods(Collection orderShippingRules, Collection availableMethods) throws Exception - Throws:
Exception
-
applyDiscount
- Throws:
Exception
-
applyDiscountToMatchingMethods
public void applyDiscountToMatchingMethods(Collection availableMethods, OrderShippingRule osr) throws Exception - Throws:
Exception
-
applyDiscountToNotMatchingMethods
public void applyDiscountToNotMatchingMethods(Collection availableMethods, OrderShippingRule osr) throws Exception - Throws:
Exception
-
processAllowMethods
public void processAllowMethods(Collection orderShippingRules, Collection availableMethods) throws Exception - Throws:
Exception
-
removeShippingMethodFromAvailableList
public void removeShippingMethodFromAvailableList(Collection hasToBe, Collection availableMethods) throws Exception - Throws:
Exception
-
removeShippingMethodFromAvailableList
public void removeShippingMethodFromAvailableList(Map removeMethod, Collection availableMethods) throws Exception - Throws:
Exception
-
processOrderComplete
- Specified by:
processOrderComplete
in interfaceShippingRuleProcessor
- Throws:
Exception
-
processEditItem
- Specified by:
processEditItem
in interfaceShippingRuleProcessor
- Throws:
Exception
-
processAddItems
- Specified by:
processAddItems
in interfaceShippingRuleProcessor
- Throws:
Exception
-
processOnCheckout
- Specified by:
processOnCheckout
in interfaceShippingRuleProcessor
- Throws:
Exception
-
processShippingRules
- Specified by:
processShippingRules
in interfaceShippingRuleProcessor
- Throws:
Exception
-
processGlobalShippingRules
- Throws:
Exception
-
processSkuShippingRules
- Throws:
Exception
-
getLimitByLocationShippingRules
- Throws:
Exception
-
doesLimitByLocationRuleApply
- Throws:
Exception
-
createGlobalOrderShippingRule
- Throws:
Exception
-
rangeMatch
- Throws:
Exception
-
processPackages
- Throws:
Exception
-
processPossibleDiscounts
- Throws:
Exception
-
processMethodLimits
- Throws:
Exception
-
createLeftOverPackage
public void createLeftOverPackage(int quantity, double weight, double leftOverTotal) throws Exception - Throws:
Exception
-
createPackage
public int createPackage(ShippingRule sr, ShippingRuleRange srr, OrderItem oi, int currentQuantity, boolean firstRule) throws Exception - Throws:
Exception
-
createPossibleDiscount
public void createPossibleDiscount(ShippingRule sr, ShippingRuleRange srr, OrderItem oi) throws Exception - Throws:
Exception
-
createMethodLimit
public void createMethodLimit(ShippingRule sr, ShippingRuleRange srr, OrderItem oi) throws Exception - Throws:
Exception
-
isShippingRuleOk
- Throws:
Exception
-
getShippingRulesBySkuIDs
- Throws:
Exception
-
getSkuIDs
-
processRemoveAllRules
- Throws:
Exception
-