Class ReservedList

All Implemented Interfaces:
Buildable, Cloneable

@Entity public final class ReservedList extends BaseDomainLabelList<ReservationType,ReservedList.ReservedListEntry>
A list of reserved domain labels that are blocked from being registered for various reasons.

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 reserved lists that differ only by revisionId. This is fine though, because we only use the list with the highest revisionId.

  • Constructor Details

    • ReservedList

      public ReservedList()
  • Method Details

    • refersToList

      protected boolean refersToList(Tld tld, String name)
      Specified by:
      refersToList in class BaseDomainLabelList<ReservationType,ReservedList.ReservedListEntry>
    • isInUse

      public boolean isInUse()
      Determines whether the ReservedList is in use on any Registry
    • getReservedListEntries

      public com.google.common.collect.ImmutableMap<String,ReservedList.ReservedListEntry> getReservedListEntries()
      Returns a Map of domain labels to ReservedList.ReservedListEntry.

      Note that this involves a database fetch of a potentially large number of elements and should be avoided unless necessary.

    • get

      public static Optional<ReservedList> get(String listName)
      Gets a ReservedList by name using the caching layer.
      Returns:
      An Optional<ReservedList> that has a value if a reserved list exists by the given name, or absent if not.
      Throws:
      com.google.common.util.concurrent.UncheckedExecutionException - if some other error occurs while trying to load the ReservedList from the cache or database.
    • getReservationTypes

      public static com.google.common.collect.ImmutableSet<ReservationType> getReservationTypes(String label, String tld)
      Queries the set of all reserved lists associated with the specified TLD and returns the reservation types of the label.

      If the label is in none of the lists, it returns an empty set.

    • loadReservedLists

      public static com.google.common.collect.ImmutableSet<ReservedList> loadReservedLists(com.google.common.collect.ImmutableSet<String> reservedListNames)
      Loads and returns the reserved lists with the given names, skipping those that don't exist.
    • getReservationInList

      public Optional<ReservationType> getReservationInList(String label)
      Gets the ReservationType of a label in a single ReservedList, or returns an absent Optional if none exists in the list.

      Note that this logic is significantly less complicated than the getReservationTypes(java.lang.String, java.lang.String) methods, which are applicable to an entire Registry, and need to check across multiple reserved lists.

    • asBuilder

      public ReservedList.Builder asBuilder()