public class DefaultLocationService extends java.lang.Object implements LocationService
| Constructor and Description |
|---|
DefaultLocationService() |
| Modifier and Type | Method and Description |
|---|---|
protected double |
calculateDistance(GPS referenceGps,
PointOfServiceModel posModel) |
boolean |
deleteLocation(Location location)
Delete the given IAddress from the collection of stored addresses
|
protected CommonI18NService |
getCommonI18NService() |
protected GeoWebServiceWrapper |
getGeoServiceWrapper() |
protected I18NService |
getI18nService()
Deprecated.
since 6.4 use
getCommonI18NService() or inject in your extended bean |
Location |
getLocation(java.lang.String streetName,
java.lang.String streetNumber,
java.lang.String postalCode,
java.lang.String town,
java.lang.String countryCode,
boolean geocode)
Get temporary, non-persisted location
|
Location |
getLocationByName(java.lang.String name)
Returns persisted Location by name
|
protected LocationMapService |
getLocationMapService() |
java.util.List<Location> |
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.
|
java.util.List<Location> |
getLocationsForPostcode(java.lang.String postalCode,
java.lang.String countryCode,
int limitLocationsCount,
BaseStoreModel baseStore)
Method looks for nearest locations (points of interest) to the place defined by postal code and country.
|
java.util.List<Location> |
getLocationsForSearch(java.lang.String searchTerm,
java.lang.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.
|
java.util.List<Location> |
getLocationsForTown(java.lang.String town,
int limitLocationsCount,
BaseStoreModel baseStore)
Method looks for nearest locations (points of interest) to the place defined by city name.
|
java.util.List<Location> |
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
|
java.util.List<Location> |
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
|
protected MapService |
getMapService() |
protected ModelService |
getModelService() |
protected PointOfServiceDao |
getPointOfServiceDao() |
java.util.List<DistanceAwareLocation> |
getSortedLocationsNearby(GPS gps,
double distance,
BaseStoreModel baseStore)
Returns list of sorted
DistanceAwareLocations. |
boolean |
saveOrUpdateLocation(Location location)
Adds a new address or update existing one
|
void |
setCommonI18NService(CommonI18NService commonI18NService) |
void |
setGeoServiceWrapper(GeoWebServiceWrapper geoServiceWrapper) |
void |
setI18nService(I18NService i18nService)
Deprecated.
since 6.4 use
setCommonI18NService(CommonI18NService) or inject in your extended bean |
void |
setLocationMapService(LocationMapService locationMapService) |
void |
setMapService(MapService mapService) |
void |
setModelService(ModelService modelService) |
void |
setPointOfServiceDao(PointOfServiceDao pointOfServiceDao) |
protected void |
validateInputData(java.lang.Object input,
java.lang.String message)
Validation for input parameters.
|
public boolean deleteLocation(Location location)
LocationServicedeleteLocation in interface LocationServicepublic java.util.List<Location> getLocationsNearby(GPS gps, double distance)
LocationServicegetLocationsNearby in interface LocationServicedistance - in kilometerspublic java.util.List<Location> getLocationsNearby(GPS gps, double distance, BaseStoreModel baseStore)
LocationServicegetLocationsNearby in interface LocationServicedistance - in kilometerspublic java.util.List<DistanceAwareLocation> getSortedLocationsNearby(GPS gps, double distance, BaseStoreModel baseStore)
LocationServiceDistanceAwareLocations. Sorting order is ascending - the closest locations come
first.getSortedLocationsNearby in interface LocationServicegps - - 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 BaseStoreModelprotected double calculateDistance(GPS referenceGps, PointOfServiceModel posModel)
public boolean saveOrUpdateLocation(Location location)
LocationServicesaveOrUpdateLocation in interface LocationServicepublic Location getLocationByName(java.lang.String name)
LocationServicegetLocationByName in interface LocationServiceLocation matched by unique namepublic Location getLocation(java.lang.String streetName, java.lang.String streetNumber, java.lang.String postalCode, java.lang.String town, java.lang.String countryCode, boolean geocode)
LocationServicegetLocation in interface LocationServicegeocode - - set to true if return Location should have GPS data populatedLocationpublic java.util.List<Location> getLocationsForPostcode(java.lang.String postalCode, java.lang.String countryCode, int limitLocationsCount, BaseStoreModel baseStore)
LocationServicegetLocationsForPostcode in interface LocationServicepostalCode - 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 BaseStoreModelpublic java.util.List<Location> getLocationsForTown(java.lang.String town, int limitLocationsCount, BaseStoreModel baseStore)
LocationServicegetLocationsForTown in interface LocationServicetown - searching condition for locationslimitLocationsCount - number of locations to returnbaseStore - if set, method will return locations bound to the given BaseStoreModelpublic java.util.List<Location> getLocationsForSearch(java.lang.String searchTerm, java.lang.String countryCode, int limitLocationsCount, BaseStoreModel baseStore)
LocationServicegetLocationsForSearch in interface LocationServicesearchTerm - 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 BaseStoreModelpublic java.util.List<Location> getLocationsForPoint(GPS gps, int limitLocationsCount, BaseStoreModel baseStore)
LocationServicegetLocationsForPoint in interface LocationServicegps - coordinates of center pointlimitLocationsCount - number of POIs chosen by userbaseStore - if set, method will return locations bound to the given BaseStoreModelprotected void validateInputData(java.lang.Object input,
java.lang.String message)
input - parameter to validatemessage - message to be thrownprotected MapService getMapService()
public void setMapService(MapService mapService)
protected LocationMapService getLocationMapService()
public void setLocationMapService(LocationMapService locationMapService)
protected ModelService getModelService()
public void setModelService(ModelService modelService)
protected GeoWebServiceWrapper getGeoServiceWrapper()
public void setGeoServiceWrapper(GeoWebServiceWrapper geoServiceWrapper)
protected CommonI18NService getCommonI18NService()
public void setCommonI18NService(CommonI18NService commonI18NService)
@Deprecated protected I18NService getI18nService()
getCommonI18NService() or inject in your extended bean@Deprecated public void setI18nService(I18NService i18nService)
setCommonI18NService(CommonI18NService) or inject in your extended beanprotected PointOfServiceDao getPointOfServiceDao()
public void setPointOfServiceDao(PointOfServiceDao pointOfServiceDao)
Copyright © 2017 SAP SE. All Rights Reserved.