Skip to content

Commit c40ef13

Browse files
committed
Remove Contact and ContactHistory Java objects and related code
This doesn't remove everything -- there are still other contact-related objects that we'll need to remove (e.g. ContactPendingActionNotificationResponse) and simplifications we'll need to make (e.g. only domains can be transferred now, so all transfer data can move there instead of being generic) But this removes the bulk of the remaining contact-related code. We'll keep around the XML request objects, since it's still nice to route them to the appropriate (exception-throwing but logging) flow class.
1 parent c7f2db1 commit c40ef13

30 files changed

+46
-1360
lines changed

core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,11 @@
6767
import google.registry.flows.EppException.RequiredParameterMissingException;
6868
import google.registry.flows.EppException.StatusProhibitsOperationException;
6969
import google.registry.flows.EppException.UnimplementedOptionException;
70-
import google.registry.flows.exceptions.ContactsProhibitedException;
7170
import google.registry.flows.exceptions.ResourceHasClientUpdateProhibitedException;
7271
import google.registry.model.EppResource;
7372
import google.registry.model.billing.BillingBase.Flag;
7473
import google.registry.model.billing.BillingBase.Reason;
7574
import google.registry.model.billing.BillingRecurrence;
76-
import google.registry.model.contact.Contact;
77-
import google.registry.model.domain.DesignatedContact;
7875
import google.registry.model.domain.Domain;
7976
import google.registry.model.domain.DomainCommand.Create;
8077
import google.registry.model.domain.DomainCommand.CreateOrUpdate;
@@ -421,33 +418,6 @@ static void validateNameserversCountForTld(String tld, InternetDomainName domain
421418
}
422419
}
423420

424-
/** Enforces absence of contact data on creation as part of the Minimum Dataset requirements. */
425-
static void enforceContactAbsencesOnCreate(Create create)
426-
throws ParameterValuePolicyErrorException {
427-
enforceContactAbsences(create.getRegistrant(), create.getContacts());
428-
}
429-
430-
/** Enforces absence of contact data on update as part of the Minimum Dataset requirements. */
431-
static void enforceContactAbsencesOnUpdate(Update update)
432-
throws ParameterValuePolicyErrorException {
433-
Set<DesignatedContact> allDesignatedContacts =
434-
Sets.union(update.getInnerAdd().getContacts(), update.getInnerRemove().getContacts());
435-
enforceContactAbsences(update.getInnerChange().getRegistrant(), allDesignatedContacts);
436-
}
437-
438-
/** Enforces the absence of contact data as part of the Minimum Dataset requirements. */
439-
static void enforceContactAbsences(
440-
Optional<VKey<Contact>> registrant, Set<DesignatedContact> contacts)
441-
throws ParameterValuePolicyErrorException {
442-
if (registrant.isPresent()) {
443-
throw new RegistrantProhibitedException();
444-
}
445-
if (!contacts.isEmpty()) {
446-
throw new ContactsProhibitedException();
447-
}
448-
}
449-
450-
451421
static void validateNameserversAllowedOnTld(String tld, Set<String> fullyQualifiedHostNames)
452422
throws EppException {
453423
ImmutableSet<String> allowedHostNames = Tld.get(tld).getAllowedFullyQualifiedHostNames();
@@ -971,7 +941,6 @@ static void validateCreateCommandContactsAndNameservers(
971941
Create command, Tld tld, InternetDomainName domainName) throws EppException {
972942
verifyNotInPendingDelete(command.getNameservers());
973943
String tldStr = tld.getTldStr();
974-
enforceContactAbsencesOnCreate(command);
975944
ImmutableSet<String> hostNames = command.getNameserverHostNames();
976945
validateNameserversCountForTld(tldStr, domainName, hostNames.size());
977946
validateNameserversAllowedOnTld(tldStr, hostNames);

core/src/main/java/google/registry/flows/domain/DomainUpdateFlow.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership;
3030
import static google.registry.flows.domain.DomainFlowUtils.checkAllowedAccessToTld;
3131
import static google.registry.flows.domain.DomainFlowUtils.cloneAndLinkReferences;
32-
import static google.registry.flows.domain.DomainFlowUtils.enforceContactAbsencesOnUpdate;
3332
import static google.registry.flows.domain.DomainFlowUtils.updateDsData;
3433
import static google.registry.flows.domain.DomainFlowUtils.validateDsData;
3534
import static google.registry.flows.domain.DomainFlowUtils.validateFeesAckedIfPresent;
@@ -249,8 +248,6 @@ private Domain performUpdate(Update command, Domain domain, DateTime now) throws
249248
ext.getRemove().map(Remove::getDsData).orElse(ImmutableSet.of()));
250249
}
251250
Change change = command.getInnerChange();
252-
enforceContactAbsencesOnUpdate(command);
253-
254251
Domain.Builder domainBuilder =
255252
domain
256253
.asBuilder()

core/src/main/java/google/registry/model/ForeignKeyUtils.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import com.google.common.collect.ImmutableSet;
3030
import com.google.common.collect.Maps;
3131
import google.registry.config.RegistryConfig;
32-
import google.registry.model.contact.Contact;
3332
import google.registry.model.domain.Domain;
3433
import google.registry.model.host.Host;
3534
import google.registry.persistence.VKey;
@@ -60,7 +59,6 @@ private ForeignKeyUtils() {}
6059
private static final ImmutableMap<Class<? extends EppResource>, String>
6160
RESOURCE_TYPE_TO_FK_PROPERTY =
6261
ImmutableMap.of(
63-
Contact.class, "contactId",
6462
Domain.class, "domainName",
6563
Host.class, "hostName");
6664

core/src/main/java/google/registry/model/contact/Contact.java

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)