Class PremiumList

All Implemented Interfaces:
Buildable, Cloneable

@Entity public final class PremiumList extends BaseDomainLabelList<BigDecimal,PremiumList.PremiumEntry>
A premium list entity that is used to check domain label prices.

Note that the primary key of this entity is BaseDomainLabelList.revisionId, which is auto-generated by the database. So, if a retry of insertion happens after the previous attempt unexpectedly succeeds, we will end up with having two exact same premium lists that differ only by revisionId. This is fine though, because we only use the list with the highest revisionId.

  • Constructor Details

    • PremiumList

      public PremiumList()
  • Method Details

    • getCurrency

      public org.joda.money.CurrencyUnit getCurrency()
      Returns the CurrencyUnit used for this list.
    • getLabelsToPrices

      public com.google.common.collect.ImmutableMap<String,BigDecimal> getLabelsToPrices()
      Returns a Map of domain labels to prices.

      Note that this is lazily loaded and thus must be called inside a transaction. You generally should not be using this anyway as it's inefficient to load all of the PremiumEntry rows if you don't need them. To check prices, use PremiumListDao.getPremiumPrice(java.lang.String, java.lang.String) instead.

    • convertAmountToMoney

      public org.joda.money.Money convertAmountToMoney(BigDecimal amount)
      Converts a raw BigDecimal amount to a Money by applying the list's currency.
    • getBloomFilter

      public com.google.common.hash.BloomFilter<String> getBloomFilter()
      Returns a Bloom filter to determine whether a label might be premium, or is definitely not.

      If the domain label might be premium, then the next step is to check for the existence of a corresponding row in the PremiumListEntry table. Otherwise, we know for sure it's not premium, and no DB load is required.

    • refersToList

      public boolean refersToList(Tld tld, String name)
      Specified by:
      refersToList in class BaseDomainLabelList<BigDecimal,PremiumList.PremiumEntry>
    • asBuilder

      public PremiumList.Builder asBuilder()