Class MarketManagerImpl
java.lang.Object
com.sportradar.unifiedodds.sdk.internal.impl.markets.MarketManagerImpl
- All Implemented Interfaces:
MarketDescriptionManager
-
Constructor Summary
ConstructorsConstructorDescriptionMarketManagerImpl(SdkInternalConfiguration config, MarketDescriptionProvider marketDescriptionProvider, InvariantMarketDescriptionCache invariantMarketDescriptionCache, VariantDescriptionCache variantMarketDescriptionListCache, MarketDescriptionCache variantMarketDescriptionCache) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteVariantMarketDescriptionFromCache(int marketId, String variantValue) Deletes the variant market description from cacheGet the list of all available 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
-
Constructor Details
-
MarketManagerImpl
@Inject public MarketManagerImpl(SdkInternalConfiguration config, MarketDescriptionProvider marketDescriptionProvider, InvariantMarketDescriptionCache invariantMarketDescriptionCache, VariantDescriptionCache variantMarketDescriptionListCache, MarketDescriptionCache variantMarketDescriptionCache)
-
-
Method Details
-
getMarketDescriptions
Get the list of all available market descriptions.- Specified by:
getMarketDescriptionsin interfaceMarketDescriptionManager- Returns:
- a list of available market descriptions
-
getMarketDescriptions
Description copied from interface:MarketDescriptionManagerReturns the list of all available static market descriptions in the providedLocale- Specified by:
getMarketDescriptionsin interfaceMarketDescriptionManager- 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
Description copied from interface:MarketDescriptionManagerReturns a list of available mappings for the provided marketId/producer combination- Specified by:
getMarketMappingin interfaceMarketDescriptionManager- 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
public List<MarketMappingData> getMarketMapping(int marketId, Map<String, String> specifiers, Producer producer) Description copied from interface:MarketDescriptionManagerReturns a list of available market mappings(including possible variant mappings) for the provided marketId/producer combination- Specified by:
getMarketMappingin interfaceMarketDescriptionManager- 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
public boolean loadMarketDescriptions()Loads the invariant and variant list of market descriptions from the Sports API- Specified by:
loadMarketDescriptionsin interfaceMarketDescriptionManager- Returns:
- true if the action succeeded
-
deleteVariantMarketDescriptionFromCache
Deletes the variant market description from cache- Specified by:
deleteVariantMarketDescriptionFromCachein interfaceMarketDescriptionManager- 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
Description copied from interface:MarketDescriptionManagerPrefetch 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.- Specified by:
parallelPrefetchVariantMarketDescriptionsin interfaceMarketDescriptionManager- Parameters:
markets- the list of markets to be checked and fetched- Returns:
- the time needed for processing in ms
-
parallelPrefetchVariantMarketDescriptions
public long parallelPrefetchVariantMarketDescriptions(List<? extends Market> markets, boolean onlyVariantMarkets) Description copied from interface:MarketDescriptionManagerPrefetch 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.- Specified by:
parallelPrefetchVariantMarketDescriptionsin interfaceMarketDescriptionManager- 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
public 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- Specified by:
parallelPrefetchVariantMarketDescriptionsin interfaceMarketDescriptionManager- 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
-