diff --git a/core/src/main/java/google/registry/batch/DeleteContactsAndHostsAction.java b/core/src/main/java/google/registry/batch/DeleteContactsAndHostsAction.java index 1e75cde79..54d15cbd5 100644 --- a/core/src/main/java/google/registry/batch/DeleteContactsAndHostsAction.java +++ b/core/src/main/java/google/registry/batch/DeleteContactsAndHostsAction.java @@ -426,7 +426,7 @@ public class DeleteContactsAndHostsAction implements Runnable { if (resource instanceof HostResource) { return ImmutableList.of( HostPendingActionNotificationResponse.create( - ((HostResource) resource).getFullyQualifiedHostName(), deleteAllowed, trid, now)); + ((HostResource) resource).getHostName(), deleteAllowed, trid, now)); } else if (resource instanceof ContactResource) { return ImmutableList.of( ContactPendingActionNotificationResponse.create( @@ -465,11 +465,11 @@ public class DeleteContactsAndHostsAction implements Runnable { } else if (existingResource instanceof HostResource) { HostResource host = (HostResource) existingResource; if (host.isSubordinate()) { - dnsQueue.addHostRefreshTask(host.getFullyQualifiedHostName()); + dnsQueue.addHostRefreshTask(host.getHostName()); tm().saveNewOrUpdate( tm().load(host.getSuperordinateDomain()) .asBuilder() - .removeSubordinateHost(host.getFullyQualifiedHostName()) + .removeSubordinateHost(host.getHostName()) .build()); } } else { diff --git a/core/src/main/java/google/registry/batch/DeleteProberDataAction.java b/core/src/main/java/google/registry/batch/DeleteProberDataAction.java index 6bd1f186b..a963a2078 100644 --- a/core/src/main/java/google/registry/batch/DeleteProberDataAction.java +++ b/core/src/main/java/google/registry/batch/DeleteProberDataAction.java @@ -177,7 +177,7 @@ public class DeleteProberDataAction implements Runnable { return; } - String domainName = domain.getFullyQualifiedDomainName(); + String domainName = domain.getDomainName(); if (domainName.equals("nic." + domain.getTld())) { getContext().incrementCounter("skipped, NIC domain"); return; @@ -265,7 +265,7 @@ public class DeleteProberDataAction implements Runnable { // mapreduce runs anyway. ofy().save().entities(deletedDomain, historyEntry); updateForeignKeyIndexDeletionTime(deletedDomain); - dnsQueue.addDomainRefreshTask(deletedDomain.getFullyQualifiedDomainName()); + dnsQueue.addDomainRefreshTask(deletedDomain.getDomainName()); } ); } diff --git a/core/src/main/java/google/registry/batch/RefreshDnsOnHostRenameAction.java b/core/src/main/java/google/registry/batch/RefreshDnsOnHostRenameAction.java index 2748cc29f..aafa6304e 100644 --- a/core/src/main/java/google/registry/batch/RefreshDnsOnHostRenameAction.java +++ b/core/src/main/java/google/registry/batch/RefreshDnsOnHostRenameAction.java @@ -216,11 +216,11 @@ public class RefreshDnsOnHostRenameAction implements Runnable { } if (referencingHostKey != null) { retrier.callWithRetry( - () -> dnsQueue.addDomainRefreshTask(domain.getFullyQualifiedDomainName()), + () -> dnsQueue.addDomainRefreshTask(domain.getDomainName()), TransientFailureException.class); logger.atInfo().log( "Enqueued DNS refresh for domain %s referenced by host %s.", - domain.getFullyQualifiedDomainName(), referencingHostKey); + domain.getDomainName(), referencingHostKey); getContext().incrementCounter("domains refreshed"); } else { getContext().incrementCounter("domains not refreshed"); diff --git a/core/src/main/java/google/registry/batch/RelockDomainAction.java b/core/src/main/java/google/registry/batch/RelockDomainAction.java index cf7319ea4..3d0a24045 100644 --- a/core/src/main/java/google/registry/batch/RelockDomainAction.java +++ b/core/src/main/java/google/registry/batch/RelockDomainAction.java @@ -96,7 +96,7 @@ public class RelockDomainAction implements Runnable { String message = String.format( "Domain %s is already manually relocked, skipping automated relock.", - domain.getFullyQualifiedDomainName()); + domain.getDomainName()); logger.atInfo().log(message); // SC_NO_CONTENT (204) skips retry -- see the comment below response.setStatus(SC_NO_CONTENT); @@ -144,7 +144,7 @@ public class RelockDomainAction implements Runnable { private void verifyDomainAndLockState(RegistryLock oldLock, DomainBase domain) { // Domain shouldn't be deleted or have a pending transfer/delete - String domainName = domain.getFullyQualifiedDomainName(); + String domainName = domain.getDomainName(); checkArgument( !DateTimeUtils.isAtOrAfter(jpaTm().getTransactionTime(), domain.getDeletionTime()), "Domain %s has been deleted", diff --git a/core/src/main/java/google/registry/dns/DnsQueue.java b/core/src/main/java/google/registry/dns/DnsQueue.java index f2a8ad5e4..26042d662 100644 --- a/core/src/main/java/google/registry/dns/DnsQueue.java +++ b/core/src/main/java/google/registry/dns/DnsQueue.java @@ -119,35 +119,31 @@ public class DnsQueue { .param(PARAM_TLD, tld)); } - /** - * Adds a task to the queue to refresh the DNS information for the specified subordinate host. - */ - public TaskHandle addHostRefreshTask(String fullyQualifiedHostName) { - Optional tld = - Registries.findTldForName(InternetDomainName.from(fullyQualifiedHostName)); - checkArgument(tld.isPresent(), - String.format("%s is not a subordinate host to a known tld", fullyQualifiedHostName)); - return addToQueue(TargetType.HOST, fullyQualifiedHostName, tld.get().toString(), Duration.ZERO); + /** Adds a task to the queue to refresh the DNS information for the specified subordinate host. */ + public TaskHandle addHostRefreshTask(String hostName) { + Optional tld = Registries.findTldForName(InternetDomainName.from(hostName)); + checkArgument( + tld.isPresent(), String.format("%s is not a subordinate host to a known tld", hostName)); + return addToQueue(TargetType.HOST, hostName, tld.get().toString(), Duration.ZERO); } /** Enqueues a task to refresh DNS for the specified domain now. */ - public TaskHandle addDomainRefreshTask(String fullyQualifiedDomainName) { - return addDomainRefreshTask(fullyQualifiedDomainName, Duration.ZERO); + public TaskHandle addDomainRefreshTask(String domainName) { + return addDomainRefreshTask(domainName, Duration.ZERO); } /** Enqueues a task to refresh DNS for the specified domain at some point in the future. */ - public TaskHandle addDomainRefreshTask(String fullyQualifiedDomainName, Duration countdown) { + public TaskHandle addDomainRefreshTask(String domainName, Duration countdown) { return addToQueue( TargetType.DOMAIN, - fullyQualifiedDomainName, - assertTldExists(getTldFromDomainName(fullyQualifiedDomainName)), + domainName, + assertTldExists(getTldFromDomainName(domainName)), countdown); } /** Adds a task to the queue to refresh the DNS information for the specified zone. */ - public TaskHandle addZoneRefreshTask(String fullyQualifiedZoneName) { - return addToQueue( - TargetType.ZONE, fullyQualifiedZoneName, fullyQualifiedZoneName, Duration.ZERO); + public TaskHandle addZoneRefreshTask(String zoneName) { + return addToQueue(TargetType.ZONE, zoneName, zoneName, Duration.ZERO); } /** diff --git a/core/src/main/java/google/registry/dns/RefreshDnsAction.java b/core/src/main/java/google/registry/dns/RefreshDnsAction.java index 3284dd382..a423ed44f 100644 --- a/core/src/main/java/google/registry/dns/RefreshDnsAction.java +++ b/core/src/main/java/google/registry/dns/RefreshDnsAction.java @@ -89,7 +89,7 @@ public final class RefreshDnsAction implements Runnable { private static void verifyHostIsSubordinate(HostResource host) { if (!host.isSubordinate()) { throw new BadRequestException( - String.format("%s isn't a subordinate hostname", host.getFullyQualifiedHostName())); + String.format("%s isn't a subordinate hostname", host.getHostName())); } } } diff --git a/core/src/main/java/google/registry/dns/writer/clouddns/CloudDnsWriter.java b/core/src/main/java/google/registry/dns/writer/clouddns/CloudDnsWriter.java index cc77b6d4e..abc0b0784 100644 --- a/core/src/main/java/google/registry/dns/writer/clouddns/CloudDnsWriter.java +++ b/core/src/main/java/google/registry/dns/writer/clouddns/CloudDnsWriter.java @@ -154,7 +154,7 @@ public class CloudDnsWriter extends BaseDnsWriter { } // Construct NS records (if any). - Set nameserverData = domainBase.get().loadNameserverFullyQualifiedHostNames(); + Set nameserverData = domainBase.get().loadNameserverHostNames(); Set subordinateHosts = domainBase.get().getSubordinateHosts(); if (!nameserverData.isEmpty()) { HashSet nsRrData = new HashSet<>(); diff --git a/core/src/main/java/google/registry/dns/writer/dnsupdate/DnsUpdateWriter.java b/core/src/main/java/google/registry/dns/writer/dnsupdate/DnsUpdateWriter.java index dc885cbe4..354fd964d 100644 --- a/core/src/main/java/google/registry/dns/writer/dnsupdate/DnsUpdateWriter.java +++ b/core/src/main/java/google/registry/dns/writer/dnsupdate/DnsUpdateWriter.java @@ -189,7 +189,7 @@ public class DnsUpdateWriter extends BaseDnsWriter { for (DelegationSignerData signerData : domain.getDsData()) { DSRecord dsRecord = new DSRecord( - toAbsoluteName(domain.getFullyQualifiedDomainName()), + toAbsoluteName(domain.getDomainName()), DClass.IN, dnsDefaultDsTtl.getStandardSeconds(), signerData.getKeyTag(), @@ -216,7 +216,7 @@ public class DnsUpdateWriter extends BaseDnsWriter { private void addInBailiwickNameServerSet(DomainBase domain, Update update) { for (String hostName : intersection( - domain.loadNameserverFullyQualifiedHostNames(), domain.getSubordinateHosts())) { + domain.loadNameserverHostNames(), domain.getSubordinateHosts())) { Optional host = loadByForeignKey(HostResource.class, hostName, clock.nowUtc()); checkState(host.isPresent(), "Host %s cannot be loaded", hostName); update.add(makeAddressSet(host.get())); @@ -226,10 +226,10 @@ public class DnsUpdateWriter extends BaseDnsWriter { private RRset makeNameServerSet(DomainBase domain) { RRset nameServerSet = new RRset(); - for (String hostName : domain.loadNameserverFullyQualifiedHostNames()) { + for (String hostName : domain.loadNameserverHostNames()) { NSRecord record = new NSRecord( - toAbsoluteName(domain.getFullyQualifiedDomainName()), + toAbsoluteName(domain.getDomainName()), DClass.IN, dnsDefaultNsTtl.getStandardSeconds(), toAbsoluteName(hostName)); @@ -244,7 +244,7 @@ public class DnsUpdateWriter extends BaseDnsWriter { if (address instanceof Inet4Address) { ARecord record = new ARecord( - toAbsoluteName(host.getFullyQualifiedHostName()), + toAbsoluteName(host.getHostName()), DClass.IN, dnsDefaultATtl.getStandardSeconds(), address); @@ -260,7 +260,7 @@ public class DnsUpdateWriter extends BaseDnsWriter { if (address instanceof Inet6Address) { AAAARecord record = new AAAARecord( - toAbsoluteName(host.getFullyQualifiedHostName()), + toAbsoluteName(host.getHostName()), DClass.IN, dnsDefaultATtl.getStandardSeconds(), address); diff --git a/core/src/main/java/google/registry/export/ExportDomainListsAction.java b/core/src/main/java/google/registry/export/ExportDomainListsAction.java index 8fc247485..3eb5fcd37 100644 --- a/core/src/main/java/google/registry/export/ExportDomainListsAction.java +++ b/core/src/main/java/google/registry/export/ExportDomainListsAction.java @@ -107,7 +107,7 @@ public class ExportDomainListsAction implements Runnable { @Override public void map(DomainBase domain) { if (realTlds.contains(domain.getTld()) && isActive(domain, exportTime)) { - emit(domain.getTld(), domain.getFullyQualifiedDomainName()); + emit(domain.getTld(), domain.getDomainName()); getContext().incrementCounter(String.format("domains in tld %s", domain.getTld())); } } diff --git a/core/src/main/java/google/registry/flows/domain/DomainCreateFlow.java b/core/src/main/java/google/registry/flows/domain/DomainCreateFlow.java index 40019b615..e701e526d 100644 --- a/core/src/main/java/google/registry/flows/domain/DomainCreateFlow.java +++ b/core/src/main/java/google/registry/flows/domain/DomainCreateFlow.java @@ -354,7 +354,7 @@ public class DomainCreateFlow implements TransactionalFlow { .setDsData(secDnsCreate.isPresent() ? secDnsCreate.get().getDsData() : null) .setRegistrant(command.getRegistrant()) .setAuthInfo(command.getAuthInfo()) - .setFullyQualifiedDomainName(targetId) + .setDomainName(targetId) .setNameservers( (ImmutableSet>) command.getNameservers().stream().collect(toImmutableSet())) @@ -598,7 +598,7 @@ public class DomainCreateFlow implements TransactionalFlow { private void enqueueTasks( DomainBase newDomain, boolean hasSignedMarks, boolean hasClaimsNotice) { if (newDomain.shouldPublishToDns()) { - dnsQueue.addDomainRefreshTask(newDomain.getFullyQualifiedDomainName()); + dnsQueue.addDomainRefreshTask(newDomain.getDomainName()); } if (hasClaimsNotice || hasSignedMarks) { LordnTaskUtils.enqueueDomainBaseTask(newDomain); diff --git a/core/src/main/java/google/registry/flows/domain/DomainDeleteFlow.java b/core/src/main/java/google/registry/flows/domain/DomainDeleteFlow.java index 5f4375d94..c48e410c2 100644 --- a/core/src/main/java/google/registry/flows/domain/DomainDeleteFlow.java +++ b/core/src/main/java/google/registry/flows/domain/DomainDeleteFlow.java @@ -242,7 +242,7 @@ public final class DomainDeleteFlow implements TransactionalFlow { // If there's a pending transfer, the gaining client's autorenew billing // event and poll message will already have been deleted in // ResourceDeleteFlow since it's listed in serverApproveEntities. - dnsQueue.addDomainRefreshTask(existingDomain.getFullyQualifiedDomainName()); + dnsQueue.addDomainRefreshTask(existingDomain.getDomainName()); entitiesToSave.add(newDomain, historyEntry); EntityChanges entityChanges = flowCustomLogic.beforeSave( @@ -339,7 +339,7 @@ public final class DomainDeleteFlow implements TransactionalFlow { .setResponseData( ImmutableList.of( DomainPendingActionNotificationResponse.create( - existingDomain.getFullyQualifiedDomainName(), true, trid, deletionTime))) + existingDomain.getDomainName(), true, trid, deletionTime))) .setParent(historyEntry) .build(); } diff --git a/core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java b/core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java index 5c8048264..744c5c528 100644 --- a/core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java +++ b/core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java @@ -489,7 +489,7 @@ public class DomainFlowUtils { return new BillingEvent.Recurring.Builder() .setReason(Reason.RENEW) .setFlags(ImmutableSet.of(Flag.AUTO_RENEW)) - .setTargetId(domain.getFullyQualifiedDomainName()) + .setTargetId(domain.getDomainName()) .setClientId(domain.getCurrentSponsorClientId()) .setEventTime(domain.getRegistrationExpirationTime()); } @@ -500,7 +500,7 @@ public class DomainFlowUtils { */ public static PollMessage.Autorenew.Builder newAutorenewPollMessage(DomainBase domain) { return new PollMessage.Autorenew.Builder() - .setTargetId(domain.getFullyQualifiedDomainName()) + .setTargetId(domain.getDomainName()) .setClientId(domain.getCurrentSponsorClientId()) .setEventTime(domain.getRegistrationExpirationTime()) .setMsg("Domain was auto-renewed."); diff --git a/core/src/main/java/google/registry/flows/domain/DomainInfoFlow.java b/core/src/main/java/google/registry/flows/domain/DomainInfoFlow.java index ba1719400..65cce4904 100644 --- a/core/src/main/java/google/registry/flows/domain/DomainInfoFlow.java +++ b/core/src/main/java/google/registry/flows/domain/DomainInfoFlow.java @@ -107,7 +107,7 @@ public final class DomainInfoFlow implements Flow { // This is a policy decision that is left up to us by the rfcs. DomainInfoData.Builder infoBuilder = DomainInfoData.newBuilder() - .setFullyQualifiedDomainName(domain.getFullyQualifiedDomainName()) + .setFullyQualifiedDomainName(domain.getDomainName()) .setRepoId(domain.getRepoId()) .setCurrentSponsorClientId(domain.getCurrentSponsorClientId()) .setRegistrant(tm().load(domain.getRegistrant()).getContactId()); @@ -119,7 +119,7 @@ public final class DomainInfoFlow implements Flow { .setStatusValues(domain.getStatusValues()) .setContacts(loadForeignKeyedDesignatedContacts(domain.getContacts())) .setNameservers(hostsRequest.requestDelegated() - ? domain.loadNameserverFullyQualifiedHostNames() + ? domain.loadNameserverHostNames() : null) .setSubordinateHosts(hostsRequest.requestSubordinate() ? domain.getSubordinateHosts() diff --git a/core/src/main/java/google/registry/flows/domain/DomainRestoreRequestFlow.java b/core/src/main/java/google/registry/flows/domain/DomainRestoreRequestFlow.java index 8e6fa7fad..e6b3a5050 100644 --- a/core/src/main/java/google/registry/flows/domain/DomainRestoreRequestFlow.java +++ b/core/src/main/java/google/registry/flows/domain/DomainRestoreRequestFlow.java @@ -174,7 +174,7 @@ public final class DomainRestoreRequestFlow implements TransactionalFlow { entitiesToSave.add(newDomain, historyEntry, autorenewEvent, autorenewPollMessage); ofy().save().entities(entitiesToSave.build()); ofy().delete().key(existingDomain.getDeletePollMessage()); - dnsQueue.addDomainRefreshTask(existingDomain.getFullyQualifiedDomainName()); + dnsQueue.addDomainRefreshTask(existingDomain.getDomainName()); return responseBuilder .setExtensions(createResponseExtensions(feesAndCredits, feeUpdate)) .build(); diff --git a/core/src/main/java/google/registry/flows/domain/DomainTransferUtils.java b/core/src/main/java/google/registry/flows/domain/DomainTransferUtils.java index 22af4cadd..c1e935a22 100644 --- a/core/src/main/java/google/registry/flows/domain/DomainTransferUtils.java +++ b/core/src/main/java/google/registry/flows/domain/DomainTransferUtils.java @@ -109,7 +109,7 @@ public final class DomainTransferUtils { String gainingClientId, Optional transferCost, DateTime now) { - String targetId = existingDomain.getFullyQualifiedDomainName(); + String targetId = existingDomain.getDomainName(); // Create a TransferData for the server-approve case to use for the speculative poll messages. DomainTransferData serverApproveTransferData = new DomainTransferData.Builder() diff --git a/core/src/main/java/google/registry/flows/domain/DomainUpdateFlow.java b/core/src/main/java/google/registry/flows/domain/DomainUpdateFlow.java index fd43d9f7c..3b4a78c62 100644 --- a/core/src/main/java/google/registry/flows/domain/DomainUpdateFlow.java +++ b/core/src/main/java/google/registry/flows/domain/DomainUpdateFlow.java @@ -265,7 +265,7 @@ public final class DomainUpdateFlow implements TransactionalFlow { validateDsData(newDomain.getDsData()); validateNameserversCountForTld( newDomain.getTld(), - InternetDomainName.from(newDomain.getFullyQualifiedDomainName()), + InternetDomainName.from(newDomain.getDomainName()), newDomain.getNameservers().size()); } diff --git a/core/src/main/java/google/registry/flows/host/HostCreateFlow.java b/core/src/main/java/google/registry/flows/host/HostCreateFlow.java index 5e5b919dd..548950d6b 100644 --- a/core/src/main/java/google/registry/flows/host/HostCreateFlow.java +++ b/core/src/main/java/google/registry/flows/host/HostCreateFlow.java @@ -125,7 +125,7 @@ public final class HostCreateFlow implements TransactionalFlow { new HostResource.Builder() .setCreationClientId(clientId) .setPersistedCurrentSponsorClientId(clientId) - .setFullyQualifiedHostName(targetId) + .setHostName(targetId) .setInetAddresses(command.getInetAddresses()) .setRepoId(createRepoId(ObjectifyService.allocateId(), roidSuffix)) .setSuperordinateDomain(superordinateDomain.map(DomainBase::createVKey).orElse(null)) diff --git a/core/src/main/java/google/registry/flows/host/HostInfoFlow.java b/core/src/main/java/google/registry/flows/host/HostInfoFlow.java index cd9525118..ca801ae2c 100644 --- a/core/src/main/java/google/registry/flows/host/HostInfoFlow.java +++ b/core/src/main/java/google/registry/flows/host/HostInfoFlow.java @@ -91,7 +91,7 @@ public final class HostInfoFlow implements Flow { } return responseBuilder .setResData(hostInfoDataBuilder - .setFullyQualifiedHostName(host.getFullyQualifiedHostName()) + .setFullyQualifiedHostName(host.getHostName()) .setRepoId(host.getRepoId()) .setStatusValues(statusValues.build()) .setInetAddresses(host.getInetAddresses()) diff --git a/core/src/main/java/google/registry/flows/host/HostUpdateFlow.java b/core/src/main/java/google/registry/flows/host/HostUpdateFlow.java index fa0d110b6..744677bb0 100644 --- a/core/src/main/java/google/registry/flows/host/HostUpdateFlow.java +++ b/core/src/main/java/google/registry/flows/host/HostUpdateFlow.java @@ -176,7 +176,7 @@ public final class HostUpdateFlow implements TransactionalFlow { ? newSuperordinateDomain.get().getCurrentSponsorClientId() : owningResource.getPersistedCurrentSponsorClientId(); HostResource newHost = existingHost.asBuilder() - .setFullyQualifiedHostName(newHostName) + .setHostName(newHostName) .addStatusValues(add.getStatusValues()) .removeStatusValues(remove.getStatusValues()) .addInetAddresses(add.getInetAddresses()) @@ -263,14 +263,14 @@ public final class HostUpdateFlow implements TransactionalFlow { // Only update DNS for subordinate hosts. External hosts have no glue to write, so they // are only written as NS records from the referencing domain. if (existingHost.isSubordinate()) { - dnsQueue.addHostRefreshTask(existingHost.getFullyQualifiedHostName()); + dnsQueue.addHostRefreshTask(existingHost.getHostName()); } // In case of a rename, there are many updates we need to queue up. if (((Update) resourceCommand).getInnerChange().getFullyQualifiedHostName() != null) { // If the renamed host is also subordinate, then we must enqueue an update to write the new // glue. if (newHost.isSubordinate()) { - dnsQueue.addHostRefreshTask(newHost.getFullyQualifiedHostName()); + dnsQueue.addHostRefreshTask(newHost.getHostName()); } // We must also enqueue updates for all domains that use this host as their nameserver so // that their NS records can be updated to point at the new name. @@ -286,8 +286,8 @@ public final class HostUpdateFlow implements TransactionalFlow { tm().saveNewOrUpdate( tm().load(existingHost.getSuperordinateDomain()) .asBuilder() - .removeSubordinateHost(existingHost.getFullyQualifiedHostName()) - .addSubordinateHost(newHost.getFullyQualifiedHostName()) + .removeSubordinateHost(existingHost.getHostName()) + .addSubordinateHost(newHost.getHostName()) .build()); return; } @@ -295,14 +295,14 @@ public final class HostUpdateFlow implements TransactionalFlow { tm().saveNewOrUpdate( tm().load(existingHost.getSuperordinateDomain()) .asBuilder() - .removeSubordinateHost(existingHost.getFullyQualifiedHostName()) + .removeSubordinateHost(existingHost.getHostName()) .build()); } if (newHost.isSubordinate()) { tm().saveNewOrUpdate( tm().load(newHost.getSuperordinateDomain()) .asBuilder() - .addSubordinateHost(newHost.getFullyQualifiedHostName()) + .addSubordinateHost(newHost.getHostName()) .build()); } } diff --git a/core/src/main/java/google/registry/model/domain/DomainBase.java b/core/src/main/java/google/registry/model/domain/DomainBase.java index cb40f4ee2..0ca4bf542 100644 --- a/core/src/main/java/google/registry/model/domain/DomainBase.java +++ b/core/src/main/java/google/registry/model/domain/DomainBase.java @@ -106,7 +106,7 @@ import org.joda.time.Interval; @javax.persistence.Index(columnList = "creationTime"), @javax.persistence.Index(columnList = "currentSponsorRegistrarId"), @javax.persistence.Index(columnList = "deletionTime"), - @javax.persistence.Index(columnList = "fullyQualifiedDomainName"), + @javax.persistence.Index(columnList = "domainName"), @javax.persistence.Index(columnList = "tld") }) @WithStringVKey @@ -137,6 +137,8 @@ public class DomainBase extends EppResource * * @invariant fullyQualifiedDomainName == fullyQualifiedDomainName.toLowerCase(Locale.ENGLISH) */ + // TODO(b/158858642): Rename this to domainName when we are off Datastore + @Column(name = "domainName") @Index String fullyQualifiedDomainName; /** The top level domain this is under, dernormalized from {@link #fullyQualifiedDomainName}. */ @@ -348,7 +350,7 @@ public class DomainBase extends EppResource return fullyQualifiedDomainName; } - public String getFullyQualifiedDomainName() { + public String getDomainName() { return fullyQualifiedDomainName; } @@ -552,13 +554,13 @@ public class DomainBase extends EppResource } /** Loads and returns the fully qualified host names of all linked nameservers. */ - public ImmutableSortedSet loadNameserverFullyQualifiedHostNames() { + public ImmutableSortedSet loadNameserverHostNames() { return ofy() .load() .keys(getNameservers().stream().map(VKey::getOfyKey).collect(toImmutableSet())) .values() .stream() - .map(HostResource::getFullyQualifiedHostName) + .map(HostResource::getHostName) .collect(toImmutableSortedSet(Ordering.natural())); } @@ -679,7 +681,7 @@ public class DomainBase extends EppResource } checkArgumentNotNull( - emptyToNull(instance.fullyQualifiedDomainName), "Missing fullyQualifiedDomainName"); + emptyToNull(instance.fullyQualifiedDomainName), "Missing domainName"); if (instance.getRegistrant() == null && instance.allContacts.stream().anyMatch(IS_REGISTRANT)) { throw new IllegalArgumentException("registrant is null but is in allContacts"); @@ -689,11 +691,11 @@ public class DomainBase extends EppResource return super.build(); } - public Builder setFullyQualifiedDomainName(String fullyQualifiedDomainName) { + public Builder setDomainName(String domainName) { checkArgument( - fullyQualifiedDomainName.equals(canonicalizeDomainName(fullyQualifiedDomainName)), + domainName.equals(canonicalizeDomainName(domainName)), "Domain name must be in puny-coded, lower-case form"); - getInstance().fullyQualifiedDomainName = fullyQualifiedDomainName; + getInstance().fullyQualifiedDomainName = domainName; return thisCastToDerived(); } diff --git a/core/src/main/java/google/registry/model/host/HostBase.java b/core/src/main/java/google/registry/model/host/HostBase.java index ab4f4d2cb..6dae739a6 100644 --- a/core/src/main/java/google/registry/model/host/HostBase.java +++ b/core/src/main/java/google/registry/model/host/HostBase.java @@ -36,6 +36,7 @@ import java.util.Set; import javax.annotation.Nullable; import javax.persistence.Access; import javax.persistence.AccessType; +import javax.persistence.Column; import javax.persistence.Embeddable; import javax.persistence.MappedSuperclass; import org.joda.time.DateTime; @@ -64,7 +65,10 @@ public class HostBase extends EppResource { * from (creationTime, deletionTime) there can only be one host in Datastore with this name. * However, there can be many hosts with the same name and non-overlapping lifetimes. */ - @Index String fullyQualifiedHostName; + // TODO(b/158858642): Rename this to hostName when we are off Datastore + @Index + @Column(name = "hostName") + String fullyQualifiedHostName; /** IP Addresses for this host. Can be null if this is an external host. */ @Index Set inetAddresses; @@ -91,7 +95,7 @@ public class HostBase extends EppResource { */ DateTime lastSuperordinateChange; - public String getFullyQualifiedHostName() { + public String getHostName() { return fullyQualifiedHostName; } @@ -188,11 +192,11 @@ public class HostBase extends EppResource { return super.build(); } - public B setFullyQualifiedHostName(String fullyQualifiedHostName) { + public B setHostName(String hostName) { checkArgument( - fullyQualifiedHostName.equals(canonicalizeDomainName(fullyQualifiedHostName)), + hostName.equals(canonicalizeDomainName(hostName)), "Host name must be in puny-coded, lower-case form"); - getInstance().fullyQualifiedHostName = fullyQualifiedHostName; + getInstance().fullyQualifiedHostName = hostName; return thisCastToDerived(); } diff --git a/core/src/main/java/google/registry/model/host/HostHistory.java b/core/src/main/java/google/registry/model/host/HostHistory.java index 79bfead6d..b21082c4d 100644 --- a/core/src/main/java/google/registry/model/host/HostHistory.java +++ b/core/src/main/java/google/registry/model/host/HostHistory.java @@ -33,7 +33,7 @@ import javax.persistence.Entity; indexes = { @javax.persistence.Index(columnList = "creationTime"), @javax.persistence.Index(columnList = "historyRegistrarId"), - @javax.persistence.Index(columnList = "fullyQualifiedHostName"), + @javax.persistence.Index(columnList = "hostName"), @javax.persistence.Index(columnList = "historyType"), @javax.persistence.Index(columnList = "historyModificationTime") }) diff --git a/core/src/main/java/google/registry/rdap/RdapDomainSearchAction.java b/core/src/main/java/google/registry/rdap/RdapDomainSearchAction.java index 5f917a67e..5650e3e84 100644 --- a/core/src/main/java/google/registry/rdap/RdapDomainSearchAction.java +++ b/core/src/main/java/google/registry/rdap/RdapDomainSearchAction.java @@ -425,7 +425,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase { // order. ImmutableSortedSet.Builder domainSetBuilder = ImmutableSortedSet.orderedBy( - Comparator.comparing(DomainBase::getFullyQualifiedDomainName)); + Comparator.comparing(DomainBase::getDomainName)); int numHostKeysSearched = 0; for (List> chunk : Iterables.partition(hostKeys, 30)) { numHostKeysSearched += chunk.size(); @@ -445,7 +445,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase { if (cursorString.isPresent()) { stream = stream.filter( - domain -> (domain.getFullyQualifiedDomainName().compareTo(cursorString.get()) > 0)); + domain -> (domain.getDomainName().compareTo(cursorString.get()) > 0)); } stream.forEach(domainSetBuilder::add); } @@ -495,7 +495,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase { .setIncompletenessWarningType(incompletenessWarningType); Optional newCursor = Optional.empty(); for (DomainBase domain : Iterables.limit(domains, rdapResultSetMaxSize)) { - newCursor = Optional.of(domain.getFullyQualifiedDomainName()); + newCursor = Optional.of(domain.getDomainName()); builder .domainSearchResultsBuilder() .add(rdapJsonFormatter.createRdapDomain(domain, outputDataType)); diff --git a/core/src/main/java/google/registry/rdap/RdapJsonFormatter.java b/core/src/main/java/google/registry/rdap/RdapJsonFormatter.java index 7d7b5db47..bbc2a5f3a 100644 --- a/core/src/main/java/google/registry/rdap/RdapJsonFormatter.java +++ b/core/src/main/java/google/registry/rdap/RdapJsonFormatter.java @@ -221,7 +221,7 @@ public class RdapJsonFormatter { /** Sets the ordering for hosts; just use the fully qualified host name. */ private static final Ordering HOST_RESOURCE_ORDERING = - Ordering.natural().onResultOf(HostResource::getFullyQualifiedHostName); + Ordering.natural().onResultOf(HostResource::getHostName); /** Sets the ordering for designated contacts; order them in a fixed order by contact type. */ private static final Ordering DESIGNATED_CONTACT_ORDERING = @@ -266,12 +266,12 @@ public class RdapJsonFormatter { */ RdapDomain createRdapDomain(DomainBase domainBase, OutputDataType outputDataType) { RdapDomain.Builder builder = RdapDomain.builder(); - builder.linksBuilder().add(makeSelfLink("domain", domainBase.getFullyQualifiedDomainName())); + builder.linksBuilder().add(makeSelfLink("domain", domainBase.getDomainName())); if (outputDataType != OutputDataType.FULL) { builder.remarksBuilder().add(RdapIcannStandardInformation.SUMMARY_DATA_REMARK); } // RDAP Response Profile 15feb19 section 2.1 discusses the domain name. - builder.setLdhName(domainBase.getFullyQualifiedDomainName()); + builder.setLdhName(domainBase.getDomainName()); // RDAP Response Profile 15feb19 section 2.2: // The domain handle MUST be the ROID builder.setHandle(domainBase.getRepoId()); @@ -315,7 +315,7 @@ public class RdapJsonFormatter { for (String registrarRdapBase : registrar.getRdapBaseUrls()) { String href = makeServerRelativeUrl( - registrarRdapBase, "domain", domainBase.getFullyQualifiedDomainName()); + registrarRdapBase, "domain", domainBase.getDomainName()); builder .linksBuilder() .add( @@ -336,7 +336,7 @@ public class RdapJsonFormatter { if (status.isEmpty()) { logger.atWarning().log( "Domain %s (ROID %s) doesn't have any status", - domainBase.getFullyQualifiedDomainName(), domainBase.getRepoId()); + domainBase.getDomainName(), domainBase.getRepoId()); } // RDAP Response Profile 2.6.3, must have a notice about statuses. That is in {@link // RdapIcannStandardInformation#domainBoilerplateNotices} @@ -411,13 +411,13 @@ public class RdapJsonFormatter { RdapNameserver.Builder builder = RdapNameserver.builder(); builder .linksBuilder() - .add(makeSelfLink("nameserver", hostResource.getFullyQualifiedHostName())); + .add(makeSelfLink("nameserver", hostResource.getHostName())); if (outputDataType != OutputDataType.FULL) { builder.remarksBuilder().add(RdapIcannStandardInformation.SUMMARY_DATA_REMARK); } // We need the ldhName: RDAP Response Profile 2.9.1, 4.1 - builder.setLdhName(hostResource.getFullyQualifiedHostName()); + builder.setLdhName(hostResource.getHostName()); // Handle is optional, but if given it MUST be the ROID. // We will set it always as it's important as a "self link" builder.setHandle(hostResource.getRepoId()); diff --git a/core/src/main/java/google/registry/rdap/RdapNameserverSearchAction.java b/core/src/main/java/google/registry/rdap/RdapNameserverSearchAction.java index 62ad67532..519e9f3e2 100644 --- a/core/src/main/java/google/registry/rdap/RdapNameserverSearchAction.java +++ b/core/src/main/java/google/registry/rdap/RdapNameserverSearchAction.java @@ -271,7 +271,7 @@ public class RdapNameserverSearchAction extends RdapSearchActionBase { newCursor = Optional.of( (cursorType == CursorType.NAME) - ? host.getFullyQualifiedHostName() + ? host.getHostName() : host.getRepoId()); builder .nameserverSearchResultsBuilder() diff --git a/core/src/main/java/google/registry/rde/DomainBaseToXjcConverter.java b/core/src/main/java/google/registry/rde/DomainBaseToXjcConverter.java index def9708e8..d80ae84db 100644 --- a/core/src/main/java/google/registry/rde/DomainBaseToXjcConverter.java +++ b/core/src/main/java/google/registry/rde/DomainBaseToXjcConverter.java @@ -62,7 +62,7 @@ final class DomainBaseToXjcConverter { // o A element that contains the fully qualified name of the // domain name object. - bean.setName(model.getFullyQualifiedDomainName()); + bean.setName(model.getDomainName()); // o A element that contains the repository object identifier // assigned to the domain name object when it was created. @@ -70,7 +70,7 @@ final class DomainBaseToXjcConverter { // o An OPTIONAL element that contains the name of the domain // name in Unicode character set. It MUST be provided if available. - bean.setUName(Idn.toUnicode(model.getFullyQualifiedDomainName())); + bean.setUName(Idn.toUnicode(model.getDomainName())); // o An OPTIONAL element that references the IDN Table // used for the IDN. This corresponds to the "id" attribute of the @@ -143,7 +143,7 @@ final class DomainBaseToXjcConverter { // it is that with host attributes, you inline the nameserver data // on each domain; with host objects, you normalize the nameserver // data to a separate EPP object. - ImmutableSet linkedNameserverHostNames = model.loadNameserverFullyQualifiedHostNames(); + ImmutableSet linkedNameserverHostNames = model.loadNameserverHostNames(); if (!linkedNameserverHostNames.isEmpty()) { XjcDomainNsType nameservers = new XjcDomainNsType(); for (String hostName : linkedNameserverHostNames) { @@ -154,7 +154,7 @@ final class DomainBaseToXjcConverter { switch (mode) { case FULL: - String domainName = model.getFullyQualifiedDomainName(); + String domainName = model.getDomainName(); // o Zero or more OPTIONAL element to represent // "pendingDelete" sub-statuses, including "redemptionPeriod", diff --git a/core/src/main/java/google/registry/rde/HostResourceToXjcConverter.java b/core/src/main/java/google/registry/rde/HostResourceToXjcConverter.java index 2bd6b17e5..759454e61 100644 --- a/core/src/main/java/google/registry/rde/HostResourceToXjcConverter.java +++ b/core/src/main/java/google/registry/rde/HostResourceToXjcConverter.java @@ -68,7 +68,7 @@ final class HostResourceToXjcConverter { private static XjcRdeHost convertHostCommon( HostResource model, String clientId, DateTime lastTransferTime) { XjcRdeHost bean = new XjcRdeHost(); - bean.setName(model.getFullyQualifiedHostName()); + bean.setName(model.getHostName()); bean.setRoid(model.getRepoId()); bean.setCrDate(model.getCreationTime()); bean.setUpDate(model.getLastEppUpdateTime()); diff --git a/core/src/main/java/google/registry/tmch/LordnTaskUtils.java b/core/src/main/java/google/registry/tmch/LordnTaskUtils.java index 8d3450bdc..1e33eaf3c 100644 --- a/core/src/main/java/google/registry/tmch/LordnTaskUtils.java +++ b/core/src/main/java/google/registry/tmch/LordnTaskUtils.java @@ -69,7 +69,7 @@ public final class LordnTaskUtils { return Joiner.on(',') .join( domain.getRepoId(), - domain.getFullyQualifiedDomainName(), + domain.getDomainName(), domain.getSmdId(), getIanaIdentifier(domain.getCreationClientId()), transactionTime); // Used as creation time. @@ -80,7 +80,7 @@ public final class LordnTaskUtils { return Joiner.on(',') .join( domain.getRepoId(), - domain.getFullyQualifiedDomainName(), + domain.getDomainName(), domain.getLaunchNotice().getNoticeId().getTcnId(), getIanaIdentifier(domain.getCreationClientId()), transactionTime, // Used as creation time. diff --git a/core/src/main/java/google/registry/tools/DomainLockUtils.java b/core/src/main/java/google/registry/tools/DomainLockUtils.java index abb8ca794..ab5f8054f 100644 --- a/core/src/main/java/google/registry/tools/DomainLockUtils.java +++ b/core/src/main/java/google/registry/tools/DomainLockUtils.java @@ -293,14 +293,14 @@ public final class DomainLockUtils { checkArgument( !domainBase.getStatusValues().containsAll(REGISTRY_LOCK_STATUSES), "Domain %s is already locked", - domainBase.getFullyQualifiedDomainName()); + domainBase.getDomainName()); } private static void verifyDomainLocked(DomainBase domainBase) { checkArgument( !Sets.intersection(domainBase.getStatusValues(), REGISTRY_LOCK_STATUSES).isEmpty(), "Domain %s is already unlocked", - domainBase.getFullyQualifiedDomainName()); + domainBase.getDomainName()); } private static DomainBase getDomain(String domainName, DateTime now) { diff --git a/core/src/main/java/google/registry/tools/GenerateDnsReportCommand.java b/core/src/main/java/google/registry/tools/GenerateDnsReportCommand.java index 8f13ff65c..c28334bf4 100644 --- a/core/src/main/java/google/registry/tools/GenerateDnsReportCommand.java +++ b/core/src/main/java/google/registry/tools/GenerateDnsReportCommand.java @@ -95,7 +95,7 @@ final class GenerateDnsReportCommand implements CommandWithRemoteApi { private void write(DomainBase domain) { ImmutableList nameservers = - ImmutableList.sortedCopyOf(domain.loadNameserverFullyQualifiedHostNames()); + ImmutableList.sortedCopyOf(domain.loadNameserverHostNames()); ImmutableList> dsData = domain .getDsData() @@ -109,7 +109,7 @@ final class GenerateDnsReportCommand implements CommandWithRemoteApi { "digest", base16().encode(dsData1.getDigest()))) .collect(toImmutableList()); ImmutableMap.Builder mapBuilder = new ImmutableMap.Builder<>(); - mapBuilder.put("domain", domain.getFullyQualifiedDomainName()); + mapBuilder.put("domain", domain.getDomainName()); if (!nameservers.isEmpty()) { mapBuilder.put("nameservers", nameservers); } @@ -128,7 +128,7 @@ final class GenerateDnsReportCommand implements CommandWithRemoteApi { .sorted() .collect(toImmutableList()); ImmutableMap map = ImmutableMap.of( - "host", nameserver.getFullyQualifiedHostName(), + "host", nameserver.getHostName(), "ips", ipAddresses); writeJson(map); } diff --git a/core/src/main/java/google/registry/tools/GenerateLordnCommand.java b/core/src/main/java/google/registry/tools/GenerateLordnCommand.java index ec8bbbfcb..9ec7a60c1 100644 --- a/core/src/main/java/google/registry/tools/GenerateLordnCommand.java +++ b/core/src/main/java/google/registry/tools/GenerateLordnCommand.java @@ -67,7 +67,7 @@ final class GenerateLordnCommand implements CommandWithRemoteApi { claimsCsv.add(LordnTaskUtils.getCsvLineForClaimsDomain(domain, domain.getCreationTime())); status = "C"; } - System.out.printf("%s[%s] ", domain.getFullyQualifiedDomainName(), status); + System.out.printf("%s[%s] ", domain.getDomainName(), status); } ImmutableList claimsRows = claimsCsv.build(); ImmutableList claimsAll = diff --git a/core/src/main/java/google/registry/tools/GetAllocationTokenCommand.java b/core/src/main/java/google/registry/tools/GetAllocationTokenCommand.java index 8ef5a4640..4ed94bb04 100644 --- a/core/src/main/java/google/registry/tools/GetAllocationTokenCommand.java +++ b/core/src/main/java/google/registry/tools/GetAllocationTokenCommand.java @@ -65,7 +65,7 @@ final class GetAllocationTokenCommand implements CommandWithRemoteApi { } else { System.out.printf( "Token %s was redeemed to create domain %s at %s.\n", - token, domain.getFullyQualifiedDomainName(), domain.getCreationTime()); + token, domain.getDomainName(), domain.getCreationTime()); } } } else { diff --git a/core/src/main/java/google/registry/tools/RenewDomainCommand.java b/core/src/main/java/google/registry/tools/RenewDomainCommand.java index 7f820d210..d5be98810 100644 --- a/core/src/main/java/google/registry/tools/RenewDomainCommand.java +++ b/core/src/main/java/google/registry/tools/RenewDomainCommand.java @@ -73,7 +73,7 @@ final class RenewDomainCommand extends MutatingEppToolCommand { addSoyRecord( isNullOrEmpty(clientId) ? domain.getCurrentSponsorClientId() : clientId, new SoyMapData( - "domainName", domain.getFullyQualifiedDomainName(), + "domainName", domain.getDomainName(), "expirationDate", domain.getRegistrationExpirationTime().toString(DATE_FORMATTER), "period", String.valueOf(period))); } diff --git a/core/src/main/java/google/registry/tools/UpdateDomainCommand.java b/core/src/main/java/google/registry/tools/UpdateDomainCommand.java index e134d2a54..c2cd0be06 100644 --- a/core/src/main/java/google/registry/tools/UpdateDomainCommand.java +++ b/core/src/main/java/google/registry/tools/UpdateDomainCommand.java @@ -184,7 +184,7 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand { domain); if (!nameservers.isEmpty()) { ImmutableSortedSet existingNameservers = - domainBase.loadNameserverFullyQualifiedHostNames(); + domainBase.loadNameserverHostNames(); populateAddRemoveLists( ImmutableSet.copyOf(nameservers), existingNameservers, diff --git a/core/src/main/java/google/registry/tools/javascrap/BackfillRegistryLocksCommand.java b/core/src/main/java/google/registry/tools/javascrap/BackfillRegistryLocksCommand.java index 2a56a9de6..05632951d 100644 --- a/core/src/main/java/google/registry/tools/javascrap/BackfillRegistryLocksCommand.java +++ b/core/src/main/java/google/registry/tools/javascrap/BackfillRegistryLocksCommand.java @@ -84,7 +84,7 @@ public class BackfillRegistryLocksCommand extends ConfirmingCommand jpaTm().transact(() -> getLockedDomainsWithoutLocks(jpaTm().getTransactionTime())); ImmutableList lockedDomainNames = lockedDomains.stream() - .map(DomainBase::getFullyQualifiedDomainName) + .map(DomainBase::getDomainName) .collect(toImmutableList()); return String.format( "Locked domains for which there does not exist a RegistryLock object: %s", @@ -104,7 +104,7 @@ public class BackfillRegistryLocksCommand extends ConfirmingCommand .isSuperuser(true) .setRegistrarId(registryAdminClientId) .setRepoId(domainBase.getRepoId()) - .setDomainName(domainBase.getFullyQualifiedDomainName()) + .setDomainName(domainBase.getDomainName()) .setLockCompletionTimestamp( getLockCompletionTimestamp(domainBase, jpaTm().getTransactionTime())) .setVerificationCode( @@ -113,7 +113,7 @@ public class BackfillRegistryLocksCommand extends ConfirmingCommand } catch (Throwable t) { logger.atSevere().withCause(t).log( "Error when creating lock object for domain %s.", - domainBase.getFullyQualifiedDomainName()); + domainBase.getDomainName()); failedDomainsBuilder.add(domainBase); } } diff --git a/core/src/main/java/google/registry/tools/javascrap/RemoveIpAddressCommand.java b/core/src/main/java/google/registry/tools/javascrap/RemoveIpAddressCommand.java index a5c351b49..6df5b22eb 100644 --- a/core/src/main/java/google/registry/tools/javascrap/RemoveIpAddressCommand.java +++ b/core/src/main/java/google/registry/tools/javascrap/RemoveIpAddressCommand.java @@ -74,7 +74,7 @@ public class RemoveIpAddressCommand extends MutatingEppToolCommand { setSoyTemplate( RemoveIpAddressSoyInfo.getInstance(), RemoveIpAddressSoyInfo.REMOVE_IP_ADDRESS); addSoyRecord(registrarId, new SoyMapData( - "name", host.getFullyQualifiedHostName(), + "name", host.getHostName(), "ipAddresses", ipAddresses, "requestedByRegistrar", registrarId)); } diff --git a/core/src/main/java/google/registry/tools/server/GenerateZoneFilesAction.java b/core/src/main/java/google/registry/tools/server/GenerateZoneFilesAction.java index a2dfab85c..d70dd8518 100644 --- a/core/src/main/java/google/registry/tools/server/GenerateZoneFilesAction.java +++ b/core/src/main/java/google/registry/tools/server/GenerateZoneFilesAction.java @@ -217,7 +217,7 @@ public class GenerateZoneFilesAction implements Runnable, JsonActionRunner.JsonA for (HostResource unprojectedHost : tm().load(domain.getNameservers())) { HostResource host = loadAtPointInTime(unprojectedHost, exportTime).now(); // A null means the host was deleted (or not created) at this time. - if ((host != null) && subordinateHosts.contains(host.getFullyQualifiedHostName())) { + if ((host != null) && subordinateHosts.contains(host.getHostName())) { String stanza = hostStanza(host, dnsDefaultATtl, domain.getTld()); if (!stanza.isEmpty()) { emit(domain.getTld(), stanza); @@ -282,14 +282,14 @@ public class GenerateZoneFilesAction implements Runnable, JsonActionRunner.JsonA Duration dnsDefaultNsTtl, Duration dnsDefaultDsTtl) { StringBuilder result = new StringBuilder(); - String domainLabel = stripTld(domain.getFullyQualifiedDomainName(), domain.getTld()); + String domainLabel = stripTld(domain.getDomainName(), domain.getTld()); for (HostResource nameserver : tm().load(domain.getNameservers())) { result.append(String.format( NS_FORMAT, domainLabel, dnsDefaultNsTtl.getStandardSeconds(), // Load the nameservers at the export time in case they've been renamed or deleted. - loadAtPointInTime(nameserver, exportTime).now().getFullyQualifiedHostName())); + loadAtPointInTime(nameserver, exportTime).now().getHostName())); } for (DelegationSignerData dsData : domain.getDsData()) { result.append( @@ -321,7 +321,7 @@ public class GenerateZoneFilesAction implements Runnable, JsonActionRunner.JsonA String rrSetClass = (addr instanceof Inet4Address) ? "A" : "AAAA"; result.append(String.format( A_FORMAT, - stripTld(host.getFullyQualifiedHostName(), tld), + stripTld(host.getHostName(), tld), dnsDefaultATtl.getStandardSeconds(), rrSetClass, addr.getHostAddress())); diff --git a/core/src/main/java/google/registry/tools/server/ListHostsAction.java b/core/src/main/java/google/registry/tools/server/ListHostsAction.java index 2b589619e..cab007ca1 100644 --- a/core/src/main/java/google/registry/tools/server/ListHostsAction.java +++ b/core/src/main/java/google/registry/tools/server/ListHostsAction.java @@ -53,6 +53,6 @@ public final class ListHostsAction extends ListObjectsAction { final DateTime now = clock.nowUtc(); return Streams.stream(ofy().load().type(HostResource.class)) .filter(host -> EppResourceUtils.isActive(host, now)) - .collect(toImmutableSortedSet(comparing(HostResource::getFullyQualifiedHostName))); + .collect(toImmutableSortedSet(comparing(HostResource::getHostName))); } } diff --git a/core/src/main/java/google/registry/tools/server/RefreshDnsForAllDomainsAction.java b/core/src/main/java/google/registry/tools/server/RefreshDnsForAllDomainsAction.java index 98021aa12..a0cc8aafc 100644 --- a/core/src/main/java/google/registry/tools/server/RefreshDnsForAllDomainsAction.java +++ b/core/src/main/java/google/registry/tools/server/RefreshDnsForAllDomainsAction.java @@ -114,7 +114,7 @@ public class RefreshDnsForAllDomainsAction implements Runnable { @Override public void map(final DomainBase domain) { - String domainName = domain.getFullyQualifiedDomainName(); + String domainName = domain.getDomainName(); if (tlds.contains(domain.getTld())) { if (isActive(domain, DateTime.now(DateTimeZone.UTC))) { try { diff --git a/core/src/main/java/google/registry/ui/server/registrar/RegistryLockGetAction.java b/core/src/main/java/google/registry/ui/server/registrar/RegistryLockGetAction.java index 0e895edb5..c819c2cec 100644 --- a/core/src/main/java/google/registry/ui/server/registrar/RegistryLockGetAction.java +++ b/core/src/main/java/google/registry/ui/server/registrar/RegistryLockGetAction.java @@ -65,7 +65,7 @@ public final class RegistryLockGetAction implements JsonGetAction { private static final String LOCK_ENABLED_FOR_CONTACT_PARAM = "lockEnabledForContact"; private static final String EMAIL_PARAM = "email"; private static final String LOCKS_PARAM = "locks"; - private static final String FULLY_QUALIFIED_DOMAIN_NAME_PARAM = "fullyQualifiedDomainName"; + private static final String DOMAIN_NAME_PARAM = "domainName"; private static final String LOCKED_TIME_PARAM = "lockedTime"; private static final String LOCKED_BY_PARAM = "lockedBy"; private static final String IS_LOCK_PENDING_PARAM = "isLockPending"; @@ -190,7 +190,7 @@ public final class RegistryLockGetAction implements JsonGetAction { private ImmutableMap lockToMap(RegistryLock lock, boolean isAdmin) { DateTime now = jpaTm().getTransactionTime(); return new ImmutableMap.Builder() - .put(FULLY_QUALIFIED_DOMAIN_NAME_PARAM, lock.getDomainName()) + .put(DOMAIN_NAME_PARAM, lock.getDomainName()) .put( LOCKED_TIME_PARAM, lock.getLockCompletionTimestamp().map(DateTime::toString).orElse("")) .put(LOCKED_BY_PARAM, lock.isSuperuser() ? "admin" : lock.getRegistrarPocId()) diff --git a/core/src/main/java/google/registry/ui/server/registrar/RegistryLockPostAction.java b/core/src/main/java/google/registry/ui/server/registrar/RegistryLockPostAction.java index da09486d0..b3f59964a 100644 --- a/core/src/main/java/google/registry/ui/server/registrar/RegistryLockPostAction.java +++ b/core/src/main/java/google/registry/ui/server/registrar/RegistryLockPostAction.java @@ -120,9 +120,7 @@ public class RegistryLockPostAction implements Runnable, JsonActionRunner.JsonAc !Strings.isNullOrEmpty(postInput.clientId), "Missing key for client: %s", PARAM_CLIENT_ID); - checkArgument( - !Strings.isNullOrEmpty(postInput.fullyQualifiedDomainName), - "Missing key for fullyQualifiedDomainName"); + checkArgument(!Strings.isNullOrEmpty(postInput.domainName), "Missing key for domainName"); checkNotNull(postInput.isLock, "Missing key for isLock"); UserAuthInfo userAuthInfo = authResult @@ -136,12 +134,12 @@ public class RegistryLockPostAction implements Runnable, JsonActionRunner.JsonAc RegistryLock registryLock = postInput.isLock ? domainLockUtils.saveNewRegistryLockRequest( - postInput.fullyQualifiedDomainName, + postInput.domainName, postInput.clientId, userEmail, registrarAccessor.isAdmin()) : domainLockUtils.saveNewRegistryUnlockRequest( - postInput.fullyQualifiedDomainName, + postInput.domainName, postInput.clientId, registrarAccessor.isAdmin(), Optional.ofNullable(postInput.relockDurationMillis).map(Duration::new)); @@ -218,7 +216,7 @@ public class RegistryLockPostAction implements Runnable, JsonActionRunner.JsonAc /** Value class that represents the expected input body from the UI request. */ private static class RegistryLockPostInput { private String clientId; - private String fullyQualifiedDomainName; + private String domainName; private Boolean isLock; private String password; private Long relockDurationMillis; diff --git a/core/src/main/java/google/registry/ui/server/registrar/RegistryLockVerifyAction.java b/core/src/main/java/google/registry/ui/server/registrar/RegistryLockVerifyAction.java index f9342a225..98b64a413 100644 --- a/core/src/main/java/google/registry/ui/server/registrar/RegistryLockVerifyAction.java +++ b/core/src/main/java/google/registry/ui/server/registrar/RegistryLockVerifyAction.java @@ -73,7 +73,7 @@ public final class RegistryLockVerifyAction extends HtmlAction { } data.put("isLock", isLock); data.put("success", true); - data.put("fullyQualifiedDomainName", resultLock.getDomainName()); + data.put("domainName", resultLock.getDomainName()); } catch (Throwable t) { logger.atWarning().withCause(t).log( "Error when verifying verification code %s", lockVerificationCode); diff --git a/core/src/main/java/google/registry/whois/DomainWhoisResponse.java b/core/src/main/java/google/registry/whois/DomainWhoisResponse.java index 133d2ae5c..ccab795fa 100644 --- a/core/src/main/java/google/registry/whois/DomainWhoisResponse.java +++ b/core/src/main/java/google/registry/whois/DomainWhoisResponse.java @@ -90,7 +90,7 @@ final class DomainWhoisResponse extends WhoisResponseImpl { new DomainEmitter() .emitField( "Domain Name", - maybeFormatHostname(domain.getFullyQualifiedDomainName(), preferUnicode)) + maybeFormatHostname(domain.getDomainName(), preferUnicode)) .emitField("Registry Domain ID", domain.getRepoId()) .emitField("Registrar WHOIS Server", registrar.getWhoisServer()) .emitField("Registrar URL", registrar.getUrl()) @@ -115,7 +115,7 @@ final class DomainWhoisResponse extends WhoisResponseImpl { .emitContact("Billing", getContactReference(Type.BILLING), preferUnicode) .emitSet( "Name Server", - domain.loadNameserverFullyQualifiedHostNames(), + domain.loadNameserverHostNames(), hostName -> maybeFormatHostname(hostName, preferUnicode)) .emitField( "DNSSEC", isNullOrEmpty(domain.getDsData()) ? "unsigned" : "signedDelegation") @@ -160,7 +160,7 @@ final class DomainWhoisResponse extends WhoisResponseImpl { if (contactResource == null) { logger.atSevere().log( "(BUG) Broken reference found from domain %s to contact %s", - domain.getFullyQualifiedDomainName(), contact); + domain.getDomainName(), contact); return this; } PostalInfo postalInfo = diff --git a/core/src/main/java/google/registry/whois/NameserverLookupByIpCommand.java b/core/src/main/java/google/registry/whois/NameserverLookupByIpCommand.java index e15f446f3..9a8768f15 100644 --- a/core/src/main/java/google/registry/whois/NameserverLookupByIpCommand.java +++ b/core/src/main/java/google/registry/whois/NameserverLookupByIpCommand.java @@ -52,7 +52,7 @@ final class NameserverLookupByIpCommand implements WhoisCommand { .filter( host -> Registries.findTldForName( - InternetDomainName.from(host.getFullyQualifiedHostName())) + InternetDomainName.from(host.getHostName())) .isPresent()) .collect(toImmutableList()); if (hosts.isEmpty()) { diff --git a/core/src/main/java/google/registry/whois/NameserverWhoisResponse.java b/core/src/main/java/google/registry/whois/NameserverWhoisResponse.java index bd06dc583..f2f6eab04 100644 --- a/core/src/main/java/google/registry/whois/NameserverWhoisResponse.java +++ b/core/src/main/java/google/registry/whois/NameserverWhoisResponse.java @@ -57,7 +57,7 @@ final class NameserverWhoisResponse extends WhoisResponseImpl { checkState(registrar.isPresent(), "Could not load registrar %s", clientId); emitter .emitField( - "Server Name", maybeFormatHostname(host.getFullyQualifiedHostName(), preferUnicode)) + "Server Name", maybeFormatHostname(host.getHostName(), preferUnicode)) .emitSet("IP Address", host.getInetAddresses(), InetAddresses::toAddrString) .emitField("Registrar", registrar.get().getRegistrarName()) .emitField("Registrar WHOIS Server", registrar.get().getWhoisServer()) diff --git a/core/src/main/javascript/google/registry/ui/externs/json.js b/core/src/main/javascript/google/registry/ui/externs/json.js index 8feeabaa0..3820a7e0d 100644 --- a/core/src/main/javascript/google/registry/ui/externs/json.js +++ b/core/src/main/javascript/google/registry/ui/externs/json.js @@ -34,7 +34,7 @@ registry.json.locks = {}; /** * @typedef {{ - * fullyQualifiedDomainName: string, + * domainName: string, * lockedTime: string, * lockedBy: string, * userCanUnlock: boolean, diff --git a/core/src/main/javascript/google/registry/ui/js/registrar/registry_lock.js b/core/src/main/javascript/google/registry/ui/js/registrar/registry_lock.js index a36f3fbbb..779bef2d4 100644 --- a/core/src/main/javascript/google/registry/ui/js/registrar/registry_lock.js +++ b/core/src/main/javascript/google/registry/ui/js/registrar/registry_lock.js @@ -173,7 +173,7 @@ registry.registrar.RegistryLock.prototype.lockOrUnlockDomain_ = function(isLock, 'POST', goog.json.serialize({ 'clientId': this.clientId, - 'fullyQualifiedDomainName': domain, + 'domainName': domain, 'isLock': isLock, 'password': password, 'relockDurationMillis': relockDuration diff --git a/core/src/main/resources/google/registry/ui/soy/registrar/RegistryLock.soy b/core/src/main/resources/google/registry/ui/soy/registrar/RegistryLock.soy index bce2ac5c0..e11248ab3 100644 --- a/core/src/main/resources/google/registry/ui/soy/registrar/RegistryLock.soy +++ b/core/src/main/resources/google/registry/ui/soy/registrar/RegistryLock.soy @@ -31,7 +31,7 @@ {template .locksContent} {@param email: string} - {@param locks: list<[fullyQualifiedDomainName: string, lockedTime: string, lockedBy: string, + {@param locks: list<[domainName: string, lockedTime: string, lockedBy: string, userCanUnlock: bool, isLockPending: bool, isUnlockPending: bool]>} {@param lockEnabledForContact: bool} @@ -72,7 +72,7 @@ /** Table that displays existing locks for this registrar. */ {template .existingLocksTable} - {@param locks: list<[fullyQualifiedDomainName: string, lockedTime: string, lockedBy: string, + {@param locks: list<[domainName: string, lockedTime: string, lockedBy: string, userCanUnlock: bool, isLockPending: bool, isUnlockPending: bool]>} {@param lockEnabledForContact: bool}

Existing locks

@@ -86,7 +86,7 @@ {for $lock in $locks} - {$lock.fullyQualifiedDomainName} + {$lock.domainName} {if $lock.isLockPending} (pending) {elseif $lock.isUnlockPending} (unlock pending) {/if} @@ -94,7 +94,7 @@ {$lock.lockedBy} {if not $lock.isLockPending and not $lock.isUnlockPending} -