Class ClaimsList
- All Implemented Interfaces:
Cloneable
Note that the primary key of this entity is 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 claims list with only different revisionId
. However, this is not an actual problem because we only use the claims list with
highest revisionId
.
-
Nested Class Summary
Nested classes/interfaces inherited from class google.registry.model.ImmutableObject
ImmutableObject.DoNotHydrate, ImmutableObject.IgnoredInDiffableMap, ImmutableObject.Insignificant
-
Field Summary
Fields inherited from class google.registry.model.ImmutableObject
hashCode
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClaimsList
create
(org.joda.time.DateTime tmdbGenerationTime, com.google.common.collect.ImmutableMap<String, String> labelsToKeys) getClaimKey
(String label) Returns the claim key for a given domain if there is one, empty otherwise.org.joda.time.DateTime
Returns the creation time of this claims list.Returns anMap
mapping domain label to its lookup key.Returns the revision id of this claims list, or throws exception if it is null.org.joda.time.DateTime
Returns the time when the external TMDB service generated this revision of the claims list.long
size()
Returns the number of claims.Methods inherited from class google.registry.model.ImmutableObject
clone, cloneEmptyToNull, createVKey, equals, getSignificantFields, hashCode, toDiffableFieldMap, toHydratedString, toString, toStringHelper
-
Constructor Details
-
ClaimsList
public ClaimsList()
-
-
Method Details
-
getRevisionId
Returns the revision id of this claims list, or throws exception if it is null. -
getTmdbGenerationTime
public org.joda.time.DateTime getTmdbGenerationTime()Returns the time when the external TMDB service generated this revision of the claims list.- See Also:
-
getCreationTimestamp
public org.joda.time.DateTime getCreationTimestamp()Returns the creation time of this claims list. -
getClaimKey
Returns the claim key for a given domain if there is one, empty otherwise.Note that this may do a database query. For checking multiple keys against the claims list it may be more efficient to use
getLabelsToKeys()
first, as this will prefetch all entries and cache them locally. -
getLabelsToKeys
Returns anMap
mapping domain label to its lookup key.Note that this involves a database fetch of a potentially large number of elements and should be avoided unless necessary.
-
size
public long size()Returns the number of claims.Note that this will perform a database "count" query if the label to key map has not been previously cached by calling
getLabelsToKeys()
. -
create
public static ClaimsList create(org.joda.time.DateTime tmdbGenerationTime, com.google.common.collect.ImmutableMap<String, String> labelsToKeys)
-