Class SportEventStatusCacheImpl

java.lang.Object
com.sportradar.unifiedodds.sdk.internal.caching.impl.SportEventStatusCacheImpl
All Implemented Interfaces:
DataRouterListener, SportEventStatusCache

public class SportEventStatusCacheImpl extends Object implements SportEventStatusCache, DataRouterListener
Cache storing sport event statuses
  • Constructor Details

    • SportEventStatusCacheImpl

      public SportEventStatusCacheImpl(com.google.common.cache.Cache<String,SportEventStatusCi> sportEventStatusCache, SportEventCache sportEventCache, com.google.common.cache.Cache<String,Date> ignoreEventsTimelineCache)
      Initializes a new SportEventStatusCacheImpl instance
      Parameters:
      sportEventStatusCache - - the Cache instance used to store sport event statuses
      sportEventCache - - the SportEventCache instance used to fetch sport event statuses if they are not yet cached
      ignoreEventsTimelineCache - - the Cache instance used to store event ids for which timeline SES should be ignored
  • Method Details

    • getSportEventStatusCi

      public SportEventStatusCi getSportEventStatusCi(Urn eventId, boolean makeApiCall)
      Returns the status of the event associated with the provided identifier. If the instance associated with the specified event is not found, a SportEventStatusCi instance indicating a 'not started' event is returned.
      Specified by:
      getSportEventStatusCi in interface SportEventStatusCache
      Parameters:
      eventId - the event identifier
      makeApiCall - should the API call be made if necessary
      Returns:
      a SportEventStatusCi instance describing the last known event status
    • onSportEventStatusFetched

      public void onSportEventStatusFetched(Urn id, SportEventStatusDto data, String statusOnEvent, String source)
      Adds a new sportEventStatusCache entry
      Specified by:
      onSportEventStatusFetched in interface DataRouterListener
      Parameters:
      id - - the unique identifier of the sport event to which the status belongs to
      data - - a SportEventStatusDto to store in the cache
      statusOnEvent - - a status obtained directly on the sport event
      source - - a source of the data
    • purgeSportEventStatus

      public void purgeSportEventStatus(Urn id)
      Purges the sport event status associated with the provided event id
      Specified by:
      purgeSportEventStatus in interface SportEventStatusCache
      Parameters:
      id - the id of the event that you want to purge the sport event status
    • addEventIdForTimelineIgnore

      public void addEventIdForTimelineIgnore(Urn eventId, int producerId, String messageType)
      Adds the event identifier for timeline ignore Used for BetPal events to have ignored timeline event status cache
      Specified by:
      addEventIdForTimelineIgnore in interface SportEventStatusCache
      Parameters:
      eventId - the event identifier
      producerId - the producer identifier
      messageType - type of the feed message