org.broadleafcommerce.pricing.service.module
Class USPSShippingCalculationModule

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

public abstract class USPSShippingCalculationModule
extends java.lang.Object
implements 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  java.lang.Boolean isDefaultModule
           
protected  java.lang.String name
           
protected  java.lang.String originationPostalCode
           
protected  USPSShippingCalculationService shippingCalculationService
           
 
Constructor Summary
USPSShippingCalculationModule()
           
 
Method Summary
 FulfillmentGroup calculateShippingForFulfillmentGroup(FulfillmentGroup fulfillmentGroup)
           
protected abstract  java.util.List<USPSContainerItemRequest> createPackages(FulfillmentGroup fulfillmentGroup)
           
protected  USPSPostage deducePostage(USPSServiceResponseType responseType, java.util.List<USPSContainerItemRequest> requestItems, USPSContainerItemResponse itemResponse)
           
protected  USPSContainerItemRequest findRequestByPackageId(java.lang.String packageId, java.util.List<USPSContainerItemRequest> requestItems)
           
 java.lang.String getName()
           
 java.lang.String getOriginationPostalCode()
           
 java.lang.Boolean isDefaultModule()
           
 java.lang.Boolean isValidModuleForService(java.lang.String serviceName)
           
 void setDefaultModule(java.lang.Boolean isDefaultModule)
           
 void setName(java.lang.String name)
           
 void setOriginationPostalCode(java.lang.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 java.lang.String name

originationPostalCode

protected java.lang.String originationPostalCode

isDefaultModule

protected java.lang.Boolean isDefaultModule

shippingCalculationService

protected USPSShippingCalculationService shippingCalculationService
Constructor Detail

USPSShippingCalculationModule

public USPSShippingCalculationModule()
Method Detail

calculateShippingForFulfillmentGroup

public FulfillmentGroup calculateShippingForFulfillmentGroup(FulfillmentGroup fulfillmentGroup)
                                                      throws ShippingPriceException
Specified by:
calculateShippingForFulfillmentGroup in interface ShippingModule
Throws:
ShippingPriceException

deducePostage

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

findRequestByPackageId

protected USPSContainerItemRequest findRequestByPackageId(java.lang.String packageId,
                                                          java.util.List<USPSContainerItemRequest> requestItems)

getName

public java.lang.String getName()
Specified by:
getName in interface ShippingModule

setName

public void setName(java.lang.String name)
Specified by:
setName in interface ShippingModule

createPackages

protected abstract java.util.List<USPSContainerItemRequest> createPackages(FulfillmentGroup fulfillmentGroup)
                                                                    throws ShippingPriceException
Throws:
ShippingPriceException

isValidModuleForService

public java.lang.Boolean isValidModuleForService(java.lang.String serviceName)
Specified by:
isValidModuleForService in interface ShippingModule

getOriginationPostalCode

public java.lang.String getOriginationPostalCode()

setOriginationPostalCode

public void setOriginationPostalCode(java.lang.String originationPostalCode)

isDefaultModule

public java.lang.Boolean isDefaultModule()
Specified by:
isDefaultModule in interface ShippingModule

setDefaultModule

public void setDefaultModule(java.lang.Boolean isDefaultModule)
Specified by:
setDefaultModule in interface ShippingModule


Copyright © 2012. All Rights Reserved.