Class MarketManagerImpl

java.lang.Object
com.sportradar.unifiedodds.sdk.internal.impl.markets.MarketManagerImpl
All Implemented Interfaces:
MarketDescriptionManager

public class MarketManagerImpl extends Object implements MarketDescriptionManager
  • Constructor Details

  • Method Details

    • getMarketDescriptions

      public List<MarketDescription> getMarketDescriptions()
      Get the list of all available market descriptions.
      Specified by:
      getMarketDescriptions in interface MarketDescriptionManager
      Returns:
      a list of available market descriptions
    • getMarketDescriptions

      public List<MarketDescription> getMarketDescriptions(Locale locale)
      Description copied from interface: MarketDescriptionManager
      Returns the list of all available static market descriptions in the provided Locale
      Specified by:
      getMarketDescriptions in interface MarketDescriptionManager
      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

      public List<MarketMappingData> getMarketMapping(int marketId, Producer producer)
      Description copied from interface: MarketDescriptionManager
      Returns a list of available mappings for the provided marketId/producer combination
      Specified by:
      getMarketMapping in interface MarketDescriptionManager
      Parameters:
      marketId - the id of the market for which you need the mapping
      producer - 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: MarketDescriptionManager
      Returns a list of available market mappings(including possible variant mappings) for the provided marketId/producer combination
      Specified by:
      getMarketMapping in interface MarketDescriptionManager
      Parameters:
      marketId - the id of the market for which you need the mapping
      specifiers - the associated market specifiers
      producer - 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:
      loadMarketDescriptions in interface MarketDescriptionManager
      Returns:
      true if the action succeeded
    • deleteVariantMarketDescriptionFromCache

      public void deleteVariantMarketDescriptionFromCache(int marketId, String variantValue)
      Deletes the variant market description from cache
      Specified by:
      deleteVariantMarketDescriptionFromCache in interface MarketDescriptionManager
      Parameters:
      marketId - the market id used to delete variant market description from the cache
      variantValue - the variant value used to delete variant market description from the cache
    • parallelPrefetchVariantMarketDescriptions

      public long parallelPrefetchVariantMarketDescriptions(List<? extends Market> markets)
      Description copied from interface: MarketDescriptionManager
      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.
      Specified by:
      parallelPrefetchVariantMarketDescriptions in interface MarketDescriptionManager
      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: MarketDescriptionManager
      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.
      Specified by:
      parallelPrefetchVariantMarketDescriptions in interface MarketDescriptionManager
      Parameters:
      markets - the list of markets to be checked and fetched
      onlyVariantMarkets - 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:
      parallelPrefetchVariantMarketDescriptions in interface MarketDescriptionManager
      Parameters:
      markets - the list of markets to be checked and fetched
      onlyVariantMarkets - 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