public class DefaultLocationService extends AbstractBusinessService implements LocationService
AbstractService.SerializableDTOmodelService, sessionService, txManagertenant| 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
|
Location |
getLocation(String streetName,
String streetNumber,
String postalCode,
String town,
String countryCode,
boolean geocode)
Get temporary, non-persisted location
|
Location |
getLocationByName(String name)
Returns persisted Location by name
|
LocationMapService |
getLocationMapService() |
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.
|
List<Location> |
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<Location> |
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<Location> |
getLocationsForTown(String town,
int limitLocationsCount,
BaseStoreModel baseStore)
Method looks for nearest locations (points of interest) to the place defined by city name.
|
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
|
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() |
List<DistanceAwareLocation> |
getSortedLocationsNearby(GPS gps,
double distance,
BaseStoreModel baseStore)
Returns list of sorted
DistanceAwareLocations. |
LocationMapService |
lookupLocationMapService()
Deprecated.
|
boolean |
saveOrUpdateLocation(Location location)
Adds a new address or update existing one
|
void |
setGeoServiceWrapper(GeoWebServiceWrapper geoServiceWrapper) |
void |
setI18nService(I18NService i18nService) |
void |
setLocationMapService(LocationMapService locationMapService) |
void |
setMapService(MapService mapService) |
void |
setPointOfServiceDao(PointOfServiceDao pointOfServiceDao) |
protected void |
validateInputData(Object input,
String message)
Validation for input parameters.
|
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, setTenantScope, writeReplacepublic boolean deleteLocation(Location location) throws LocationServiceException
LocationServicedeleteLocation in interface LocationServiceLocationServiceExceptionpublic List<Location> getLocationsNearby(GPS gps, double distance) throws LocationServiceException
LocationServicegetLocationsNearby in interface LocationServicedistance - in kilometersLocationServiceExceptionpublic List<Location> getLocationsNearby(GPS gps, double distance, BaseStoreModel baseStore) throws LocationServiceException
LocationServicegetLocationsNearby in interface LocationServicedistance - in kilometersLocationServiceExceptionpublic List<DistanceAwareLocation> getSortedLocationsNearby(GPS gps, double distance, BaseStoreModel baseStore) throws LocationServiceException
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 BaseStoreModelLocationServiceExceptionprotected double calculateDistance(GPS referenceGps, PointOfServiceModel posModel) throws GeoLocatorException, LocationServiceException
public boolean saveOrUpdateLocation(Location location) throws LocationServiceException
LocationServicesaveOrUpdateLocation in interface LocationServiceLocationServiceExceptionpublic Location getLocationByName(String name) throws LocationServiceException
LocationServicegetLocationByName in interface LocationServiceLocation matched by unique nameLocationServiceExceptionpublic void setPointOfServiceDao(PointOfServiceDao pointOfServiceDao)
pointOfServiceDao - the pointOfServiceDao to setpublic void setI18nService(I18NService i18nService)
i18nService - the i18nService to setpublic Location getLocation(String streetName, String streetNumber, String postalCode, String town, String countryCode, boolean geocode) throws LocationServiceException
LocationServicegetLocation in interface LocationServicegeocode - - set to true if return Location should have GPS data populatedLocationLocationServiceExceptionpublic void setGeoServiceWrapper(GeoWebServiceWrapper geoServiceWrapper)
geoServiceWrapper - the geoServiceWrapper to setpublic List<Location> getLocationsForPostcode(String postalCode, String countryCode, int limitLocationsCount, BaseStoreModel baseStore) throws LocationServiceException
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 BaseStoreModelLocationServiceExceptionpublic List<Location> getLocationsForTown(String town, int limitLocationsCount, BaseStoreModel baseStore) throws LocationServiceException
LocationServicegetLocationsForTown in interface LocationServicetown - searching condition for locationslimitLocationsCount - number of locations to returnbaseStore - if set, method will return locations bound to the given BaseStoreModelLocationServiceExceptionpublic List<Location> getLocationsForSearch(String searchTerm, String countryCode, int limitLocationsCount, BaseStoreModel baseStore) throws LocationMapServiceException
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 BaseStoreModelLocationMapServiceExceptionpublic List<Location> getLocationsForPoint(GPS gps, int limitLocationsCount, BaseStoreModel baseStore) throws LocationServiceException
LocationServicegetLocationsForPoint in interface LocationServicegps - coordinates of center pointlimitLocationsCount - number of POIs chosen by userbaseStore - if set, method will return locations bound to the given BaseStoreModelLocationServiceExceptionprotected void validateInputData(Object input, String message)
input - parameter to validatemessage - message to be thrownprotected MapService getMapService()
public void setMapService(MapService mapService)
@Deprecated public LocationMapService lookupLocationMapService()
public LocationMapService getLocationMapService()
public void setLocationMapService(LocationMapService locationMapService)
Copyright © 2017 SAP SE. All Rights Reserved.