Class PollstarDispatch

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

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

      @Transactional public void dispatchArtistsPollstar(List<Artist> artists, int priority)
      Generic artist dispatch method from Pollstar.
      Parameters:
      artists - The list of artists to dispatch.
      priority - The priority of the message.
    • dispatchCitiesPollstar

      @Transactional public void dispatchCitiesPollstar(List<City> cities, int priority)
      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

      @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 Pollstar.
      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 Pollstar before a certain time.
      Parameters:
      time - The time to check against.
      limit - The maximum number of artists to queue.
    • dispatchEventPollstar

      @Transactional public void dispatchEventPollstar(List<Event> events)
      Dispatches a list of events to be scraped from Pollstar.
      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 Pollstar.
      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 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

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