mirror of
https://github.com/google/nomulus.git
synced 2025-07-28 05:26:24 +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
|
@ -27,7 +27,7 @@ import com.google.common.net.InternetDomainName;
|
|||
import google.registry.config.RegistryConfig.Config;
|
||||
import google.registry.dns.writer.BaseDnsWriter;
|
||||
import google.registry.dns.writer.DnsWriterZone;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.registry.Registries;
|
||||
|
@ -127,12 +127,12 @@ public class DnsUpdateWriter extends BaseDnsWriter {
|
|||
* this domain refresh request
|
||||
*/
|
||||
private void publishDomain(String domainName, String requestingHostName) {
|
||||
Optional<DomainResource> domainOptional =
|
||||
loadByForeignKey(DomainResource.class, domainName, clock.nowUtc());
|
||||
Optional<DomainBase> domainOptional =
|
||||
loadByForeignKey(DomainBase.class, domainName, clock.nowUtc());
|
||||
update.delete(toAbsoluteName(domainName), Type.ANY);
|
||||
// If the domain is now deleted, then don't update DNS for it.
|
||||
if (domainOptional.isPresent()) {
|
||||
DomainResource domain = domainOptional.get();
|
||||
DomainBase domain = domainOptional.get();
|
||||
// As long as the domain exists, orphan glues should be cleaned.
|
||||
deleteSubordinateHostAddressSet(domain, requestingHostName, update);
|
||||
if (domain.shouldPublishToDns()) {
|
||||
|
@ -184,7 +184,7 @@ public class DnsUpdateWriter extends BaseDnsWriter {
|
|||
}
|
||||
}
|
||||
|
||||
private RRset makeDelegationSignerSet(DomainResource domain) {
|
||||
private RRset makeDelegationSignerSet(DomainBase domain) {
|
||||
RRset signerSet = new RRset();
|
||||
for (DelegationSignerData signerData : domain.getDsData()) {
|
||||
DSRecord dsRecord =
|
||||
|
@ -202,7 +202,7 @@ public class DnsUpdateWriter extends BaseDnsWriter {
|
|||
}
|
||||
|
||||
private void deleteSubordinateHostAddressSet(
|
||||
DomainResource domain, String additionalHost, Update update) {
|
||||
DomainBase domain, String additionalHost, Update update) {
|
||||
for (String hostName :
|
||||
union(
|
||||
domain.getSubordinateHosts(),
|
||||
|
@ -213,7 +213,7 @@ public class DnsUpdateWriter extends BaseDnsWriter {
|
|||
}
|
||||
}
|
||||
|
||||
private void addInBailiwickNameServerSet(DomainResource domain, Update update) {
|
||||
private void addInBailiwickNameServerSet(DomainBase domain, Update update) {
|
||||
for (String hostName :
|
||||
intersection(
|
||||
domain.loadNameserverFullyQualifiedHostNames(), domain.getSubordinateHosts())) {
|
||||
|
@ -224,7 +224,7 @@ public class DnsUpdateWriter extends BaseDnsWriter {
|
|||
}
|
||||
}
|
||||
|
||||
private RRset makeNameServerSet(DomainResource domain) {
|
||||
private RRset makeNameServerSet(DomainBase domain) {
|
||||
RRset nameServerSet = new RRset();
|
||||
for (String hostName : domain.loadNameserverFullyQualifiedHostNames()) {
|
||||
NSRecord record =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue