Class ReservedList
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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A builder for constructingReservedList
objects, since they are immutable.static class
A reserved list entry entity, persisted to the database, that represents a single label and its reservation type.Nested classes/interfaces inherited from class google.registry.model.ImmutableObject
ImmutableObject.DoNotHydrate, ImmutableObject.IgnoredInDiffableMap, ImmutableObject.Insignificant
Nested classes/interfaces inherited from interface google.registry.model.Buildable
Buildable.GenericBuilder<S,
B extends Buildable.GenericBuilder<?, ?>>, Buildable.Overlayable<T> -
Field Summary
Fields inherited from class google.registry.model.ImmutableObject
hashCode
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional
<ReservedList> Gets a ReservedList by name using the caching layer.getReservationInList
(String label) Gets theReservationType
of a label in a single ReservedList, or returns an absent Optional if none exists in the list.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.com.google.common.collect.ImmutableMap
<String, ReservedList.ReservedListEntry> Returns aMap
of domain labels toReservedList.ReservedListEntry
.boolean
isInUse()
Determines whether the ReservedList is in use on any Registrystatic 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.protected boolean
refersToList
(Tld tld, String name) Methods inherited from class google.registry.model.tld.label.BaseDomainLabelList
getCreationTimestamp, getName, getReferencingTlds, getRevisionId, parse, splitOnComment
Methods inherited from class google.registry.model.ImmutableObject
clone, cloneEmptyToNull, createVKey, equals, getSignificantFields, hashCode, toDiffableFieldMap, toHydratedString, toString, toStringHelper
-
Constructor Details
-
ReservedList
public ReservedList()
-
-
Method Details
-
refersToList
- Specified by:
refersToList
in classBaseDomainLabelList<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 aMap
of domain labels toReservedList.ReservedListEntry
.Note that this involves a database fetch of a potentially large number of elements and should be avoided unless necessary.
-
get
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
Gets theReservationType
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
-