Interface SportEventCache

All Known Implementing Classes:
SportEventCacheImpl

public interface SportEventCache
Created on 20/10/2017. // TODO @eti: Javadoc
  • Method Details

    • getEventCacheItem

      SportEventCi getEventCacheItem(Urn id) throws CacheItemNotFoundException
      Returns a SportEventCi instance representing a cached sport event data
      Parameters:
      id - an Urn specifying the id of the sport event
      Returns:
      a SportEventCi instance representing cached sport event data
      Throws:
      CacheItemNotFoundException
    • getEventCacheItem

      SportEventCi getEventCacheItem(Urn id, RequestOptions requestOptions) throws CacheItemNotFoundException
      Returns a SportEventCi instance representing a cached sport event data
      Parameters:
      id - an Urn specifying the id of the sport event
      requestOptions - a RequestOptions object with the configuration of request issued to DataRouterManager
      Returns:
      a SportEventCi instance representing cached sport event data
      Throws:
      CacheItemNotFoundException
    • getEventIds

      List<Urn> getEventIds(Urn tournamentId, Locale locale) throws IllegalCacheStateException
      Returns a List containing id's of sport events, which belong to a specific tournament
      Parameters:
      tournamentId - an Urn specifying the id of the tournament to which the events should relate
      locale - the locale to fetch the data
      Returns:
      a List containing id's of sport events, which belong to the specified tournament
      Throws:
      IllegalCacheStateException
    • getEventIds

      List<Urn> getEventIds(Date date, Locale locale) throws IllegalCacheStateException
      Returns a List containing id's of sport events, which are scheduled for a specific date - if provided; otherwise a List of currently live events is returned
      Parameters:
      date - an optional Date for which the data is provided
      locale - the locale to fetch the data
      Returns:
      a List of events that are happening on the specified Date; or a List of currently live events
      Throws:
      IllegalCacheStateException
    • purgeCacheItem

      void purgeCacheItem(Urn id)
      Purges an item from the SportEventCache
      Parameters:
      id - The Urn specifying the event which should be purged
    • onEventBooked

      void onEventBooked(Urn id)
      Method that gets triggered when the associated event gets booked through the BookingManager
      Parameters:
      id - the Urn of the event that was successfully booked
    • addFixtureTimestamp

      void addFixtureTimestamp(Urn id)
      Adds fixture timestamp to cache so that the next fixture calls for the event goes through non-cached fixture provider
      Parameters:
      id - the Urn of the event
    • deleteSportEventsFromCache

      Integer deleteSportEventsFromCache(Date before)
      Deletes the sport events from cache which are scheduled before specified date
      Parameters:
      before - the scheduled Date used to delete sport events from cache
      Returns:
      number of deleted items