use of gov.ca.cwds.rest.validation.SmartyStreet in project API by ca-cwds.
the class AddressValidationService method fetchValidatedAddresses.
/**
* Returns all valid addresses, up to the default number set in {@link SmartyStreetsDao}
*
* @param address The address to validate
* @return array of {@link ValidatedAddress}
* @throws ServiceException due to SmartyStreets error, I/O error, etc.
*/
public ValidatedAddress[] fetchValidatedAddresses(Address address) throws ServiceException {
ValidatedAddress[] addresses = null;
try {
SmartyStreet smartyStreet = new SmartyStreet(smartyStreetsDao);
addresses = smartyStreet.usStreetSingleAddress(address.getStreetAddress(), address.getCity(), address.getState(), address.getZip());
} catch (Exception e) {
throw new ServiceException("ERROR calling usStreetSingleAddress in SmartyStreet", e);
}
return addresses;
}
Aggregations