com.elasticpath.service.tax.impl
Class TaxCodeServiceImpl

java.lang.Object
  extended by com.elasticpath.service.impl.AbstractEpServiceImpl
      extended by com.elasticpath.service.impl.AbstractEpPersistenceServiceImpl
          extended by com.elasticpath.service.tax.impl.TaxCodeServiceImpl
All Implemented Interfaces:
EpPersistenceService, EpService, TaxCodeService

public class TaxCodeServiceImpl
extends AbstractEpPersistenceServiceImpl
implements TaxCodeService

The default implementation of the TaxCodeService.


Constructor Summary
TaxCodeServiceImpl()
           
 
Method Summary
 TaxCode add(TaxCode taxCode)
          Adds the given taxCode.
 TaxCode get(long taxCodeUid)
          Get the taxCode with the given UID.
 java.lang.Object getObject(long uid)
          Generic load method for all persistable domain models.
 java.util.List getTaxCodesInUse()
          Get the list of tax code (String) in use (being used to define tax value associated with a TaxJurisdiction).
 java.util.List list()
          List all taxCodes stored in the database.
 TaxCode load(long taxCodeUid)
          Load the taxCode with the given UID.
 void remove(TaxCode taxCode)
          Delete the taxCode.
 boolean taxCodeExists(java.lang.String code)
          Checks the given taxCode exists or not.
 void update(TaxCode taxCode)
          Updates the given taxCode.
 
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

TaxCodeServiceImpl

public TaxCodeServiceImpl()
Method Detail

add

public TaxCode add(TaxCode taxCode)
            throws TaxCodeExistException
Adds the given taxCode.

Specified by:
add in interface TaxCodeService
Parameters:
taxCode - the taxCode to add
Returns:
the persisted instance of taxCode
Throws:
TaxCodeExistException - - if the specified tax code already exists.

get

public TaxCode get(long taxCodeUid)
            throws EpServiceException
Get the taxCode with the given UID. Return null if no matching record exists.

Specified by:
get in interface TaxCodeService
Parameters:
taxCodeUid - the taxCode UID
Returns:
the taxCode if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

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

getTaxCodesInUse

public java.util.List getTaxCodesInUse()
                                throws EpServiceException
Get the list of tax code (String) in use (being used to define tax value associated with a TaxJurisdiction).

Specified by:
getTaxCodesInUse in interface TaxCodeService
Returns:
the list of uids of TaxCodes in use.
Throws:
EpServiceException - - in case of any errors

list

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

Specified by:
list in interface TaxCodeService
Returns:
a list of taxCodes
Throws:
EpServiceException - - in case of any errors

load

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

Specified by:
load in interface TaxCodeService
Parameters:
taxCodeUid - the taxCode UID
Returns:
the taxCode if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

remove

public void remove(TaxCode taxCode)
            throws EpServiceException
Delete the taxCode.

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

taxCodeExists

public boolean taxCodeExists(java.lang.String code)
                      throws EpServiceException
Checks the given taxCode exists or not.

Specified by:
taxCodeExists in interface TaxCodeService
Parameters:
code - the taxCode
Returns:
true if the given taxCode exists
Throws:
EpServiceException - - in case of any errors

update

public void update(TaxCode taxCode)
            throws EpServiceException
Updates the given taxCode.

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