com.elasticpath.service.shipping
Interface ShippingRegionService

All Superinterfaces:
EpPersistenceService, EpService
All Known Implementing Classes:
ShippingRegionServiceImpl

public interface ShippingRegionService
extends EpPersistenceService

Provide shipping service level-related business service.


Method Summary
 ShippingRegion add(ShippingRegion shippingRegion)
          Adds the given shippingRegion.
 ShippingRegion findByName(java.lang.String name)
          Find the shipping region with the given name.
 ShippingRegion get(long shippingRegionUid)
          Get the shippingRegion with the given UID.
 java.util.List getAllRegions()
          Return the List of all possible Region (country/sub country combintaion) based on the country and subcountry property configuraion.
 PropertyService getPropertyService()
          Return the propertyService singleton.
 java.util.List list()
          List all shippingRegions stored in the database.
 ShippingRegion load(long shippingRegionUid)
          Load the shippingRegion with the given UID.
 boolean nameExists(ShippingRegion shippingRegion)
          Check if a different shipping region with the given shipping region's name exists exists or not.
 boolean nameExists(java.lang.String name)
          Check the given shipping region's name exists or not.
 void remove(ShippingRegion shippingRegion)
          Delete the shippingRegion.
 void setPropertyService(PropertyService propertyService)
          Set the propertyService singleton.
 void update(ShippingRegion shippingRegion)
          Updates the given shippingRegion.
 
Methods inherited from interface com.elasticpath.service.EpPersistenceService
getObject, getPersistenceEngine, setPersistenceEngine
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Method Detail

add

ShippingRegion add(ShippingRegion shippingRegion)
                   throws ShippingRegionExistException
Adds the given shippingRegion.

Parameters:
shippingRegion - the shippingRegion to add
Returns:
the persisted instance of shippingRegion
Throws:
ShippingRegionExistException - - If a shipping region with the same name already exists.

findByName

ShippingRegion findByName(java.lang.String name)
                          throws EpServiceException
Find the shipping region with the given name.

Parameters:
name - - the shipping region name
Returns:
the shippingRegion with the given name if exists, otherwise null
Throws:
EpServiceException - - in case of any errors

get

ShippingRegion get(long shippingRegionUid)
                   throws EpServiceException
Get the shippingRegion with the given UID. Return null if no matching record exists.

Parameters:
shippingRegionUid - the shippingRegion UID
Returns:
the shippingRegion if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

getAllRegions

java.util.List getAllRegions()
Return the List of all possible Region (country/sub country combintaion) based on the country and subcountry property configuraion.

Returns:
the list of all possible Region.

getPropertyService

PropertyService getPropertyService()
Return the propertyService singleton.

Returns:
the propertyService singleton.

list

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

Returns:
a list of shippingRegions
Throws:
EpServiceException - - in case of any errors

load

ShippingRegion load(long shippingRegionUid)
                    throws EpServiceException
Load the shippingRegion with the given UID. Throw an unrecoverable exception if there is no matching database row.

Parameters:
shippingRegionUid - the shippingRegion UID
Returns:
the shippingRegion if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

nameExists

boolean nameExists(ShippingRegion shippingRegion)
                   throws EpServiceException
Check if a different shipping region with the given shipping region's name exists exists or not.

Parameters:
shippingRegion - - the shippingRegion to check
Returns:
true if a different shipping region with the same name exists
Throws:
EpServiceException - - in case of any errors

nameExists

boolean nameExists(java.lang.String name)
                   throws EpServiceException
Check the given shipping region's name exists or not.

Parameters:
name - - the group name to check
Returns:
true if the given shipping region name exists
Throws:
EpServiceException - - in case of any errors

remove

void remove(ShippingRegion shippingRegion)
            throws EpServiceException
Delete the shippingRegion.

Parameters:
shippingRegion - the shippingRegion to remove
Throws:
EpServiceException - - in case of any errors

setPropertyService

void setPropertyService(PropertyService propertyService)
Set the propertyService singleton.

Parameters:
propertyService - - the propertyService singleton.

update

void update(ShippingRegion shippingRegion)
            throws ShippingRegionExistException
Updates the given shippingRegion.

Parameters:
shippingRegion - the shippingRegion to update
Throws:
ShippingRegionExistException - - If a shipping region with the same name already exists.