Class DefaultCustomerLocationService
- java.lang.Object
-
- de.hybris.platform.acceleratorservices.customer.impl.DefaultCustomerLocationService
-
- All Implemented Interfaces:
CustomerLocationService
public class DefaultCustomerLocationService extends java.lang.Object implements CustomerLocationService
Default implementation ofCustomerLocationService
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSESSION_LOCATIONS_CACHE_KEYstatic java.lang.StringSESSION_NEAREST_STORES_KEYstatic java.lang.StringSESSION_USER_LOCATION_KEY
-
Constructor Summary
Constructors Constructor Description DefaultCustomerLocationService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecalculateDistance(GeoPoint origin, PointOfServiceModel pointOfServiceModel)Calculates distance between given origin point and given point of service data objectprotected AddressDatagenerateGeoAddressForSearchQuery(BaseStoreModel baseStore, java.lang.String locationText)protected BaseStoreServicegetBaseStoreService()protected GeoPointgetCachedGPS(java.lang.String locationName)protected GeoWebServiceWrappergetGeoWebServiceWrapper()protected GeoPointgetLocationForSearchTerm(java.lang.String searchTerm)protected SessionServicegetSessionService()UserLocationDatagetUserLocation()Returns user stored location or null if no location found for current session user.protected voidsaveGPSToCache(GeoPoint gps, java.lang.String locationName)voidsetBaseStoreService(BaseStoreService baseStoreService)voidsetGeoWebServiceWrapper(GeoWebServiceWrapper geoWebServiceWrapper)voidsetSessionService(SessionService sessionService)voidsetUserLocation(UserLocationData userLocationData)Stores the information of user location.
-
-
-
Field Detail
-
SESSION_USER_LOCATION_KEY
public static final java.lang.String SESSION_USER_LOCATION_KEY
- See Also:
- Constant Field Values
-
SESSION_LOCATIONS_CACHE_KEY
public static final java.lang.String SESSION_LOCATIONS_CACHE_KEY
- See Also:
- Constant Field Values
-
SESSION_NEAREST_STORES_KEY
public static final java.lang.String SESSION_NEAREST_STORES_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBaseStoreService
protected BaseStoreService getBaseStoreService()
-
setBaseStoreService
public void setBaseStoreService(BaseStoreService baseStoreService)
-
getGeoWebServiceWrapper
protected GeoWebServiceWrapper getGeoWebServiceWrapper()
-
setGeoWebServiceWrapper
public void setGeoWebServiceWrapper(GeoWebServiceWrapper geoWebServiceWrapper)
-
getSessionService
protected SessionService getSessionService()
-
setSessionService
public void setSessionService(SessionService sessionService)
-
getUserLocation
public UserLocationData getUserLocation()
Description copied from interface:CustomerLocationServiceReturns user stored location or null if no location found for current session user.- Specified by:
getUserLocationin interfaceCustomerLocationService- Returns:
- stored location
-
setUserLocation
public void setUserLocation(UserLocationData userLocationData)
Description copied from interface:CustomerLocationServiceStores the information of user location. If search term is given, but gps is null it tries to determine GPS coordinates for the given search term.- Specified by:
setUserLocationin interfaceCustomerLocationService
-
calculateDistance
public double calculateDistance(GeoPoint origin, PointOfServiceModel pointOfServiceModel)
Description copied from interface:CustomerLocationServiceCalculates distance between given origin point and given point of service data object- Specified by:
calculateDistancein interfaceCustomerLocationService- Returns:
- distance between given points
-
getLocationForSearchTerm
protected GeoPoint getLocationForSearchTerm(java.lang.String searchTerm)
-
getCachedGPS
protected GeoPoint getCachedGPS(java.lang.String locationName)
-
saveGPSToCache
protected void saveGPSToCache(GeoPoint gps, java.lang.String locationName)
-
generateGeoAddressForSearchQuery
protected AddressData generateGeoAddressForSearchQuery(BaseStoreModel baseStore, java.lang.String locationText)
-
-