Package org.localify.data.dispatch
Class PollstarDispatch
java.lang.Object
org.localify.data.dispatch.PollstarDispatch
A service for dispatching Pollstar scraping requests.
-
Constructor Summary
ConstructorsConstructorDescriptionPollstarDispatch(RabbitSender rabbitSender, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ArtistRepository artistRepository, jakarta.persistence.EntityManager entityManager, EventRepository eventRepository, CityRepository cityRepository) Constructs a new PollstarDispatch. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatchArtistsPollstar(List<Artist> artists, int priority) Generic artist dispatch method from Pollstar.voiddispatchCitiesPollstar(List<City> cities, int priority) Generic city dispatch method from Pollstar.voiddispatchEventPollstar(List<Event> events) Dispatches a list of events to be scraped from Pollstar.voiddispatchEvents(List<String> eventIds) Dispatches a list of event IDs to be scraped from Pollstar.voiddispatchEvents(List<String> eventIds, Artist artist) Dispatches a list of event IDs to be scraped from Pollstar.voidqueueArtistsNotFound(Instant time, int limit) Queues artists that were not found in Pollstar before a certain time.voidqueueArtistsUnknown(int limit) Queues artists that are unknown to Pollstar.voidqueueArtistsUpdatedBefore(Instant time, int limit) Queues artists that were updated before a certain time.voidqueueCitiesNotFound(Instant time, int limit) Queues cities that were not found in Pollstar before a certain time.voidqueueCitiesUnknown(int limit) Queues cities that are unknown to Pollstar.voidqueueCitiesUpdatedBefore(Instant time, int limit) Queues cities that were updated before a certain time.voidqueueEventsUpdatedBefore(Instant time, int limit) Queues events that were updated before a certain time.
-
Constructor Details
-
PollstarDispatch
public PollstarDispatch(RabbitSender rabbitSender, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ArtistRepository artistRepository, jakarta.persistence.EntityManager entityManager, EventRepository eventRepository, CityRepository cityRepository) Constructs a new PollstarDispatch.- Parameters:
rabbitSender- The RabbitMQ sender.objectMapper- The object mapper.artistRepository- The artist repository.entityManager- The entity manager.eventRepository- The event repository.cityRepository- The city repository.
-
-
Method Details
-
dispatchArtistsPollstar
Generic artist dispatch method from Pollstar.- Parameters:
artists- The list of artists to dispatch.priority- The priority of the message.
-
dispatchCitiesPollstar
Generic city dispatch method from Pollstar.- Parameters:
cities- The list of cities to dispatch.priority- The priority of the message.
-
queueArtistsUpdatedBefore
@Transactional(propagation=REQUIRES_NEW) public void queueArtistsUpdatedBefore(Instant time, int limit) Queues artists that were updated before a certain time.- Parameters:
time- The time to check against.limit- The maximum number of artists to queue.
-
queueEventsUpdatedBefore
Queues events that were updated before a certain time.- Parameters:
time- The time to check against.limit- The maximum number of events to queue.
-
queueArtistsUnknown
@Transactional(propagation=REQUIRES_NEW) public void queueArtistsUnknown(int limit) Queues artists that are unknown to Pollstar.- Parameters:
limit- The maximum number of artists to queue.
-
queueArtistsNotFound
Queues artists that were not found in Pollstar before a certain time.- Parameters:
time- The time to check against.limit- The maximum number of artists to queue.
-
dispatchEventPollstar
Dispatches a list of events to be scraped from Pollstar.- Parameters:
events- The list of events to dispatch.
-
dispatchEvents
Dispatches a list of event IDs to be scraped from Pollstar.- Parameters:
eventIds- The list of event IDs.artist- The artist associated with the events.
-
dispatchEvents
Dispatches a list of event IDs to be scraped from Pollstar.- Parameters:
eventIds- The list of event IDs.
-
queueCitiesUpdatedBefore
@Transactional(propagation=REQUIRES_NEW) public void queueCitiesUpdatedBefore(Instant time, int limit) Queues cities that were updated before a certain time.- Parameters:
time- The time to check against.limit- The maximum number of cities to queue.
-
queueCitiesUnknown
@Transactional(propagation=REQUIRES_NEW) public void queueCitiesUnknown(int limit) Queues cities that are unknown to Pollstar.- Parameters:
limit- The maximum number of cities to queue.
-
queueCitiesNotFound
Queues cities that were not found in Pollstar before a certain time.- Parameters:
time- The time to check against.limit- The maximum number of cities to queue.
-