mirror of
https://github.com/google/nomulus
synced 2026-07-19 06:22:33 +00:00
Merge DomainResource into DomainBase
This eliminates the use of Objectify polymorphism for EPP resources entirely (yay!), which makes the Registry 3.0 database migration easier. It is unfortunate that the naming parallelism of EppResources is lost between ContactResource, HostResource, and DomainResource, but the actual type as far as Datastore was concerned was DomainBase all along, and it would be a much more substantial data migration to allow us to continue using the class name DomainResource now that we're no longer using Objectify polymorphism. This simply isn't worth it. This also removes the polymorphic Datastore indexes (which will no longer function as of this change). The non-polymorphic replacement indexes were added in [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=230930546
This commit is contained in:
@@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.Period.Unit;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
@@ -91,7 +91,7 @@ class UnrenewDomainCommand extends ConfirmingCommand implements CommandWithRemot
|
||||
domainsNonexistentBuilder.add(domainName);
|
||||
continue;
|
||||
}
|
||||
Optional<DomainResource> domain = loadByForeignKey(DomainResource.class, domainName, now);
|
||||
Optional<DomainBase> domain = loadByForeignKey(DomainBase.class, domainName, now);
|
||||
if (!domain.isPresent()
|
||||
|| domain.get().getStatusValues().contains(StatusValue.PENDING_DELETE)) {
|
||||
domainsDeletingBuilder.add(domainName);
|
||||
@@ -151,8 +151,8 @@ class UnrenewDomainCommand extends ConfirmingCommand implements CommandWithRemot
|
||||
private void unrenewDomain(String domainName) {
|
||||
ofy().assertInTransaction();
|
||||
DateTime now = ofy().getTransactionTime();
|
||||
Optional<DomainResource> domainOptional =
|
||||
loadByForeignKey(DomainResource.class, domainName, now);
|
||||
Optional<DomainBase> domainOptional =
|
||||
loadByForeignKey(DomainBase.class, domainName, now);
|
||||
// Transactional sanity checks on the off chance that something changed between init() running
|
||||
// and here.
|
||||
checkState(
|
||||
@@ -160,7 +160,7 @@ class UnrenewDomainCommand extends ConfirmingCommand implements CommandWithRemot
|
||||
&& !domainOptional.get().getStatusValues().contains(StatusValue.PENDING_DELETE),
|
||||
"Domain %s was deleted or is pending deletion",
|
||||
domainName);
|
||||
DomainResource domain = domainOptional.get();
|
||||
DomainBase domain = domainOptional.get();
|
||||
checkState(
|
||||
Sets.intersection(domain.getStatusValues(), DISALLOWED_STATUSES).isEmpty(),
|
||||
"Domain %s has prohibited status values",
|
||||
@@ -206,7 +206,7 @@ class UnrenewDomainCommand extends ConfirmingCommand implements CommandWithRemot
|
||||
.build();
|
||||
// End the old autorenew billing event and poll message now.
|
||||
updateAutorenewRecurrenceEndTime(domain, now);
|
||||
DomainResource newDomain =
|
||||
DomainBase newDomain =
|
||||
domain
|
||||
.asBuilder()
|
||||
.setRegistrationExpirationTime(newExpirationTime)
|
||||
|
||||
Reference in New Issue
Block a user