Class BandsInTownDispatch

java.lang.Object
org.localify.data.dispatch.BandsInTownDispatch

@Component public class BandsInTownDispatch extends Object
A service for dispatching BandsInTown scraping requests.
  • 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

      @Transactional public void dispatchArtistsBit(List<Artist> artists, int priority)
      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

      @Transactional public void queueEventsUpdatedBefore(Instant time, int limit)
      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

      @Transactional(propagation=REQUIRES_NEW) public void queueArtistsNotFound(Instant time, int limit)
      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

      @Transactional public void dispatchEventBit(List<Event> events)
      Dispatches a list of events to be scraped from BandsInTown.
      Parameters:
      events - The list of events to dispatch.
    • dispatchEvents

      public void dispatchEvents(List<String> eventIds, Artist artist)
      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

      public void dispatchEvents(List<String> eventIds)
      Dispatches a list of event IDs to be scraped from BandsInTown.
      Parameters:
      eventIds - The list of event IDs.