Class AddressServiceImpl
java.lang.Object
org.broadleafcommerce.profile.core.service.AddressServiceImpl
- All Implemented Interfaces:
AddressService
@Service("blAddressService")
public class AddressServiceImpl
extends Object
implements AddressService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AddressDaoprotected CountrySubdivisionServiceprotected ModuleConfigurationServiceprotected booleanprotected PhoneServiceprotected List<AddressVerificationProvider> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopyAddress(Address orig) Returns a new address instance with the given properties on the originating address minus any default or active values setcopyAddress(Address dest, Address orig) Copies properties from the originating address to the destination address minus any default or active valuescreate()voidvoidpopulateAddressISOCountrySub(Address address) Convenience method that attempts to pre-populate the ISO Country Subdivision on an address.readAddressById(Long addressId) saveAddress(Address address) voidsetMustValidateAddresses(boolean mustValidateAddresses) Default is false.verifyAddress(Address address) Verifies the address and returns a collection of addresses.
-
Field Details
-
mustValidateAddresses
protected boolean mustValidateAddresses -
addressDao
-
moduleConfigService
-
providers
-
phoneService
-
countrySubdivisionService
-
-
Constructor Details
-
AddressServiceImpl
public AddressServiceImpl()
-
-
Method Details
-
saveAddress
- Specified by:
saveAddressin interfaceAddressService
-
readAddressById
- Specified by:
readAddressByIdin interfaceAddressService
-
create
- Specified by:
createin interfaceAddressService
-
delete
- Specified by:
deletein interfaceAddressService
-
verifyAddress
Description copied from interface:AddressServiceVerifies the address and returns a collection of addresses. If the address was invalid but close to a match, this method should return a list of one or more addresses that may be valid. If the address is valid, implementations should return the valid address in the list. Implementations may set the tokenized address, zip four, and verification level. If the address could not be validated, implementors should throw anAddressValidationException.For example, an address may be close, but missing zip four. This service should return the address in question with zip four populated.
- Specified by:
verifyAddressin interfaceAddressService- Returns:
- Throws:
AddressVerificationException
-
copyAddress
Description copied from interface:AddressServiceReturns a new address instance with the given properties on the originating address minus any default or active values set- Specified by:
copyAddressin interfaceAddressService- Parameters:
orig- - the address to copy- Returns:
-
copyAddress
Description copied from interface:AddressServiceCopies properties from the originating address to the destination address minus any default or active values- Specified by:
copyAddressin interfaceAddressService- Parameters:
dest- - the addressorig- - the address- Returns:
-
populateAddressISOCountrySub
Description copied from interface:AddressServiceConvenience method that attempts to pre-populate the ISO Country Subdivision on an address. Strategy attempts to identify the ISO subdivision based on the contents of the "friendly" state/province/region attribute and the ISO alpha-2 country code already populated on the passed in address. It will attempt to look for the "alternate abbreviation" first, and if not found will check the "name" next.- Specified by:
populateAddressISOCountrySubin interfaceAddressService
-
setMustValidateAddresses
public void setMustValidateAddresses(boolean mustValidateAddresses) Default is false. If set to true, the verifyAddress method will throw an exception if there are no providers to handle the request.- Parameters:
mustValidateAddresses-
-