Class SportDataProviderImpl

java.lang.Object
com.sportradar.unifiedodds.sdk.internal.impl.SportDataProviderImpl
All Implemented Interfaces:
SportDataProvider

public class SportDataProviderImpl extends Object implements SportDataProvider
Provides access to sport related data (sports, tournaments, sport events, ...)
  • Method Details

    • getSports

      public List<Sport> getSports()
      Returns all the available sports (the returned data is translated in the configured Locales using the UofConfigurationImpl)
      Specified by:
      getSports in interface SportDataProvider
      Returns:
      - all the available sports
    • getSports

      public List<Sport> getSports(Locale locale)
      Returns all the available sports (the returned data is translated in the specified Locale)
      Specified by:
      getSports in interface SportDataProvider
      Parameters:
      locale - - the Locale in which to provide the data
      Returns:
      - all the available sports translated in the specified locale
    • getActiveTournaments

      public List<SportEvent> getActiveTournaments()
      Returns all the active tournaments (the returned data is translated in the default locale configured with the UofConfigurationImpl) (possible types: BasicTournament, Tournament, Stage)
      Specified by:
      getActiveTournaments in interface SportDataProvider
      Returns:
      - all the active tournaments
    • getActiveTournaments

      public List<SportEvent> getActiveTournaments(Locale locale)
      Returns all the active tournaments (the returned data is translated in the specified Locale) (possible types: BasicTournament, Tournament, Stage)
      Specified by:
      getActiveTournaments in interface SportDataProvider
      Parameters:
      locale - - the Locale in which to provide the data
      Returns:
      - all the active tournaments translated in the specified locale
    • getActiveTournaments

      public List<SportEvent> getActiveTournaments(String sportName)
      Returns all the active tournaments of a specific sport (the returned data is translated in the default locale configured with the UofConfigurationImpl) (possible types: BasicTournament, Tournament, Stage)
      Specified by:
      getActiveTournaments in interface SportDataProvider
      Parameters:
      sportName - - the specific sport name
      Returns:
      - all the active tournaments of a specific sport
    • getActiveTournaments

      public List<SportEvent> getActiveTournaments(String sportName, Locale locale)
      Returns all the active tournaments of a specific sport (the returned data is translated in the specified Locale) (possible types: BasicTournament, Tournament, Stage)
      Specified by:
      getActiveTournaments in interface SportDataProvider
      Parameters:
      sportName - - the specific sport name
      locale - - the Locale in which to provide the data
      Returns:
      - all the active tournaments of a specific sport translated in the specified locale
    • getCompetitionsFor

      public List<Competition> getCompetitionsFor(Date date)
      Returns a list of all competitions scheduled on the specified date (the returned data is translated in the configured Locales using the UofConfigurationImpl)
      Specified by:
      getCompetitionsFor in interface SportDataProvider
      Parameters:
      date - - the date for which to list all active competitions
      Returns:
      - a list of all competitions scheduled on the specified date
    • getCompetitionsFor

      public List<Competition> getCompetitionsFor(Date date, Locale locale)
      Returns a list of all competitions scheduled on the specified date (the returned data is translated in the specified Locale)
      Specified by:
      getCompetitionsFor in interface SportDataProvider
      Parameters:
      date - - the date for which to list all active competitions
      locale - - the Locale in which to provide the data
      Returns:
      - a list of all competitions scheduled on the specified date (the data is translated in the provided locale)
    • getLiveCompetitions

      public List<Competition> getLiveCompetitions()
      Returns all the competitions that are currently live (the returned data is translated in the configured Locales using the UofConfigurationImpl)
      Specified by:
      getLiveCompetitions in interface SportDataProvider
      Returns:
      - all the competitions that are currently live
    • getLiveCompetitions

      public List<Competition> getLiveCompetitions(Locale locale)
      Returns all the competitions that are currently live (the returned data is translated in the specified Locale)
      Specified by:
      getLiveCompetitions in interface SportDataProvider
      Parameters:
      locale - - the Locale in which to provide the data
      Returns:
      - all the competitions that are currently live (the data is translated in the provided locale)
    • getSportEvent

      public SportEvent getSportEvent(Urn id)
      Returns the specified sport event (the returned data is translated in the configured Locales using the UofConfigurationImpl)
      Specified by:
      getSportEvent in interface SportDataProvider
      Parameters:
      id - - an Urn identifier specifying the sport event
      Returns:
      - the specified sport event
    • getSportEventForEventChange

      public SportEvent getSportEventForEventChange(Urn id)
    • getSportEvent

      public SportEvent getSportEvent(Urn id, Locale locale)
      Returns the specified sport event (the returned data is translated in the specified Locale)
      Specified by:
      getSportEvent in interface SportDataProvider
      Parameters:
      id - - an Urn identifier specifying the requested long term event
      locale - - the Locale in which to provide the data
      Returns:
      - the specified sport event translated in the provided locale
    • getLongTermEvent

      public LongTermEvent getLongTermEvent(Urn id)
      Returns the specified long term event (the returned data is translated in the configured Locales using the UofConfigurationImpl)
      Specified by:
      getLongTermEvent in interface SportDataProvider
      Parameters:
      id - - an Urn identifier specifying the requested long term event
      Returns:
      - the specified long term event
    • getLongTermEvent

      public LongTermEvent getLongTermEvent(Urn id, Locale locale)
      Returns the specified long term event (the returned data is translated in the specified Locale)
      Specified by:
      getLongTermEvent in interface SportDataProvider
      Parameters:
      id - - an Urn identifier specifying the requested long term event
      locale - - the Locale in which to provide the data
      Returns:
      - the specified tournament translated in the provided locale
    • getCompetition

      public Competition getCompetition(Urn id)
      Returns a Competition representing the specified competition (the returned data is translated in the configured Locales using the UofConfigurationImpl)
      Specified by:
      getCompetition in interface SportDataProvider
      Parameters:
      id - - an Urn identifier specifying the competition requested
      Returns:
      - a Competition representing the specified competition
    • getCompetition

      public Competition getCompetition(Urn id, Locale locale)
      Returns a Competition representing the specified competition (the returned data is translated in the specified Locale)
      Specified by:
      getCompetition in interface SportDataProvider
      Parameters:
      id - - an Urn identifier specifying the competition requested
      locale - - the Locale in which to provide the data
      Returns:
      - a Competition representing the specified competition translated in the provided locale
    • getCompetitor

      public Competitor getCompetitor(Urn id)
      Returns a Competitor representing the specified competitor (the returned data is translated in the configured Locales using the UofConfigurationImpl)
      Specified by:
      getCompetitor in interface SportDataProvider
      Parameters:
      id - - a unique competitor Urn identifier
      Returns:
      - a Competitor representing the competitor associated with the provided Urn
    • getCompetitor

      public Competitor getCompetitor(Urn id, Locale locale)
      Returns a Competitor representing the specified competitor (the returned data is translated in the specified Locale)
      Specified by:
      getCompetitor in interface SportDataProvider
      Parameters:
      id - - a unique competitor Urn identifier
      locale - - the Locale in which to provide the data
      Returns:
      - a Competitor representing the competitor associated with the provided Urn
    • getPlayerProfile

      public PlayerProfile getPlayerProfile(Urn id)
      Returns a PlayerProfile representing the specified competitor (the returned data is translated in the configured Locales using the UofConfigurationImpl)
      Specified by:
      getPlayerProfile in interface SportDataProvider
      Parameters:
      id - - a unique player Urn identifier
      Returns:
      - a PlayerProfile representing the specified competitor
    • getPlayerProfile

      public PlayerProfile getPlayerProfile(Urn id, Locale locale)
      Returns a PlayerProfile representing the specified competitor (the returned data is translated in the specified Locale)
      Specified by:
      getPlayerProfile in interface SportDataProvider
      Parameters:
      id - - a unique player Urn identifier
      locale - - the Locale in which to provide the data
      Returns:
      - a PlayerProfile representing the specified competitor
    • purgeSportEventCacheData

      public void purgeSportEventCacheData(Urn eventId)
      Purges the associated sport event cache item
      Specified by:
      purgeSportEventCacheData in interface SportDataProvider
      Parameters:
      eventId - the identifier of the cache item to purge
    • purgeSportEventCacheData

      public void purgeSportEventCacheData(Urn eventId, boolean includeStatusPurge)
      Purges the associated sport event cache item
      Specified by:
      purgeSportEventCacheData in interface SportDataProvider
      Parameters:
      eventId - the identifier of the cache item to purge
      includeStatusPurge - an indication if the associated sport event status should be purged too
    • purgeCompetitorProfileCacheData

      public void purgeCompetitorProfileCacheData(Urn competitorId)
      Purges the associated competitor cache item
      Specified by:
      purgeCompetitorProfileCacheData in interface SportDataProvider
      Parameters:
      competitorId - the identifier of the cache item to purge
    • purgePlayerProfileCacheData

      public void purgePlayerProfileCacheData(Urn playerId)
      Purges the associated player profile cache item
      Specified by:
      purgePlayerProfileCacheData in interface SportDataProvider
      Parameters:
      playerId - the identifier of the cache item to purge
    • getFixtureChanges

      public List<FixtureChange> getFixtureChanges()
      Returns the list of all fixtures that have changed in the last 24 hours
      Specified by:
      getFixtureChanges in interface SportDataProvider
      Returns:
      list of FixtureChange
    • getFixtureChanges

      public List<FixtureChange> getFixtureChanges(Locale locale)
      Returns the list of all fixtures that have changed in the last 24 hours
      Specified by:
      getFixtureChanges in interface SportDataProvider
      Parameters:
      locale - - the Locale in which to provide the data
      Returns:
      list of FixtureChange
    • getFixtureChanges

      public List<FixtureChange> getFixtureChanges(Date after, Urn sportId)
      Returns the list of all fixtures that have changed in the last 24 hours
      Specified by:
      getFixtureChanges in interface SportDataProvider
      Parameters:
      after - specifies the starting date and time for filtering
      sportId - specifies the sport for which the fixtures should be returned
      Returns:
      list of FixtureChange
    • getFixtureChanges

      public List<FixtureChange> getFixtureChanges(Date after, Urn sportId, Locale locale)
      Returns the list of all fixtures that have changed in the last 24 hours
      Specified by:
      getFixtureChanges in interface SportDataProvider
      Parameters:
      after - specifies the starting date and time for filtering
      sportId - specifies the sport for which the fixtures should be returned
      locale - - the Locale in which to provide the data
      Returns:
      list of FixtureChange
    • getResultChanges

      public List<ResultChange> getResultChanges()
      Returns the list of all fixtures that have changed in the last 24 hours
      Specified by:
      getResultChanges in interface SportDataProvider
      Returns:
      list of ResultChange
    • getResultChanges

      public List<ResultChange> getResultChanges(Locale locale)
      Returns the list of all fixtures that have changed in the last 24 hours
      Specified by:
      getResultChanges in interface SportDataProvider
      Parameters:
      locale - - the Locale in which to provide the data
      Returns:
      list of ResultChange
    • getResultChanges

      public List<ResultChange> getResultChanges(Date after, Urn sportId)
      Returns the list of all fixtures that have changed in the last 24 hours
      Specified by:
      getResultChanges in interface SportDataProvider
      Parameters:
      after - specifies the starting date and time for filtering
      sportId - specifies the sport for which the fixtures should be returned
      Returns:
      list of ResultChange
    • getResultChanges

      public List<ResultChange> getResultChanges(Date after, Urn sportId, Locale locale)
      Returns the list of all fixtures that have changed in the last 24 hours
      Specified by:
      getResultChanges in interface SportDataProvider
      Parameters:
      after - specifies the starting date and time for filtering
      sportId - specifies the sport for which the fixtures should be returned
      locale - - the Locale in which to provide the data
      Returns:
      list of ResultChange
    • getListOfSportEvents

      public List<Competition> getListOfSportEvents(int startIndex, int limit)
      Lists almost all events we are offering prematch odds for. This endpoint can be used during early startup to obtain almost all fixtures. This endpoint is one of the few that uses pagination.
      Specified by:
      getListOfSportEvents in interface SportDataProvider
      Parameters:
      startIndex - starting index (zero based)
      limit - how many records to return (max: 1000)
      Returns:
      a list of sport events
    • getListOfSportEvents

      public List<Competition> getListOfSportEvents(int startIndex, int limit, Locale locale)
      Lists almost all events we are offering prematch odds for. This endpoint can be used during early startup to obtain almost all fixtures. This endpoint is one of the few that uses pagination.
      Specified by:
      getListOfSportEvents in interface SportDataProvider
      Parameters:
      startIndex - starting index (zero based)
      limit - how many records to return (max: 1000)
      locale - the Locale in which to provide the data
      Returns:
      a list of sport events
    • getAvailableTournaments

      public List<SportEvent> getAvailableTournaments(Urn sportId)
      Returns all the available tournaments of a specific sport (the returned data is translated in the default locale configured with the UofConfigurationImpl) (possible types: BasicTournament, Tournament, Stage)
      Specified by:
      getAvailableTournaments in interface SportDataProvider
      Parameters:
      sportId - - the specific sport id
      Returns:
      - all the available tournaments of a specific sport
    • getAvailableTournaments

      public List<SportEvent> getAvailableTournaments(Urn sportId, Locale locale)
      Returns all the available tournaments for a specific sport (the returned data is translated in the specified Locale) (possible types: BasicTournament, Tournament, Stage)
      Specified by:
      getAvailableTournaments in interface SportDataProvider
      Parameters:
      sportId - - the specific sport id
      locale - - the Locale in which to provide the data
      Returns:
      - all the available tournaments for a specific sport translated in the specified locale
    • deleteSportEventsFromCache

      public Integer deleteSportEventsFromCache(Date before)
      Deletes the sport events from cache which are scheduled before specified date
      Specified by:
      deleteSportEventsFromCache in interface SportDataProvider
      Parameters:
      before - the scheduled Date used to delete sport events from cache
      Returns:
      number of deleted items
    • cacheExport

      public List<ExportableCi> cacheExport(EnumSet<CacheType> cacheType)
      Exports current items in the cache
      Specified by:
      cacheExport in interface SportDataProvider
      Parameters:
      cacheType - specifies what type of cache items will be exported
      Returns:
      List of ExportableCi containing all the items currently in the cache
    • cacheImport

      public void cacheImport(List<ExportableCi> items)
      Imports provided items into caches
      Specified by:
      cacheImport in interface SportDataProvider
      Parameters:
      items - List of ExportableCi containing the items to be imported
    • getLotteries

      public List<Lottery> getLotteries(Locale locale)
      Returns all the available lotteries (the returned data is translated in the specified Locale)
      Specified by:
      getLotteries in interface SportDataProvider
      Parameters:
      locale - - the Locale in which to provide the data
      Returns:
      - all available lotteries in specified locale
    • getPeriodStatuses

      public List<PeriodStatus> getPeriodStatuses(Urn id, Locale locale, List<Urn> competitorIds, List<Integer> periods)
      Returns the list of PeriodStatus from the sport event period summary endpoint
      Specified by:
      getPeriodStatuses in interface SportDataProvider
      Parameters:
      id - the id of the sport event to be fetched
      locale - the Locale in which to provide the data (can be null)
      competitorIds - the list of competitor ids to fetch the results for (can be null)
      periods - the list of period ids to fetch the results for (can be null)
      Returns:
      the list of PeriodStatus from the sport event period summary endpoint
    • getTimelineEvents

      public List<TimelineEvent> getTimelineEvents(Urn id, Locale locale)
      Returns the list of TimelineEvent for the sport event
      Specified by:
      getTimelineEvents in interface SportDataProvider
      Parameters:
      id - the id of the sport event to be fetched
      locale - the Locale in which to provide the data (can be null)
      Returns:
      the list of TimelineEvent for the sport event