public class ProfileCacheImpl extends Object implements ProfileCache, DataRouterListener, ExportableSdkCache
| Constructor and Description |
|---|
ProfileCacheImpl(CacheItemFactory cacheItemFactory,
DataRouterManager dataRouterManager,
com.google.common.cache.Cache<Urn,PlayerProfileCi> playerCache,
com.google.common.cache.Cache<Urn,CompetitorCi> competitorCache,
com.google.common.cache.Cache<Urn,CompetitorCi> simpleTeamCache) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Long> |
cacheStatus()
Returns current cache status
|
List<ExportableCi> |
exportItems()
Exports current items in the cache
|
CompetitorCi |
getCompetitorProfile(Urn id,
List<Locale> locales)
Returns a
CompetitorCi associated with the provided Urn |
PlayerProfileCi |
getPlayerProfile(Urn id,
List<Locale> locales,
List<Urn> possibleAssociatedCompetitorIds)
Returns a
PlayerProfileCi associated with the provided Urn |
void |
importItems(List<ExportableCi> items)
Imports provided items into the cache
|
void |
onCompetitorFetched(Urn id,
com.sportradar.uf.sportsapi.datamodel.SapiCompetitorProfileEndpoint data,
Locale dataLocale,
CacheItem requester) |
void |
onPlayerCompetitorFetched(Urn id,
com.sportradar.uf.sportsapi.datamodel.SapiPlayerCompetitor data,
Locale dataLocale,
CacheItem requester,
Urn competitorId) |
void |
onPlayerFetched(Urn id,
com.sportradar.uf.sportsapi.datamodel.SapiPlayerExtended data,
Locale dataLocale,
CacheItem requester,
Urn competitorId) |
void |
onSimpleTeamFetched(Urn id,
com.sportradar.uf.sportsapi.datamodel.SapiSimpleTeamProfileEndpoint data,
Locale dataLocale,
CacheItem requester) |
void |
onTeamFetched(Urn id,
com.sportradar.uf.sportsapi.datamodel.SapiTeam data,
Locale dataLocale,
CacheItem requester) |
void |
purgeCompetitorProfileCacheItem(Urn competitorId)
Purges the associated competitor cache item
|
void |
purgePlayerProfileCacheItem(Urn playerId)
Purges the associated player profile cache item
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonAvailableSelectionsFetched, onCalculateProbabilityFetched, onCalculateProbabilityFilterFetched, onChildSportEventFetched, onDrawFetched, onDrawFixtureFetched, onDrawSummaryEndpointFetched, onFixtureFetched, onLotteryFetched, onMatchSummaryEndpointFetched, onMatchTimelineFetched, onSportCategoriesFetched, onSportEventFetched, onSportEventStatusFetched, onSportFetched, onSportTournamentsFetched, onStageSummaryEndpointFetched, onTournamentExtendedFetched, onTournamentFetched, onTournamentInfoEndpointFetchedpublic ProfileCacheImpl(CacheItemFactory cacheItemFactory, DataRouterManager dataRouterManager, com.google.common.cache.Cache<Urn,PlayerProfileCi> playerCache, com.google.common.cache.Cache<Urn,CompetitorCi> competitorCache, com.google.common.cache.Cache<Urn,CompetitorCi> simpleTeamCache)
public PlayerProfileCi getPlayerProfile(Urn id, List<Locale> locales, List<Urn> possibleAssociatedCompetitorIds) throws CacheItemNotFoundException
PlayerProfileCi associated with the provided UrngetPlayerProfile in interface ProfileCacheid - the unique Urn identifier of the playerlocales - a List of locales in which the data is requiredpossibleAssociatedCompetitorIds - a list of possible associated competitors, used to prefetch competitor profilesPlayerProfileCi associated with the provided UrnCacheItemNotFoundExceptionpublic CompetitorCi getCompetitorProfile(Urn id, List<Locale> locales) throws CacheItemNotFoundException
CompetitorCi associated with the provided UrngetCompetitorProfile in interface ProfileCacheid - the unique Urn identifier of the competitorlocales - a List of locales in which the data is requiredCompetitorCi associated with the provided UrnCacheItemNotFoundExceptionpublic void purgeCompetitorProfileCacheItem(Urn competitorId)
purgeCompetitorProfileCacheItem in interface ProfileCachecompetitorId - the identifier of the cache item to purgepublic void purgePlayerProfileCacheItem(Urn playerId)
purgePlayerProfileCacheItem in interface ProfileCacheplayerId - the identifier of the cache item to purgepublic void onPlayerFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiPlayerExtended data, Locale dataLocale, CacheItem requester, Urn competitorId)
onPlayerFetched in interface DataRouterListenerpublic void onPlayerCompetitorFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiPlayerCompetitor data, Locale dataLocale, CacheItem requester, Urn competitorId)
public void onCompetitorFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiCompetitorProfileEndpoint data, Locale dataLocale, CacheItem requester)
onCompetitorFetched in interface DataRouterListenerpublic void onTeamFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiTeam data, Locale dataLocale, CacheItem requester)
onTeamFetched in interface DataRouterListenerpublic void onSimpleTeamFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiSimpleTeamProfileEndpoint data, Locale dataLocale, CacheItem requester)
onSimpleTeamFetched in interface DataRouterListenerpublic List<ExportableCi> exportItems()
exportItems in interface ExportableSdkCacheExportableCi containing all the items currently in the cachepublic void importItems(List<ExportableCi> items)
importItems in interface ExportableSdkCacheitems - List of ExportableCi to be inserted into the cachepublic Map<String,Long> cacheStatus()
cacheStatus in interface ExportableSdkCacheCopyright © 2016–2025. All rights reserved.