public interface LocationService<T extends Location>
Location. It is able to return Locations in the proximity of the given GPS that
are sorted in terms of distances.| Modifier and Type | Method and Description |
|---|---|
boolean |
deleteLocation(T location)
Delete the given IAddress from the collection of stored addresses
|
T |
getLocation(String streetName,
String streetNumber,
String postalCode,
String town,
String countryCode,
boolean geocode)
Get temporary, non-persisted location
|
T |
getLocationByName(String name)
Returns persisted Location by name
|
List<T> |
getLocationsForPoint(GPS gps,
int limitLocationsCount,
BaseStoreModel baseStore)
Method returns the nearest locations (points of interest) to the given coordinates, in the number adequate to user
definition.
|
List<T> |
getLocationsForPostcode(String postalCode,
String countryCode,
int limitLocationsCount,
BaseStoreModel baseStore)
Method looks for nearest locations (points of interest) to the place defined by postal code and country.
|
List<T> |
getLocationsForSearch(String searchTerm,
String countryCode,
int limitLocationsCount,
BaseStoreModel baseStore)
Method looks for nearby locations (points of interest) in the place defined by search term (that can be postal
code or town name) and country.
|
List<T> |
getLocationsForTown(String town,
int limitLocationsCount,
BaseStoreModel baseStore)
Method looks for nearest locations (points of interest) to the place defined by city name.
|
List<T> |
getLocationsNearby(GPS gps,
double distance)
Get all known addresses which are located in the circle centered in the given gps location and a given radius
|
List<T> |
getLocationsNearby(GPS gps,
double distance,
BaseStoreModel baseStore)
Get all known addresses which are located in the circle centered in the given gps location and a given radius,
which belong to a given store
|
List<T> |
getSortedLocationsNearby(GPS gps,
double distance,
BaseStoreModel baseStore)
Returns list of sorted
DistanceAwareLocations. |
boolean |
saveOrUpdateLocation(T location)
Adds a new address or update existing one
|
List<T> getLocationsNearby(GPS gps, double distance) throws LocationServiceException
gps - distance - in kilometersLocationServiceExceptionList<T> getLocationsNearby(GPS gps, double distance, BaseStoreModel baseStore) throws LocationServiceException
gps - distance - in kilometersbaseStore - LocationServiceExceptionboolean saveOrUpdateLocation(T location) throws LocationServiceException
location - LocationServiceExceptionboolean deleteLocation(T location) throws LocationServiceException
location - LocationServiceExceptionT getLocationByName(String name) throws LocationServiceException
name - Location matched by unique nameLocationServiceExceptionT getLocation(String streetName, String streetNumber, String postalCode, String town, String countryCode, boolean geocode) throws LocationServiceException
streetName - streetNumber - postalCode - town - countryCode - geocode - - set to true if return Location should have GPS data populatedLocationLocationServiceExceptionList<T> getLocationsForPoint(GPS gps, int limitLocationsCount, BaseStoreModel baseStore) throws LocationServiceException
gps - coordinates of center pointlimitLocationsCount - number of POIs chosen by userbaseStore - if set, method will return locations bound to the given BaseStoreModelLocationServiceExceptionList<T> getLocationsForSearch(String searchTerm, String countryCode, int limitLocationsCount, BaseStoreModel baseStore) throws LocationServiceException
searchTerm - the search term - can be postal code or town namecountryCode - the country code - country code to look for (valid if given value is postal code)limitLocationsCount - number of locations to returnbaseStore - if set, method will return locations bound to the given BaseStoreModelLocationServiceExceptionList<T> getLocationsForPostcode(String postalCode, String countryCode, int limitLocationsCount, BaseStoreModel baseStore) throws LocationServiceException
postalCode - searching condition for locations - postal codecountryCode - searching condition for locations - country codelimitLocationsCount - number of locations to returnbaseStore - if set, method will return locations bound to the given BaseStoreModelLocationServiceExceptionList<T> getLocationsForTown(String town, int limitLocationsCount, BaseStoreModel baseStore) throws LocationServiceException
town - searching condition for locationslimitLocationsCount - number of locations to returnbaseStore - if set, method will return locations bound to the given BaseStoreModelLocationServiceExceptionList<T> getSortedLocationsNearby(GPS gps, double distance, BaseStoreModel baseStore) throws LocationServiceException
DistanceAwareLocations. Sorting order is ascending - the closest locations come
first.gps - - reference location. Center.distance - - radius in [km]. The returned locations are contained in the square that the circle describes.baseStore - - if set, method will return locations bound to the given BaseStoreModelLocationServiceExceptionCopyright © 2017 SAP SE. All Rights Reserved.