Package dev.karlkadak.backend.cron
Class WeatherDataImportScheduler
java.lang.Object
dev.karlkadak.backend.cron.WeatherDataImportScheduler
Used for scheduling the weather data importing using
Also logs the scheduling of imports using
WeatherDataImporter and
ThreadPoolTaskSchedulerAlso logs the scheduling of imports using
Logger-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringCron expression gathered from application.properties based on whichtaskSchedulerrunsWeatherDataImporter.defaultImportprivate final Loggerprivate final org.springframework.scheduling.concurrent.ThreadPoolTaskSchedulerprivate final WeatherDataImporter -
Constructor Summary
ConstructorsConstructorDescriptionWeatherDataImportScheduler(org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler taskScheduler, WeatherDataImporter weatherDataImporter, Logger logger) -
Method Summary
Modifier and TypeMethodDescriptionvoidInitially runs and schedules theWeatherDataImporter.defaultImportmethod to run using the cron expression specified in application.properties
-
Field Details
-
taskScheduler
private final org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler taskScheduler -
weatherDataImporter
-
logger
-
importerCronExpression
Cron expression gathered from application.properties based on whichtaskSchedulerrunsWeatherDataImporter.defaultImport
-
-
Constructor Details
-
WeatherDataImportScheduler
@Autowired public WeatherDataImportScheduler(org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler taskScheduler, WeatherDataImporter weatherDataImporter, Logger logger)
-
-
Method Details
-
scheduleImport
public void scheduleImport()Initially runs and schedules theWeatherDataImporter.defaultImportmethod to run using the cron expression specified in application.properties
-