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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddShippingRule(Map parameters) voidapplyDiscount(Map method, OrderShippingRule osr) voidapplyDiscountToMatchingMethods(Collection availableMethods, OrderShippingRule osr) voidapplyDiscountToNotMatchingMethods(Collection availableMethods, OrderShippingRule osr) voidapplyShippingDiscountsToAvailableMethods(Collection orderShippingRules, Collection availableMethods) voidvoidcreateLeftOverPackage(int quantity, double weight, double leftOverTotal) voidcreateMethodLimit(ShippingRule sr, ShippingRuleRange srr, OrderItem oi) intcreatePackage(ShippingRule sr, ShippingRuleRange srr, OrderItem oi, int currentQuantity, boolean firstRule) voidcreatePossibleDiscount(ShippingRule sr, ShippingRuleRange srr, OrderItem oi) voiddeleteShippingRule(Map parameters) booleaneditDeleteShippingRules(Map parameters) editShippingRule(Map parameters) findAvailableShippingProcessors(Collection availableMethods, int orderID) getShippingRulesBySkuIDs(Collection skuIDs) getSkuIDs(OrderItem oi, Collection matchingSkus) booleanisShippingRuleOk(ShippingRule shippingRule, OrderItem oi) loadShippingRuleFromID(Map parameters) loadShippingRulesAndCount(Map parameters) processAddItems(Collection newOrderItems) voidprocessAllowMethods(Collection orderShippingRules, Collection availableMethods) processEditItem(Collection newOrderItems) voidprocessMethodLimits(OrderItem oi, Collection rules) processOnCheckout(Map parameters) processOrderComplete(Map parameters) intprocessPackages(OrderItem oi, Collection rules) voidprocessPossibleDiscounts(OrderItem oi, Collection rules) processShippingRules(Collection newOrderItems) processSkuShippingRules(Collection orderItems) booleanrangeMatch(ShippingRuleRange srr, OrderItem oi) voidremoveShippingMethodFromAvailableList(Collection hasToBe, Collection availableMethods) voidremoveShippingMethodFromAvailableList(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, utilsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initializeMethods 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:
loadShippingRulesAndCountin interfaceShippingRuleProcessor- Throws:
Exception
-
addShippingRule
- Specified by:
addShippingRulein interfaceShippingRuleProcessor- Throws:
Exception
-
loadShippingRuleFromID
- Specified by:
loadShippingRuleFromIDin interfaceShippingRuleProcessor- Throws:
Exception
-
editShippingRule
- Specified by:
editShippingRulein interfaceShippingRuleProcessor- Throws:
Exception
-
editDeleteShippingRules
- Specified by:
editDeleteShippingRulesin interfaceShippingRuleProcessor- Throws:
Exception
-
deleteShippingRule
- Specified by:
deleteShippingRulein interfaceShippingRuleProcessor- Throws:
Exception
-
findAvailableShippingProcessors
public Collection findAvailableShippingProcessors(Collection availableMethods, int orderID) throws Exception - Specified by:
findAvailableShippingProcessorsin 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:
processOrderCompletein interfaceShippingRuleProcessor- Throws:
Exception
-
processEditItem
- Specified by:
processEditItemin interfaceShippingRuleProcessor- Throws:
Exception
-
processAddItems
- Specified by:
processAddItemsin interfaceShippingRuleProcessor- Throws:
Exception
-
processOnCheckout
- Specified by:
processOnCheckoutin interfaceShippingRuleProcessor- Throws:
Exception
-
processShippingRules
- Specified by:
processShippingRulesin 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
-