Interface SportEventCache
- All Known Implementing Classes:
SportEventCacheImpl
public interface SportEventCache
Created on 20/10/2017.
// TODO @eti: Javadoc
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds fixture timestamp to cache so that the next fixture calls for the event goes through non-cached fixture providerdeleteSportEventsFromCache(Date before) Deletes the sport events from cache which are scheduled before specified dategetEventCacheItem(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) voidonEventBooked(Urn id) Method that gets triggered when the associated event gets booked through theBookingManagervoidpurgeCacheItem(Urn id) Purges an item from theSportEventCache
-
Method Details
-
getEventCacheItem
Returns aSportEventCiinstance representing a cached sport event data- Parameters:
id- anUrnspecifying the id of the sport event- Returns:
- a
SportEventCiinstance representing cached sport event data - Throws:
CacheItemNotFoundException
-
getEventCacheItem
SportEventCi getEventCacheItem(Urn id, RequestOptions requestOptions) throws CacheItemNotFoundException Returns aSportEventCiinstance representing a cached sport event data- 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- 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- 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- Parameters:
id- TheUrnspecifying the event which should be purged
-
onEventBooked
Method that gets triggered when the associated event gets booked through theBookingManager- 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 through non-cached fixture provider- Parameters:
id- theUrnof the event
-
deleteSportEventsFromCache
Deletes the sport events from cache which are scheduled before specified date- Parameters:
before- the scheduled Date used to delete sport events from cache- Returns:
- number of deleted items
-