diff --git a/java/google/registry/model/domain/DesignatedContact.java b/java/google/registry/model/domain/DesignatedContact.java index f9b5ef209..62f13e1e0 100644 --- a/java/google/registry/model/domain/DesignatedContact.java +++ b/java/google/registry/model/domain/DesignatedContact.java @@ -20,14 +20,22 @@ import com.googlecode.objectify.annotation.Embed; import com.googlecode.objectify.annotation.Index; import google.registry.model.ImmutableObject; import google.registry.model.contact.ContactResource; -import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlEnumValue; /** - * XML type for contact identifiers associated with a domain. + * Persisted type for storing a domain's contact associations. + * + *
A contact association on a domain consists of the contact key and the contact "type", which is + * the designated role of this contact with respect to this domain. When converting to and from + * EPP XML, we use {@link ForeignKeyedDesignatedContact} to replace the contact's Datastore key + * with its foreign key, since that is what EPP exposes. + * + *
Note one could in principle store contact foreign keys here in addition to keys, unlike the + * situation with hosts where client-side renames would make that data stale. However, we sometimes + * rename contacts internally ourselves, and it's easier to use the same model for both cases. * * @see - * RFC 5731 - EPP Domain Name Mapping- Contact and Client Identifiers + * RFC 5731 - EPP Domain Name Mapping - Contact and Client Identifiers */ @Embed public class DesignatedContact extends ImmutableObject { @@ -55,7 +63,6 @@ public class DesignatedContact extends ImmutableObject { return instance; } - @XmlAttribute(required = true) Type type; @Index diff --git a/java/google/registry/model/domain/ForeignKeyedDesignatedContact.java b/java/google/registry/model/domain/ForeignKeyedDesignatedContact.java index 61ece0625..745936cac 100644 --- a/java/google/registry/model/domain/ForeignKeyedDesignatedContact.java +++ b/java/google/registry/model/domain/ForeignKeyedDesignatedContact.java @@ -19,8 +19,11 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlValue; /** - * EPP-compatible version of XML type for contact identifiers associated with a domain, which can - * be converted to a storable {@link DesignatedContact}. + * EPP-XML-serializable equivalent of {@link DesignatedContact}. + * + *
This type is used on the wire for EPP XML, where only the contact ID (foreign key) is exposed. + * This is converted to and from the persisted type, {@link DesignatedContact}, which stores the + * Datastore key instead of the foreign key. * * @see * RFC 5731 - EPP Domain Name Mapping - Contact and Client Identifiers