Class SportEventStatusCacheImpl
java.lang.Object
com.sportradar.unifiedodds.sdk.internal.caching.impl.SportEventStatusCacheImpl
- All Implemented Interfaces:
DataRouterListener,SportEventStatusCache
public class SportEventStatusCacheImpl
extends Object
implements SportEventStatusCache, DataRouterListener
Cache storing sport event statuses
-
Constructor Summary
ConstructorsConstructorDescriptionSportEventStatusCacheImpl(com.google.common.cache.Cache<String, SportEventStatusCi> sportEventStatusCache, SportEventCache sportEventCache, com.google.common.cache.Cache<String, Date> ignoreEventsTimelineCache) Initializes a newSportEventStatusCacheImplinstance -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventIdForTimelineIgnore(Urn eventId, int producerId, String messageType) Adds the event identifier for timeline ignore Used for BetPal events to have ignored timeline event status cachegetSportEventStatusCi(Urn eventId, boolean makeApiCall) Returns the status of the event associated with the provided identifier.voidonSportEventStatusFetched(Urn id, SportEventStatusDto data, String statusOnEvent, String source) Adds a newsportEventStatusCacheentryvoidPurges the sport event status associated with the provided event idMethods 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, onChildSportEventFetched, onCompetitorFetched, onDrawFetched, onDrawSummaryEndpointFetched, onFixtureFetched, onLotteryFetched, onMatchSummaryEndpointFetched, onMatchTimelineFetched, onPlayerFetched, onSimpleTeamFetched, onSportCategoriesFetched, onSportEventFetched, onSportFetched, onSportTournamentsFetched, onStageSummaryEndpointFetched, onTeamFetched, onTournamentExtendedFetched, onTournamentFetched, onTournamentInfoEndpointFetched
-
Constructor Details
-
SportEventStatusCacheImpl
public SportEventStatusCacheImpl(com.google.common.cache.Cache<String, SportEventStatusCi> sportEventStatusCache, SportEventCache sportEventCache, com.google.common.cache.Cache<String, Date> ignoreEventsTimelineCache) Initializes a newSportEventStatusCacheImplinstance- Parameters:
sportEventStatusCache- - theCacheinstance used to store sport event statusessportEventCache- - theSportEventCacheinstance used to fetch sport event statuses if they are not yet cachedignoreEventsTimelineCache- - theCacheinstance used to store event ids for which timeline SES should be ignored
-
-
Method Details
-
getSportEventStatusCi
Returns the status of the event associated with the provided identifier. If the instance associated with the specified event is not found, aSportEventStatusCiinstance indicating a 'not started' event is returned.- Specified by:
getSportEventStatusCiin interfaceSportEventStatusCache- Parameters:
eventId- the event identifiermakeApiCall- should the API call be made if necessary- Returns:
- a
SportEventStatusCiinstance describing the last known event status
-
onSportEventStatusFetched
public void onSportEventStatusFetched(Urn id, SportEventStatusDto data, String statusOnEvent, String source) Adds a newsportEventStatusCacheentry- Specified by:
onSportEventStatusFetchedin interfaceDataRouterListener- Parameters:
id- - the unique identifier of the sport event to which the status belongs todata- - aSportEventStatusDtoto store in the cachestatusOnEvent- - a status obtained directly on the sport eventsource- - a source of the data
-
purgeSportEventStatus
Purges the sport event status associated with the provided event id- Specified by:
purgeSportEventStatusin interfaceSportEventStatusCache- Parameters:
id- the id of the event that you want to purge the sport event status
-
addEventIdForTimelineIgnore
Adds the event identifier for timeline ignore Used for BetPal events to have ignored timeline event status cache- Specified by:
addEventIdForTimelineIgnorein interfaceSportEventStatusCache- Parameters:
eventId- the event identifierproducerId- the producer identifiermessageType- type of the feed message
-