public class SportsDataCacheImpl extends Object implements SportsDataCache, DataRouterListener, ExportableSdkCache
Constructor and Description |
---|
SportsDataCacheImpl(com.google.common.cache.Cache<Urn,SportCi> sportsCache,
com.google.common.cache.Cache<Urn,CategoryCi> categoriesCache,
CacheItemFactory cacheItemFactory,
DataRouterManager dataRouterManager) |
Modifier and Type | Method and Description |
---|---|
Map<String,Long> |
cacheStatus()
Returns current cache status
|
List<ExportableCi> |
exportItems()
Exports current items in the cache
|
CategoryCi |
getCategory(Urn categoryId,
List<Locale> locales)
Returns the associated category data
|
SportData |
getSport(Urn sportId,
List<Locale> locales)
|
List<SportData> |
getSports(List<Locale> locales)
Returns a
List sports supported by the feed. |
void |
importItems(List<ExportableCi> items)
Imports provided items into the cache
|
void |
onDrawFixtureFetched(Urn id,
com.sportradar.uf.sportsapi.datamodel.SapiDrawFixture data,
Locale locale,
CacheItem requester) |
void |
onFixtureFetched(Urn id,
com.sportradar.uf.sportsapi.datamodel.SapiFixture data,
Locale dataLocale,
CacheItem requester) |
void |
onLotteryFetched(Urn id,
com.sportradar.uf.sportsapi.datamodel.SapiLottery data,
Locale locale,
CacheItem requester) |
void |
onMatchSummaryEndpointFetched(Urn id,
com.sportradar.uf.sportsapi.datamodel.SapiMatchSummaryEndpoint data,
Locale dataLocale,
CacheItem requester) |
void |
onMatchTimelineFetched(Urn id,
com.sportradar.uf.sportsapi.datamodel.SapiMatchTimelineEndpoint data,
Locale dataLocale,
CacheItem requester) |
void |
onSportCategoriesFetched(Urn sportId,
com.sportradar.uf.sportsapi.datamodel.SapiSportCategoriesEndpoint data,
Locale locale,
CacheItem requester) |
void |
onSportEventFetched(Urn id,
com.sportradar.uf.sportsapi.datamodel.SapiSportEvent data,
Locale dataLocale) |
void |
onSportFetched(Urn sportId,
com.sportradar.uf.sportsapi.datamodel.SapiSport sport,
Locale dataLocale) |
void |
onStageSummaryEndpointFetched(Urn id,
com.sportradar.uf.sportsapi.datamodel.SapiStageSummaryEndpoint data,
Locale dataLocale,
CacheItem requester) |
void |
onTournamentExtendedFetched(Urn id,
com.sportradar.uf.sportsapi.datamodel.SapiTournamentExtended data,
Locale dataLocale) |
void |
onTournamentFetched(Urn id,
com.sportradar.uf.sportsapi.datamodel.SapiTournament data,
Locale locale) |
void |
onTournamentInfoEndpointFetched(Urn requestedId,
Urn tournamentId,
Urn seasonId,
com.sportradar.uf.sportsapi.datamodel.SapiTournamentInfoEndpoint data,
Locale dataLocale,
CacheItem requester) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onAvailableSelectionsFetched, onCalculateProbabilityFetched, onCalculateProbabilityFilterFetched, onChildSportEventFetched, onCompetitorFetched, onDrawFetched, onDrawSummaryEndpointFetched, onPlayerFetched, onSimpleTeamFetched, onSportEventStatusFetched, onSportTournamentsFetched, onTeamFetched
@Inject public SportsDataCacheImpl(com.google.common.cache.Cache<Urn,SportCi> sportsCache, com.google.common.cache.Cache<Urn,CategoryCi> categoriesCache, CacheItemFactory cacheItemFactory, DataRouterManager dataRouterManager)
public List<SportData> getSports(List<Locale> locales) throws IllegalCacheStateException
List
sports supported by the feed.getSports
in interface SportsDataCache
locales
- a List
of Locale
specifying the languages in which the data is returnedList
sports supported by the feedIllegalCacheStateException
public SportData getSport(Urn sportId, List<Locale> locales) throws IllegalCacheStateException, CacheItemNotFoundException
getSport
in interface SportsDataCache
sportId
- a Urn
specifying the id of the sportlocales
- a List
of Locale
specifying the languages in which the data is returnedSportData
containing information about the requested sportIllegalCacheStateException
CacheItemNotFoundException
public CategoryCi getCategory(Urn categoryId, List<Locale> locales) throws IllegalCacheStateException, CacheItemNotFoundException
getCategory
in interface SportsDataCache
categoryId
- the identifier of the categorylocales
- the locales in which to provide the dataIllegalCacheStateException
- if the cache load failedCacheItemNotFoundException
- if the cache item could not be found - category does not exists in the cache/apipublic void onSportEventFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiSportEvent data, Locale dataLocale)
onSportEventFetched
in interface DataRouterListener
public void onTournamentFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiTournament data, Locale locale)
onTournamentFetched
in interface DataRouterListener
public void onTournamentExtendedFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiTournamentExtended data, Locale dataLocale)
onTournamentExtendedFetched
in interface DataRouterListener
public void onTournamentInfoEndpointFetched(Urn requestedId, Urn tournamentId, Urn seasonId, com.sportradar.uf.sportsapi.datamodel.SapiTournamentInfoEndpoint data, Locale dataLocale, CacheItem requester)
onTournamentInfoEndpointFetched
in interface DataRouterListener
public void onStageSummaryEndpointFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiStageSummaryEndpoint data, Locale dataLocale, CacheItem requester)
onStageSummaryEndpointFetched
in interface DataRouterListener
public void onMatchSummaryEndpointFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiMatchSummaryEndpoint data, Locale dataLocale, CacheItem requester)
onMatchSummaryEndpointFetched
in interface DataRouterListener
public void onFixtureFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiFixture data, Locale dataLocale, CacheItem requester)
onFixtureFetched
in interface DataRouterListener
public void onSportFetched(Urn sportId, com.sportradar.uf.sportsapi.datamodel.SapiSport sport, Locale dataLocale)
onSportFetched
in interface DataRouterListener
public void onMatchTimelineFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiMatchTimelineEndpoint data, Locale dataLocale, CacheItem requester)
onMatchTimelineFetched
in interface DataRouterListener
public void onLotteryFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiLottery data, Locale locale, CacheItem requester)
onLotteryFetched
in interface DataRouterListener
public void onDrawFixtureFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiDrawFixture data, Locale locale, CacheItem requester)
onDrawFixtureFetched
in interface DataRouterListener
public void onSportCategoriesFetched(Urn sportId, com.sportradar.uf.sportsapi.datamodel.SapiSportCategoriesEndpoint data, Locale locale, CacheItem requester)
onSportCategoriesFetched
in interface DataRouterListener
public List<ExportableCi> exportItems()
exportItems
in interface ExportableSdkCache
ExportableCi
containing all the items currently in the cachepublic void importItems(List<ExportableCi> items)
importItems
in interface ExportableSdkCache
items
- List of ExportableCi
to be inserted into the cachepublic Map<String,Long> cacheStatus()
cacheStatus
in interface ExportableSdkCache
Copyright © 2016–2025. All rights reserved.