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 Details

    • getMarketDescriptions

      List<MarketDescription> getMarketDescriptions()
      Returns the list of all available static market descriptions.
      Returns:
      a list of available static market descriptions
    • getMarketDescriptions

      List<MarketDescription> getMarketDescriptions(Locale locale)
      Returns the list of all available static market descriptions in the provided Locale
      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

      List<MarketMappingData> getMarketMapping(int marketId, Producer producer)
      Returns a list of available mappings for the provided marketId/producer combination
      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

      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 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

      boolean loadMarketDescriptions()
      Loads the invariant and variant list of market descriptions from the Sports API
      Returns:
      true if the action succeeded
    • deleteVariantMarketDescriptionFromCache

      void deleteVariantMarketDescriptionFromCache(int marketId, String variantValue)
      Deletes the variant market description from cache
      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

      long parallelPrefetchVariantMarketDescriptions(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. 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 fetched
      onlyVariantMarkets - 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 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