Package org.localify.common
Class StartupTasks
java.lang.Object
org.localify.common.StartupTasks
- All Implemented Interfaces:
org.springframework.boot.CommandLineRunner
@Component
public class StartupTasks
extends Object
implements org.springframework.boot.CommandLineRunner
A component for running various startup and scheduled tasks.
-
Constructor Summary
ConstructorsConstructorDescriptionStartupTasks(BandsInTownDispatch bandsInTownDispatch, GoogleDispatch googleDispatch, PollstarDispatch pollstarDispatch, SpotifyDispatch spotifyDispatch, SpotifyApiDispatch spotifyApiDispatch, LocalifyProperties properties, CityRepository cityRepository, PlaylistService playlistService, VenueRepository venueRepository, UserCityRepository userCityRepository, RecommendService recommender, VenueService venueService, CityService cityService, org.springframework.mail.javamail.JavaMailSender mailSender, UserRepository userRepository, ArtistRepository artistRepository, SongRepository songRepository, FileIngest fileIngest, ScraperIngest scraperIngest, SpotifyService spotifyService, ArtistCityRepository artistCityRepository, WeeklyEmailRegistrationTokenRepository weeklyEmailRegistrationTokenRepository) Constructs a new StartupTasks. -
Method Summary
Modifier and TypeMethodDescriptionvoidBulk dispatches all artists to be updated via the Spotify API.voidBulk dispatches tracks to have their acoustic features updated via the Spotify API.voidDispatches artists to be scraped from BandsInTown.voidDispatches unknown artists to be scraped from BandsInTown.voidDispatches cities to be scraped from Google.voidDispatches known artists to be scraped from Pollstar.voidDispatches known cities to be scraped from Pollstar.voidDispatches unknown artists to be scraped from Pollstar.voidDispatches unknown cities to be scraped from Pollstar.voidDispatches artists to be updated via the Spotify API.voidDispatches artists to be scraped from Spotify.voidSends a weekly email digest to all subscribed users.voidFinds and sets the timezone for cities that do not have one.voidvoidUpdates all Spotify playlists.
-
Constructor Details
-
StartupTasks
@Autowired public StartupTasks(BandsInTownDispatch bandsInTownDispatch, GoogleDispatch googleDispatch, PollstarDispatch pollstarDispatch, SpotifyDispatch spotifyDispatch, SpotifyApiDispatch spotifyApiDispatch, LocalifyProperties properties, CityRepository cityRepository, PlaylistService playlistService, VenueRepository venueRepository, UserCityRepository userCityRepository, RecommendService recommender, VenueService venueService, CityService cityService, org.springframework.mail.javamail.JavaMailSender mailSender, UserRepository userRepository, ArtistRepository artistRepository, SongRepository songRepository, FileIngest fileIngest, ScraperIngest scraperIngest, SpotifyService spotifyService, ArtistCityRepository artistCityRepository, WeeklyEmailRegistrationTokenRepository weeklyEmailRegistrationTokenRepository) Constructs a new StartupTasks.- Parameters:
bandsInTownDispatch- The BandsInTown dispatch service.googleDispatch- The Google dispatch service.pollstarDispatch- The Pollstar dispatch service.spotifyDispatch- The Spotify dispatch service.spotifyApiDispatch- The Spotify API dispatch service.properties- The application properties.cityRepository- The city repository.playlistService- The playlist service.venueRepository- The venue repository.userCityRepository- The user-city repository.recommender- The recommendation service.venueService- The venue service.cityService- The city service.mailSender- The mail sender.userRepository- The user repository.artistRepository- The artist repository.songRepository- The song repository.fileIngest- The file ingest service.scraperIngest- The scraper ingest service.spotifyService- The Spotify service.artistCityRepository- The artist-city repository.weeklyEmailRegistrationTokenRepository- The weekly email registration token repository.
-
-
Method Details
-
run
- Specified by:
runin interfaceorg.springframework.boot.CommandLineRunner- Throws:
Exception
-
dispatchBitArtists
Dispatches artists to be scraped from BandsInTown. 3 Cases for BIT by Artist: 1. Artist has never been queued before - Queue immediately 2. Artist has been queued but never found - Queue every 90 days 3. Artist has been found - Queue every week -
dispatchBitUnknownArtists
Dispatches unknown artists to be scraped from BandsInTown. -
dispatchPollstarUnknownCities
Dispatches unknown cities to be scraped from Pollstar. 3 Cases for Pollstar by City: 1. City has never been queued before - Queue immediately 2. City has been queued but never found - Queue every 90 days 3. City has been found - Queue every week -
dispatchPollstarCities
Dispatches known cities to be scraped from Pollstar. -
dispatchPollstarArtists
Dispatches known artists to be scraped from Pollstar. 3 Cases for Pollstar by Artist: 1. Artist has never been queued before - Queue immediately 2. Artist has been queued but never found - Queue every 90 days 3. Artist has been found - Queue every week -
dispatchPollstarUnknownArtists
Dispatches unknown artists to be scraped from Pollstar. -
dispatchGoogleCities
Dispatches cities to be scraped from Google. -
dispatchSpotifyArtists
Dispatches artists to be scraped from Spotify. -
dispatchSpotifyApi
Dispatches artists to be updated via the Spotify API. -
bulkDispatchSpotifyApi
Bulk dispatches all artists to be updated via the Spotify API. -
bulkDispatchTrackAcousticsSpotifyApi
Bulk dispatches tracks to have their acoustic features updated via the Spotify API. -
updateSpotifyPlaylists
@Scheduled(cron="0 0 5 * * WED") public void updateSpotifyPlaylists()Updates all Spotify playlists. -
emailDigest
@Scheduled(cron="0 0 11 * * WED") public void emailDigest()Sends a weekly email digest to all subscribed users. -
geocodeTimeZones
Finds and sets the timezone for cities that do not have one.
-