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, wait
onAvailableSelectionsFetched, onCalculateProbabilityFetched, onCalculateProbabilityFilterFetched, onChildSportEventFetched, onDrawFetched, onDrawFixtureFetched, onDrawSummaryEndpointFetched, onFixtureFetched, onLotteryFetched, onMatchSummaryEndpointFetched, onMatchTimelineFetched, onSportCategoriesFetched, onSportEventFetched, onSportEventStatusFetched, onSportFetched, onSportTournamentsFetched, onStageSummaryEndpointFetched, onTournamentExtendedFetched, onTournamentFetched, onTournamentInfoEndpointFetched
public 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 Urn
getPlayerProfile
in interface ProfileCache
id
- 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 Urn
CacheItemNotFoundException
public CompetitorCi getCompetitorProfile(Urn id, List<Locale> locales) throws CacheItemNotFoundException
CompetitorCi
associated with the provided Urn
getCompetitorProfile
in interface ProfileCache
id
- the unique Urn
identifier of the competitorlocales
- a List
of locales in which the data is requiredCompetitorCi
associated with the provided Urn
CacheItemNotFoundException
public void purgeCompetitorProfileCacheItem(Urn competitorId)
purgeCompetitorProfileCacheItem
in interface ProfileCache
competitorId
- the identifier of the cache item to purgepublic void purgePlayerProfileCacheItem(Urn playerId)
purgePlayerProfileCacheItem
in interface ProfileCache
playerId
- 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 DataRouterListener
public 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 DataRouterListener
public void onTeamFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiTeam data, Locale dataLocale, CacheItem requester)
onTeamFetched
in interface DataRouterListener
public void onSimpleTeamFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiSimpleTeamProfileEndpoint data, Locale dataLocale, CacheItem requester)
onSimpleTeamFetched
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.