Class SportEventCacheImpl
java.lang.Object
com.sportradar.unifiedodds.sdk.internal.caching.impl.SportEventCacheImpl
- All Implemented Interfaces:
DataRouterListener,SportEventCache,ExportableSdkCache
public class SportEventCacheImpl
extends Object
implements SportEventCache, DataRouterListener, ExportableSdkCache
Implements methods used to access sport event data
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds fixture timestamp to cache so that the next fixture calls for the event goes trough non-cached fixture providerReturns current cache statusdeleteSportEventsFromCache(Date before) Deletes the sport events from cache which are scheduled before specified dateExports current items in the cachegetEventCacheItem(Urn id) Returns aSportEventCiinstance representing a cached sport event datagetEventCacheItem(Urn id, RequestOptions requestOptions) Returns aSportEventCiinstance representing a cached sport event datagetEventIds(Urn tournamentId, Locale locale) Returns aListcontaining id's of sport events, which belong to a specific tournamentgetEventIds(Date date, Locale locale) voidimportItems(List<ExportableCi> items) Imports provided items into the cachevoidonChildSportEventFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiSportEventChildren.SapiSportEvent data, Locale dataLocale) voidonDrawFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiDrawEvent data, Locale dataLocale, CacheItem requester) voidonDrawSummaryEndpointFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiDrawSummary data, Locale dataLocale, CacheItem requester) voidonEventBooked(Urn id) Method that gets triggered when the associated event gets booked trough theBookingManagervoidonFixtureFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiFixture data, Locale dataLocale, CacheItem requester) voidonLotteryFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiLottery data, Locale dataLocale, CacheItem requester) voidonMatchSummaryEndpointFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiMatchSummaryEndpoint data, Locale dataLocale, CacheItem requester) voidonMatchTimelineFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiMatchTimelineEndpoint data, Locale dataLocale, CacheItem requester) voidonSportEventFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiSportEvent data, Locale dataLocale) voidonStageSummaryEndpointFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiStageSummaryEndpoint data, Locale dataLocale, CacheItem requester) voidonTournamentExtendedFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiTournamentExtended data, Locale dataLocale) voidonTournamentFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiTournament data, Locale locale) voidonTournamentInfoEndpointFetched(Urn requestedId, Urn tournamentId, Urn seasonId, com.sportradar.uf.sportsapi.datamodel.SapiTournamentInfoEndpoint data, Locale dataLocale, CacheItem requester) voidpurgeCacheItem(Urn id) Purges an item from theSportEventCacheMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sportradar.unifiedodds.sdk.internal.caching.DataRouterListener
onAvailableSelectionsFetched, onCalculateProbabilityFetched, onCalculateProbabilityFilterFetched, onCompetitorFetched, onPlayerFetched, onSimpleTeamFetched, onSportCategoriesFetched, onSportEventStatusFetched, onSportFetched, onSportTournamentsFetched, onTeamFetched
-
Method Details
-
getEventCacheItem
Returns aSportEventCiinstance representing a cached sport event data- Specified by:
getEventCacheItemin interfaceSportEventCache- Parameters:
id- anUrnspecifying the id of the sport event- Returns:
- a
SportEventCiinstance representing cached sport event data - Throws:
CacheItemNotFoundException
-
getEventCacheItem
public SportEventCi getEventCacheItem(Urn id, RequestOptions requestOptions) throws CacheItemNotFoundException Returns aSportEventCiinstance representing a cached sport event data- Specified by:
getEventCacheItemin interfaceSportEventCache- Parameters:
id- anUrnspecifying the id of the sport eventrequestOptions- aRequestOptionsobject with the configuration of request issued to DataRouterManager- Returns:
- a
SportEventCiinstance representing cached sport event data - Throws:
CacheItemNotFoundException
-
getEventIds
Returns aListcontaining id's of sport events, which belong to a specific tournament- Specified by:
getEventIdsin interfaceSportEventCache- Parameters:
tournamentId- anUrnspecifying the id of the tournament to which the events should relatelocale- the locale to fetch the data- Returns:
- a
Listcontaining id's of sport events, which belong to the specified tournament - Throws:
IllegalCacheStateException
-
getEventIds
Returns aListcontaining id's of sport events, which are scheduled for a specific date - if provided; otherwise aListof currently live events is returned- Specified by:
getEventIdsin interfaceSportEventCache- Parameters:
date- an optionalDatefor which the data is providedlocale- the locale to fetch the data- Returns:
- a
Listof events that are happening on the specifiedDate; or aListof currently live events - Throws:
IllegalCacheStateException
-
purgeCacheItem
Purges an item from theSportEventCache- Specified by:
purgeCacheItemin interfaceSportEventCache- Parameters:
id- TheUrnspecifying the event which should be purged
-
onSportEventFetched
public void onSportEventFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiSportEvent data, Locale dataLocale) - Specified by:
onSportEventFetchedin interfaceDataRouterListener
-
onChildSportEventFetched
public void onChildSportEventFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiSportEventChildren.SapiSportEvent data, Locale dataLocale) - Specified by:
onChildSportEventFetchedin interfaceDataRouterListener
-
onTournamentExtendedFetched
public void onTournamentExtendedFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiTournamentExtended data, Locale dataLocale) - Specified by:
onTournamentExtendedFetchedin interfaceDataRouterListener
-
onTournamentInfoEndpointFetched
public void onTournamentInfoEndpointFetched(Urn requestedId, Urn tournamentId, Urn seasonId, com.sportradar.uf.sportsapi.datamodel.SapiTournamentInfoEndpoint data, Locale dataLocale, CacheItem requester) - Specified by:
onTournamentInfoEndpointFetchedin interfaceDataRouterListener
-
onStageSummaryEndpointFetched
public void onStageSummaryEndpointFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiStageSummaryEndpoint data, Locale dataLocale, CacheItem requester) - Specified by:
onStageSummaryEndpointFetchedin interfaceDataRouterListener
-
onMatchSummaryEndpointFetched
public void onMatchSummaryEndpointFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiMatchSummaryEndpoint data, Locale dataLocale, CacheItem requester) - Specified by:
onMatchSummaryEndpointFetchedin interfaceDataRouterListener
-
onFixtureFetched
public void onFixtureFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiFixture data, Locale dataLocale, CacheItem requester) - Specified by:
onFixtureFetchedin interfaceDataRouterListener
-
onTournamentFetched
public void onTournamentFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiTournament data, Locale locale) - Specified by:
onTournamentFetchedin interfaceDataRouterListener
-
onMatchTimelineFetched
public void onMatchTimelineFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiMatchTimelineEndpoint data, Locale dataLocale, CacheItem requester) - Specified by:
onMatchTimelineFetchedin interfaceDataRouterListener
-
onLotteryFetched
public void onLotteryFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiLottery data, Locale dataLocale, CacheItem requester) - Specified by:
onLotteryFetchedin interfaceDataRouterListener
-
onDrawFetched
public void onDrawFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiDrawEvent data, Locale dataLocale, CacheItem requester) - Specified by:
onDrawFetchedin interfaceDataRouterListener
-
onDrawSummaryEndpointFetched
public void onDrawSummaryEndpointFetched(Urn id, com.sportradar.uf.sportsapi.datamodel.SapiDrawSummary data, Locale dataLocale, CacheItem requester) - Specified by:
onDrawSummaryEndpointFetchedin interfaceDataRouterListener
-
onEventBooked
Method that gets triggered when the associated event gets booked trough theBookingManager- Specified by:
onEventBookedin interfaceSportEventCache- Parameters:
id- theUrnof the event that was successfully booked
-
addFixtureTimestamp
Adds fixture timestamp to cache so that the next fixture calls for the event goes trough non-cached fixture provider- Specified by:
addFixtureTimestampin interfaceSportEventCache- Parameters:
id- theUrnof the event
-
deleteSportEventsFromCache
Deletes the sport events from cache which are scheduled before specified date- Specified by:
deleteSportEventsFromCachein interfaceSportEventCache- Parameters:
before- the scheduled Date used to delete sport events from cache- Returns:
- number of deleted items
-
exportItems
Exports current items in the cache- Specified by:
exportItemsin interfaceExportableSdkCache- Returns:
- List of
ExportableCicontaining all the items currently in the cache
-
importItems
Imports provided items into the cache- Specified by:
importItemsin interfaceExportableSdkCache- Parameters:
items- List ofExportableCito be inserted into the cache
-
cacheStatus
Returns current cache status- Specified by:
cacheStatusin interfaceExportableSdkCache- Returns:
- A map containing all cache item types in the cache and their counts
-