Interface MarketDescriptionManager
- All Known Implementing Classes:
MarketManagerImpl
public interface MarketDescriptionManager
Used to obtain information about available markets and get translations for markets and outcomes
including outrights
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteVariantMarketDescriptionFromCache(int marketId, String variantValue) Deletes the variant market description from cacheReturns the list of all available static market descriptions.getMarketDescriptions(Locale locale) Returns the list of all available static market descriptions in the providedLocalegetMarketMapping(int marketId, Producer producer) Returns a list of available mappings for the provided marketId/producer combinationgetMarketMapping(int marketId, Map<String, String> specifiers, Producer producer) Returns a list of available market mappings(including possible variant mappings) for the provided marketId/producer combinationbooleanLoads the invariant and variant list of market descriptions from the Sports APIlongparallelPrefetchVariantMarketDescriptions(List<? extends Market> markets) Prefetch variant market descriptions in parallel Useful when list of markets on feed message contains many variant markets which calls single variant market description api endpoint Only call this if name of the market is needed.longparallelPrefetchVariantMarketDescriptions(List<? extends Market> markets, boolean onlyVariantMarkets) Prefetch variant market descriptions in parallel Useful when list of markets on feed message contains many variant markets which calls single variant market description api endpoint Only call this if name of the market is needed.longparallelPrefetchVariantMarketDescriptions(List<? extends Market> markets, boolean onlyVariantMarkets, int threadPoolSize) Prefetch variant market descriptions in parallel Useful when list of markets on feed message contains many variant markets which calls single variant market description api endpoint Only call this if name of the market is needed.
-
Method Details
-
getMarketDescriptions
List<MarketDescription> getMarketDescriptions()Returns the list of all available static market descriptions.- Returns:
- a list of available static market descriptions
-
getMarketDescriptions
Returns the list of all available static market descriptions in the providedLocale- Parameters:
locale- the language in which the market static descriptions should be translated- Returns:
- a list of available market descriptions in the provided
Locale
-
getMarketMapping
Returns a list of available mappings for the provided marketId/producer combination- Parameters:
marketId- the id of the market for which you need the mappingproducer- the producer for which you need the mapping- Returns:
- a list of valid mappings for the provided marketId/producer combination
-
getMarketMapping
List<MarketMappingData> getMarketMapping(int marketId, Map<String, String> specifiers, Producer producer) Returns a list of available market mappings(including possible variant mappings) for the provided marketId/producer combination- Parameters:
marketId- the id of the market for which you need the mappingspecifiers- the associated market specifiersproducer- the producer for which you need the mapping- Returns:
- a list of valid mappings for the provided marketId/producer combination
-
loadMarketDescriptions
boolean loadMarketDescriptions()Loads the invariant and variant list of market descriptions from the Sports API- Returns:
- true if the action succeeded
-
deleteVariantMarketDescriptionFromCache
Deletes the variant market description from cache- Parameters:
marketId- the market id used to delete variant market description from the cachevariantValue- the variant value used to delete variant market description from the cache
-
parallelPrefetchVariantMarketDescriptions
Prefetch variant market descriptions in parallel Useful when list of markets on feed message contains many variant markets which calls single variant market description api endpoint Only call this if name of the market is needed. If only id part is, then this is not needed.- Parameters:
markets- the list of markets to be checked and fetched- Returns:
- the time needed for processing in ms
-
parallelPrefetchVariantMarketDescriptions
long parallelPrefetchVariantMarketDescriptions(List<? extends Market> markets, boolean onlyVariantMarkets) Prefetch variant market descriptions in parallel Useful when list of markets on feed message contains many variant markets which calls single variant market description api endpoint Only call this if name of the market is needed. If only id part is, then this is not needed.- Parameters:
markets- the list of markets to be checked and fetchedonlyVariantMarkets- prefetch only variant markets or all markets in the list (default: true)- Returns:
- the time needed for processing in ms
-
parallelPrefetchVariantMarketDescriptions
long parallelPrefetchVariantMarketDescriptions(List<? extends Market> markets, boolean onlyVariantMarkets, int threadPoolSize) Prefetch variant market descriptions in parallel Useful when list of markets on feed message contains many variant markets which calls single variant market description api endpoint Only call this if name of the market is needed. If only id part is, then this is not needed.- Parameters:
markets- the list of markets to be checked and fetchedonlyVariantMarkets- prefetch only variant markets or all markets in the list (default: true)threadPoolSize- the size of the fixed thread pool (default: 100)- Returns:
- the time needed for processing in ms
-