mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02: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:
parent
97c2049669
commit
e2528875b2
166 changed files with 1525 additions and 1666 deletions
|
@ -25,7 +25,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.google.common.collect.Sets;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import com.google.template.soy.data.SoyMapData;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.tools.soy.DomainUpdateSoyInfo;
|
||||
import java.util.Optional;
|
||||
|
@ -46,10 +46,10 @@ public class UnlockDomainCommand extends LockOrUnlockDomainCommand {
|
|||
// Project all domains as of the same time so that argument order doesn't affect behavior.
|
||||
DateTime now = DateTime.now(UTC);
|
||||
for (String domain : getDomains()) {
|
||||
Optional<DomainResource> domainResource = loadByForeignKey(DomainResource.class, domain, now);
|
||||
checkArgumentPresent(domainResource, "Domain '%s' does not exist or is deleted", domain);
|
||||
Optional<DomainBase> domainBase = loadByForeignKey(DomainBase.class, domain, now);
|
||||
checkArgumentPresent(domainBase, "Domain '%s' does not exist or is deleted", domain);
|
||||
ImmutableSet<StatusValue> statusesToRemove =
|
||||
Sets.intersection(domainResource.get().getStatusValues(), REGISTRY_LOCK_STATUSES)
|
||||
Sets.intersection(domainBase.get().getStatusValues(), REGISTRY_LOCK_STATUSES)
|
||||
.immutableCopy();
|
||||
if (statusesToRemove.isEmpty()) {
|
||||
logger.atInfo().log("Domain '%s' is already unlocked and needs no updates.", domain);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue