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
ThreadPoolTaskScheduler
Also logs the scheduling of imports using
Logger
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
Cron expression gathered from application.properties based on whichtaskScheduler
runsWeatherDataImporter.defaultImport
private final Logger
private final org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
private final WeatherDataImporter
-
Constructor Summary
ConstructorsConstructorDescriptionWeatherDataImportScheduler
(org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler taskScheduler, WeatherDataImporter weatherDataImporter, Logger logger) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Initially runs and schedules theWeatherDataImporter.defaultImport
method 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 whichtaskScheduler
runsWeatherDataImporter.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.defaultImport
method to run using the cron expression specified in application.properties
-