com.elasticpath.service.shipping.impl
Class ShippingServiceLevelServiceImpl

java.lang.Object
  extended by com.elasticpath.service.impl.AbstractEpServiceImpl
      extended by com.elasticpath.service.impl.AbstractEpPersistenceServiceImpl
          extended by com.elasticpath.service.shipping.impl.ShippingServiceLevelServiceImpl
All Implemented Interfaces:
EpPersistenceService, EpService, ShippingServiceLevelService

public class ShippingServiceLevelServiceImpl
extends AbstractEpPersistenceServiceImpl
implements ShippingServiceLevelService

Provide shipping service level-related business service.


Constructor Summary
ShippingServiceLevelServiceImpl()
           
 
Method Summary
 ShippingServiceLevel add(ShippingServiceLevel shippingServiceLevel)
          Adds the given shippingServiceLevel.
 ShippingServiceLevel get(long shippingServiceLevelUid)
          Get the shippingServiceLevel with the given UID.
 java.util.List getAllShippingCostCalculationMethods()
          Get all the available shipping cost calculation methods configured in the system.
 java.util.Map getCountrySubCountryMapWithShippingService()
          Get the list of countryCode which has ShippingServiceLevel configure at country level or subCountry level.
 java.lang.Object getObject(long uid)
          Generic load method for all persistable domain models.
 java.util.List getShippingRegionInUseUidList()
          Get the list of uids of ShippingRegion used by existing ShippingServiceLevels.
 java.util.List getShippingServiceLevelInUseUidList()
          Get the list of uids of ShippingServiceLevel used by existing shipping related promotion rules.
 java.util.List list()
          List all shippingServiceLevels stored in the database.
 ShippingServiceLevel load(long shippingServiceLevelUid)
          Load the shippingServiceLevel with the given UID.
 void remove(ShippingServiceLevel shippingServiceLevel)
          Delete the shippingServiceLevel.
 java.util.List retrieveShippingServiceLevel(ShoppingCart shoppingCart)
          Retrieve the list of valid ShippingServiceLevel based on the region info inside the given ShoppingCart.
 void setAllShippingCostCalculationMethods(java.util.List allShippingCostCalculationMethodsName)
          Set all the available shipping cost calculation methods configured in the system.
 void setRuleParameterService(RuleParameterService ruleParameterService)
          Set the RuleParameterService.
 void update(ShippingServiceLevel shippingServiceLevel)
          Updates the given shippingServiceLevel.
 
Methods inherited from class com.elasticpath.service.impl.AbstractEpPersistenceServiceImpl
getPersistenceEngine, setPersistenceEngine
 
Methods inherited from class com.elasticpath.service.impl.AbstractEpServiceImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.service.EpPersistenceService
getPersistenceEngine, setPersistenceEngine
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Constructor Detail

ShippingServiceLevelServiceImpl

public ShippingServiceLevelServiceImpl()
Method Detail

add

public ShippingServiceLevel add(ShippingServiceLevel shippingServiceLevel)
                         throws EpServiceException
Adds the given shippingServiceLevel.

Specified by:
add in interface ShippingServiceLevelService
Parameters:
shippingServiceLevel - the shippingServiceLevel to add
Returns:
the persisted instance of shippingServiceLevel
Throws:
EpServiceException - - in case of any errors

get

public ShippingServiceLevel get(long shippingServiceLevelUid)
                         throws EpServiceException
Get the shippingServiceLevel with the given UID. Return null if no matching record exists.

Specified by:
get in interface ShippingServiceLevelService
Parameters:
shippingServiceLevelUid - the shippingServiceLevel UID
Returns:
the shippingServiceLevel if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

getAllShippingCostCalculationMethods

public java.util.List getAllShippingCostCalculationMethods()
Get all the available shipping cost calculation methods configured in the system.

Specified by:
getAllShippingCostCalculationMethods in interface ShippingServiceLevelService
Returns:
the list available shipping cost calculation methods.

getCountrySubCountryMapWithShippingService

public java.util.Map getCountrySubCountryMapWithShippingService()
Get the list of countryCode which has ShippingServiceLevel configure at country level or subCountry level.

Specified by:
getCountrySubCountryMapWithShippingService in interface ShippingServiceLevelService
Returns:
the list of countryCode.

getObject

public java.lang.Object getObject(long uid)
                           throws EpServiceException
Generic load method for all persistable domain models.

Specified by:
getObject in interface EpPersistenceService
Parameters:
uid - the persisted instance uid
Returns:
the persisted instance if exists, otherwise null
Throws:
EpServiceException - - in case of any errors

getShippingRegionInUseUidList

public java.util.List getShippingRegionInUseUidList()
Get the list of uids of ShippingRegion used by existing ShippingServiceLevels.

Specified by:
getShippingRegionInUseUidList in interface ShippingServiceLevelService
Returns:
the list of uids of ShippingRegions in use.

getShippingServiceLevelInUseUidList

public java.util.List getShippingServiceLevelInUseUidList()
Get the list of uids of ShippingServiceLevel used by existing shipping related promotion rules.

Specified by:
getShippingServiceLevelInUseUidList in interface ShippingServiceLevelService
Returns:
the list of uids of ShippingServiceLevels in use.

list

public java.util.List list()
                    throws EpServiceException
List all shippingServiceLevels stored in the database.

Specified by:
list in interface ShippingServiceLevelService
Returns:
a list of shippingServiceLevels
Throws:
EpServiceException - - in case of any errors

load

public ShippingServiceLevel load(long shippingServiceLevelUid)
                          throws EpServiceException
Load the shippingServiceLevel with the given UID. Throw an unrecoverable exception if there is no matching database row.

Specified by:
load in interface ShippingServiceLevelService
Parameters:
shippingServiceLevelUid - the shippingServiceLevel UID
Returns:
the shippingServiceLevel if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

remove

public void remove(ShippingServiceLevel shippingServiceLevel)
            throws EpServiceException
Delete the shippingServiceLevel.

Specified by:
remove in interface ShippingServiceLevelService
Parameters:
shippingServiceLevel - the shippingServiceLevel to remove
Throws:
EpServiceException - - in case of any errors

retrieveShippingServiceLevel

public java.util.List retrieveShippingServiceLevel(ShoppingCart shoppingCart)
Retrieve the list of valid ShippingServiceLevel based on the region info inside the given ShoppingCart.

Specified by:
retrieveShippingServiceLevel in interface ShippingServiceLevelService
Parameters:
shoppingCart - -- the shoppingCart to be used to retrieve shippingServiceLevel info.
Returns:
he list of valid ShippingServiceLevel for the given shoppingCart.

setAllShippingCostCalculationMethods

public void setAllShippingCostCalculationMethods(java.util.List allShippingCostCalculationMethodsName)
Set all the available shipping cost calculation methods configured in the system.

Specified by:
setAllShippingCostCalculationMethods in interface ShippingServiceLevelService
Parameters:
allShippingCostCalculationMethodsName - - names of the available shipping cost calculation methods.

setRuleParameterService

public void setRuleParameterService(RuleParameterService ruleParameterService)
Set the RuleParameterService.

Parameters:
ruleParameterService - the RuleParameterService instance.

update

public void update(ShippingServiceLevel shippingServiceLevel)
            throws EpServiceException
Updates the given shippingServiceLevel.

Specified by:
update in interface ShippingServiceLevelService
Parameters:
shippingServiceLevel - the shippingServiceLevel to update
Throws:
EpServiceException - - in case of any errors