Package de.hybris.platform.storelocator
Class GeocodingJob
- java.lang.Object
-
- de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable<CronJobModel>
-
- de.hybris.platform.storelocator.GeocodingJob
-
- All Implemented Interfaces:
JobPerformable<CronJobModel>
public class GeocodingJob extends AbstractJobPerformable<CronJobModel>
Job that takes a batch of POS entries that need geocoding and performs it using geoServiceWrapper
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
flexibleSearchService, modelService, sessionService
-
-
Constructor Summary
Constructors Constructor Description GeocodingJob()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringbuildErrorMessage(PointOfServiceModel pos, DistanceUnawareLocation location, GeoServiceWrapperException geoServiceWrapperException)protected GeoWebServiceWrappergetGeoServiceWrapper()protected PointOfServiceDaogetPointOfServiceDao()booleanisAbortable()Checks whether the execution is implemented abortable.PerformResultperform(CronJobModel cronJob)The execution body for aServicelayerJob.protected booleanprocessInternalDelay(GeocodeAddressesCronJobModel cronJob)wait for the defined internal delayvoidsetGeoServiceWrapper(GeoWebServiceWrapper geoServiceWrapper)voidsetPointOfServiceDao(PointOfServiceDao pointOfServiceDao)protected voidstoreDistanceUnawareLocation(PointOfServiceModel pos)calculates and stores the GPS information for the given point of serviceprotected java.util.Optional<GeocodeAddressesCronJobModel>validateCronJob(CronJobModel cronJob)-
Methods inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
clearAbortRequestedIfNeeded, isPerformable, setFlexibleSearchService, setModelService, setSessionService
-
-
-
-
Method Detail
-
perform
public PerformResult perform(CronJobModel cronJob)
Description copied from interface:JobPerformableThe execution body for aServicelayerJob. Implement here your execution logic. It can be called synchronous or asynchronous. So be aware of thread-safety. Method will return a result object saying if the execution has reached end and if it was successful.- Specified by:
performin interfaceJobPerformable<CronJobModel>- Specified by:
performin classAbstractJobPerformable<CronJobModel>- Parameters:
cronJob- the related CronJob in whose context the execution will be performed.- Returns:
- a
PerformResultthat indicates whether theexecutionwas successfully executed or not and has finished or not.
-
processInternalDelay
protected boolean processInternalDelay(GeocodeAddressesCronJobModel cronJob)
wait for the defined internal delay
-
storeDistanceUnawareLocation
protected void storeDistanceUnawareLocation(PointOfServiceModel pos)
calculates and stores the GPS information for the given point of service
-
validateCronJob
protected java.util.Optional<GeocodeAddressesCronJobModel> validateCronJob(CronJobModel cronJob)
-
buildErrorMessage
protected java.lang.String buildErrorMessage(PointOfServiceModel pos, DistanceUnawareLocation location, GeoServiceWrapperException geoServiceWrapperException)
-
isAbortable
public boolean isAbortable()
Description copied from interface:JobPerformableChecks whether the execution is implemented abortable.- Specified by:
isAbortablein interfaceJobPerformable<CronJobModel>- Overrides:
isAbortablein classAbstractJobPerformable<CronJobModel>- Returns:
- true if the execution can be aborted
-
getPointOfServiceDao
protected PointOfServiceDao getPointOfServiceDao()
-
setPointOfServiceDao
public void setPointOfServiceDao(PointOfServiceDao pointOfServiceDao)
- Parameters:
pointOfServiceDao- the pointOfServiceDao to set
-
getGeoServiceWrapper
protected GeoWebServiceWrapper getGeoServiceWrapper()
-
setGeoServiceWrapper
public void setGeoServiceWrapper(GeoWebServiceWrapper geoServiceWrapper)
- Parameters:
geoServiceWrapper- the geoServiceWrapper to set
-
-