Package org.localify.data.dispatch
Class BandsInTownDispatch
java.lang.Object
org.localify.data.dispatch.BandsInTownDispatch
A service for dispatching BandsInTown scraping requests.
-
Constructor Summary
ConstructorsConstructorDescriptionBandsInTownDispatch(RabbitSender rabbitSender, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ArtistRepository artistRepository, jakarta.persistence.EntityManager entityManager, EventRepository eventRepository) Constructs a new BandsInTownDispatch. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatchArtistsBit(List<Artist> artists, int priority) Generic artist dispatch method from BandsInTown.voiddispatchEventBit(List<Event> events) Dispatches a list of events to be scraped from BandsInTown.voiddispatchEvents(List<String> eventIds) Dispatches a list of event IDs to be scraped from BandsInTown.voiddispatchEvents(List<String> eventIds, Artist artist) Dispatches a list of event IDs to be scraped from BandsInTown.voidqueueArtistsNotFound(Instant time, int limit) Queues artists that were not found in BandsInTown before a certain time.voidqueueArtistsUnknown(int limit) Queues artists that are unknown to BandsInTown.voidqueueArtistsUpdatedBefore(Instant time, int limit) Queues artists that were updated before a certain time.voidqueueEventsUpdatedBefore(Instant time, int limit) Queues events that were updated before a certain time.
-
Constructor Details
-
BandsInTownDispatch
public BandsInTownDispatch(RabbitSender rabbitSender, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ArtistRepository artistRepository, jakarta.persistence.EntityManager entityManager, EventRepository eventRepository) Constructs a new BandsInTownDispatch.- Parameters:
rabbitSender- The RabbitMQ sender.objectMapper- The object mapper.artistRepository- The artist repository.entityManager- The entity manager.eventRepository- The event repository.
-
-
Method Details
-
dispatchArtistsBit
Generic artist dispatch method from BandsInTown.- Parameters:
artists- The list of artists 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 BandsInTown.- Parameters:
limit- The maximum number of artists to queue.
-
queueArtistsNotFound
Queues artists that were not found in BandsInTown before a certain time.- Parameters:
time- The time to check against.limit- The maximum number of artists to queue.
-
dispatchEventBit
Dispatches a list of events to be scraped from BandsInTown.- Parameters:
events- The list of events to dispatch.
-
dispatchEvents
Dispatches a list of event IDs to be scraped from BandsInTown.- 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 BandsInTown.- Parameters:
eventIds- The list of event IDs.
-