org.broadleafcommerce.pricing.service.module
Class USPSShippingCalculationModule

java.lang.Object
  extended by org.broadleafcommerce.pricing.service.module.USPSShippingCalculationModule
All Implemented Interfaces:
org.broadleafcommerce.core.pricing.service.module.ShippingModule
Direct Known Subclasses:
USPSSingleItemPerPackageShippingCalculationModule

public abstract class USPSShippingCalculationModule
extends Object
implements org.broadleafcommerce.core.pricing.service.module.ShippingModule

This module will utilize the USPSShippingCalculationService to take your fulfillment group order items and calculate the total shipping rate. Developers must extend this class and implement their own algorithm in the createPackages method for packaging individual items into one or more boxes.

Author:
jfischer

Field Summary
protected  Boolean isDefaultModule
           
protected  String name
           
protected  String originationPostalCode
           
protected  USPSShippingCalculationService shippingCalculationService
           
 
Constructor Summary
USPSShippingCalculationModule()
           
 
Method Summary
 org.broadleafcommerce.core.order.domain.FulfillmentGroup calculateShippingForFulfillmentGroup(org.broadleafcommerce.core.order.domain.FulfillmentGroup fulfillmentGroup)
           
protected abstract  List<USPSContainerItemRequest> createPackages(org.broadleafcommerce.core.order.domain.FulfillmentGroup fulfillmentGroup)
           
protected  USPSPostage deducePostage(USPSServiceResponseType responseType, List<USPSContainerItemRequest> requestItems, USPSContainerItemResponse itemResponse)
           
protected  USPSContainerItemRequest findRequestByPackageId(String packageId, List<USPSContainerItemRequest> requestItems)
           
 String getName()
           
 String getOriginationPostalCode()
           
 Boolean isDefaultModule()
           
 Boolean isValidModuleForService(String serviceName)
           
 void setDefaultModule(Boolean isDefaultModule)
           
 void setName(String name)
           
 void setOriginationPostalCode(String originationPostalCode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.broadleafcommerce.core.pricing.service.module.ShippingModule
getServiceName
 

Field Detail

name

protected String name

originationPostalCode

protected String originationPostalCode

isDefaultModule

protected Boolean isDefaultModule

shippingCalculationService

protected USPSShippingCalculationService shippingCalculationService
Constructor Detail

USPSShippingCalculationModule

public USPSShippingCalculationModule()
Method Detail

calculateShippingForFulfillmentGroup

public org.broadleafcommerce.core.order.domain.FulfillmentGroup calculateShippingForFulfillmentGroup(org.broadleafcommerce.core.order.domain.FulfillmentGroup fulfillmentGroup)
                                                                                              throws org.broadleafcommerce.common.vendor.service.exception.ShippingPriceException
Specified by:
calculateShippingForFulfillmentGroup in interface org.broadleafcommerce.core.pricing.service.module.ShippingModule
Throws:
org.broadleafcommerce.common.vendor.service.exception.ShippingPriceException

deducePostage

protected USPSPostage deducePostage(USPSServiceResponseType responseType,
                                    List<USPSContainerItemRequest> requestItems,
                                    USPSContainerItemResponse itemResponse)

findRequestByPackageId

protected USPSContainerItemRequest findRequestByPackageId(String packageId,
                                                          List<USPSContainerItemRequest> requestItems)

getName

public String getName()
Specified by:
getName in interface org.broadleafcommerce.core.pricing.service.module.ShippingModule

setName

public void setName(String name)
Specified by:
setName in interface org.broadleafcommerce.core.pricing.service.module.ShippingModule

createPackages

protected abstract List<USPSContainerItemRequest> createPackages(org.broadleafcommerce.core.order.domain.FulfillmentGroup fulfillmentGroup)
                                                          throws org.broadleafcommerce.common.vendor.service.exception.ShippingPriceException
Throws:
org.broadleafcommerce.common.vendor.service.exception.ShippingPriceException

isValidModuleForService

public Boolean isValidModuleForService(String serviceName)
Specified by:
isValidModuleForService in interface org.broadleafcommerce.core.pricing.service.module.ShippingModule

getOriginationPostalCode

public String getOriginationPostalCode()

setOriginationPostalCode

public void setOriginationPostalCode(String originationPostalCode)

isDefaultModule

public Boolean isDefaultModule()
Specified by:
isDefaultModule in interface org.broadleafcommerce.core.pricing.service.module.ShippingModule

setDefaultModule

public void setDefaultModule(Boolean isDefaultModule)
Specified by:
setDefaultModule in interface org.broadleafcommerce.core.pricing.service.module.ShippingModule


Copyright © 2012. All Rights Reserved.