com.elasticpath.service.tax
Interface TaxJurisdictionService

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

public interface TaxJurisdictionService
extends EpPersistenceService

Provide TaxJurisdiction-related business service.


Method Summary
 TaxJurisdiction add(TaxJurisdiction taxJurisdiction)
          Adds the given taxJurisdiction.
 TaxJurisdiction get(long taxJurisdictionUid)
          Get the taxJurisdiction with the given UID.
 java.util.List getTaxJurisdictionChildren(TaxJurisdiction taxJurisdiction)
          Get all the child tax jurisidction belong to the given taxJurisdiction.
 java.util.List list()
          List all taxJurisdictions stored in the database.
 java.util.List listRootTaxJurisdictions()
          Retrieve all root tax jurisdictions (the country level ones).
 TaxJurisdiction load(long taxJurisdictionUid)
          Load the taxJurisdiction with the given UID.
 void remove(TaxJurisdiction taxJurisdiction)
          Delete the current taxJurisdiction and all its direct/indirect children.
 TaxJurisdiction retrieveTaxJurisdiction(Address shippingAddress)
          Matches shipping address to lowest available Tax Jurisdiction level.
 void update(TaxJurisdiction taxJurisdiction)
          Updates the given taxJurisdiction.
 
Methods inherited from interface com.elasticpath.service.EpPersistenceService
getObject, getPersistenceEngine, setPersistenceEngine
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Method Detail

add

TaxJurisdiction add(TaxJurisdiction taxJurisdiction)
                    throws TaxJurisdictionExistException
Adds the given taxJurisdiction.

Parameters:
taxJurisdiction - the taxJurisdiction to add
Returns:
the persisted instance of taxJurisdiction
Throws:
TaxJurisdictionExistException - - if a taxJurisdiction associated with the given region already exists.

get

TaxJurisdiction get(long taxJurisdictionUid)
                    throws EpServiceException
Get the taxJurisdiction with the given UID. Return null if no matching record exists.

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

getTaxJurisdictionChildren

java.util.List getTaxJurisdictionChildren(TaxJurisdiction taxJurisdiction)
Get all the child tax jurisidction belong to the given taxJurisdiction.

Parameters:
taxJurisdiction - - the taxJurisdiction to find children for.
Returns:
the list of child tax jurisidction.

list

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

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

listRootTaxJurisdictions

java.util.List listRootTaxJurisdictions()
Retrieve all root tax jurisdictions (the country level ones).

Returns:
return all root tax jurisdictions

load

TaxJurisdiction load(long taxJurisdictionUid)
                     throws EpServiceException
Load the taxJurisdiction with the given UID. Throw an unrecoverable exception if there is no matching database row.

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

remove

void remove(TaxJurisdiction taxJurisdiction)
            throws EpServiceException
Delete the current taxJurisdiction and all its direct/indirect children.

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

retrieveTaxJurisdiction

TaxJurisdiction retrieveTaxJurisdiction(Address shippingAddress)
                                        throws EpServiceException
Matches shipping address to lowest available Tax Jurisdiction level.

Parameters:
shippingAddress - - the shippingAddress used to retrieve the matching jurisdiction.
Returns:
the matching taxJurisdiction.
Throws:
EpServiceException - - in case of any errors

update

void update(TaxJurisdiction taxJurisdiction)
            throws TaxJurisdictionExistException
Updates the given taxJurisdiction.

Parameters:
taxJurisdiction - the taxJurisdiction to update
Throws:
TaxJurisdictionExistException - - if a taxJurisdiction associated with the given region already exists.