mirror of
https://github.com/google/nomulus.git
synced 2025-05-16 09:27:16 +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
|
@ -24,7 +24,7 @@ import static google.registry.testing.DatastoreHelper.persistResources;
|
|||
import static google.registry.testing.DatastoreHelper.persistSimpleResources;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeAndPersistContactResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeAndPersistHostResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainBase;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeHistoryEntry;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrar;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrarContacts;
|
||||
|
@ -38,7 +38,7 @@ import com.google.common.collect.Range;
|
|||
import com.google.common.net.InetAddresses;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
|
@ -75,11 +75,11 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDom
|
|||
}
|
||||
|
||||
private Registrar registrar;
|
||||
private DomainResource domainCatLol;
|
||||
private DomainResource domainCatLol2;
|
||||
private DomainResource domainCatExample;
|
||||
private DomainResource domainIdn;
|
||||
private DomainResource domainMultipart;
|
||||
private DomainBase domainCatLol;
|
||||
private DomainBase domainCatLol2;
|
||||
private DomainBase domainCatExample;
|
||||
private DomainBase domainIdn;
|
||||
private DomainBase domainMultipart;
|
||||
private ContactResource contact1;
|
||||
private ContactResource contact2;
|
||||
private ContactResource contact3;
|
||||
|
@ -154,7 +154,7 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDom
|
|||
makeRegistrar("evilregistrar", "Yes Virginia <script>", Registrar.State.ACTIVE));
|
||||
persistSimpleResources(makeRegistrarContacts(registrar));
|
||||
domainCatLol = persistResource(
|
||||
makeDomainResource(
|
||||
makeDomainBase(
|
||||
"cat.lol",
|
||||
contact1 = makeAndPersistContactResource(
|
||||
"5372808-ERL",
|
||||
|
@ -192,7 +192,7 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDom
|
|||
persistResource(
|
||||
hostNs2CatLol.asBuilder().setSuperordinateDomain(Key.create(domainCatLol)).build());
|
||||
domainCatLol2 = persistResource(
|
||||
makeDomainResource(
|
||||
makeDomainBase(
|
||||
"cat2.lol",
|
||||
makeAndPersistContactResource(
|
||||
"6372808-ERL",
|
||||
|
@ -226,7 +226,7 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDom
|
|||
makeRegistrar("goodregistrar", "St. John Chrysostom", Registrar.State.ACTIVE));
|
||||
persistSimpleResources(makeRegistrarContacts(registrar));
|
||||
domainCatExample = persistResource(
|
||||
makeDomainResource(
|
||||
makeDomainBase(
|
||||
"cat.example",
|
||||
makeAndPersistContactResource(
|
||||
"7372808-ERL",
|
||||
|
@ -258,7 +258,7 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDom
|
|||
registrar = persistResource(makeRegistrar("unicoderegistrar", "みんな", Registrar.State.ACTIVE));
|
||||
persistSimpleResources(makeRegistrarContacts(registrar));
|
||||
domainIdn = persistResource(
|
||||
makeDomainResource(
|
||||
makeDomainBase(
|
||||
"cat.みんな",
|
||||
makeAndPersistContactResource(
|
||||
"8372808-ERL",
|
||||
|
@ -291,7 +291,7 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDom
|
|||
registrar =
|
||||
persistResource(makeRegistrar("multiregistrar", "1.test", Registrar.State.ACTIVE));
|
||||
persistSimpleResources(makeRegistrarContacts(registrar));
|
||||
domainMultipart = persistResource(makeDomainResource(
|
||||
domainMultipart = persistResource(makeDomainBase(
|
||||
"cat.1.test",
|
||||
makeAndPersistContactResource(
|
||||
"9372808-ERL",
|
||||
|
@ -540,11 +540,11 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDom
|
|||
}
|
||||
ImmutableSet<Key<HostResource>> hostKeys = hostKeysBuilder.build();
|
||||
// Create all the domains at once, then persist them in parallel, for increased efficiency.
|
||||
ImmutableList.Builder<DomainResource> domainsBuilder = new ImmutableList.Builder<>();
|
||||
ImmutableList.Builder<DomainBase> domainsBuilder = new ImmutableList.Builder<>();
|
||||
for (int i = numActiveDomains * numTotalDomainsPerActiveDomain; i >= 1; i--) {
|
||||
String domainName = String.format("domain%d.lol", i);
|
||||
DomainResource.Builder builder =
|
||||
makeDomainResource(
|
||||
DomainBase.Builder builder =
|
||||
makeDomainBase(
|
||||
domainName, contact1, contact2, contact3, null, null, registrar)
|
||||
.asBuilder()
|
||||
.setNameservers(hostKeys)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue