mirror of
https://github.com/google/nomulus
synced 2026-08-20 22:26:12 +00:00
Get rid of ReferenceUnions entirely
This is the third and final phase in the migration away from ReferenceUnions. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=138778148
This commit is contained in:
@@ -40,7 +40,6 @@ import com.googlecode.objectify.Key;
|
||||
import com.googlecode.objectify.annotation.Entity;
|
||||
import com.googlecode.objectify.annotation.IgnoreSave;
|
||||
import com.googlecode.objectify.annotation.Index;
|
||||
import com.googlecode.objectify.annotation.OnSave;
|
||||
import com.googlecode.objectify.condition.IfNull;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
@@ -77,10 +76,6 @@ public abstract class DomainBase extends EppResource {
|
||||
String tld;
|
||||
|
||||
/** References to hosts that are the nameservers for the domain. */
|
||||
@XmlTransient
|
||||
//TODO(b/28713909): Delete this once migration away from ReferenceUnions is complete.
|
||||
Set<ReferenceUnion<HostResource>> nameservers;
|
||||
|
||||
@Index
|
||||
@XmlTransient
|
||||
Set<Key<HostResource>> nsHosts;
|
||||
@@ -234,18 +229,6 @@ public abstract class DomainBase extends EppResource {
|
||||
return tld;
|
||||
}
|
||||
|
||||
@OnSave
|
||||
void dualSaveReferenceUnions() {
|
||||
for (DesignatedContact contact : nullToEmptyImmutableCopy(allContacts)) {
|
||||
contact.contactId = ReferenceUnion.create(contact.contact);
|
||||
}
|
||||
ImmutableSet.Builder<ReferenceUnion<HostResource>> hosts = new ImmutableSet.Builder<>();
|
||||
for (Key<HostResource> hostKey : nullToEmptyImmutableCopy(nsHosts)) {
|
||||
hosts.add(ReferenceUnion.create(hostKey));
|
||||
}
|
||||
nameservers = hosts.build();
|
||||
}
|
||||
|
||||
/** Predicate to determine if a given {@link DesignatedContact} is the registrant. */
|
||||
private static final Predicate<DesignatedContact> IS_REGISTRANT =
|
||||
new Predicate<DesignatedContact>() {
|
||||
|
||||
Reference in New Issue
Block a user