diff --git a/core/src/main/java/google/registry/batch/DeleteProberDataAction.java b/core/src/main/java/google/registry/batch/DeleteProberDataAction.java index a58a68beb..872b10def 100644 --- a/core/src/main/java/google/registry/batch/DeleteProberDataAction.java +++ b/core/src/main/java/google/registry/batch/DeleteProberDataAction.java @@ -91,7 +91,7 @@ public class DeleteProberDataAction implements Runnable { // Note: creationTime must be compared to a Java object (CreateAutoTimestamp) but deletionTime can // be compared directly to the SQL timestamp (it's a DateTime) private static final String DOMAIN_QUERY_STRING = - "FROM Domain d WHERE d.tld IN :tlds AND d.fullyQualifiedDomainName NOT LIKE 'nic.%' AND" + "FROM Domain d WHERE d.tld IN :tlds AND d.domainName NOT LIKE 'nic.%' AND" + " (d.subordinateHosts IS EMPTY OR d.subordinateHosts IS NULL) AND d.creationTime <" + " :creationTimeCutoff AND ((d.creationTime <= :nowAutoTimestamp AND d.deletionTime >" + " current_timestamp()) OR d.deletionTime < :nowMinusSoftDeleteDelay) ORDER BY d.repoId"; @@ -220,7 +220,7 @@ public class DeleteProberDataAction implements Runnable { private void hardDeleteDomainsAndHosts( ImmutableList domainRepoIds, ImmutableList hostNames) { jpaTm() - .query("DELETE FROM Host WHERE fullyQualifiedHostName IN :hostNames") + .query("DELETE FROM Host WHERE hostName IN :hostNames") .setParameter("hostNames", hostNames) .executeUpdate(); jpaTm() diff --git a/core/src/main/java/google/registry/beam/rde/RdePipeline.java b/core/src/main/java/google/registry/beam/rde/RdePipeline.java index 442eb8657..0bd4088c4 100644 --- a/core/src/main/java/google/registry/beam/rde/RdePipeline.java +++ b/core/src/main/java/google/registry/beam/rde/RdePipeline.java @@ -301,7 +301,7 @@ public class RdePipeline implements Serializable { .apply( "Read all production Registrars", RegistryJpaIO.read( - "SELECT clientIdentifier FROM Registrar WHERE type NOT IN (:types)", + "SELECT registrarId FROM Registrar WHERE type NOT IN (:types)", ImmutableMap.of("types", IGNORED_REGISTRAR_TYPES), String.class, id -> VKey.createSql(Registrar.class, id))) diff --git a/core/src/main/java/google/registry/beam/spec11/SafeBrowsingTransforms.java b/core/src/main/java/google/registry/beam/spec11/SafeBrowsingTransforms.java index a4ea3dc5a..179a2bce5 100644 --- a/core/src/main/java/google/registry/beam/spec11/SafeBrowsingTransforms.java +++ b/core/src/main/java/google/registry/beam/spec11/SafeBrowsingTransforms.java @@ -75,8 +75,8 @@ public class SafeBrowsingTransforms { private final String apiKey; /** - * Maps a domain name's {@code fullyQualifiedDomainName} to its corresponding {@link - * DomainNameInfo} to facilitate batching SafeBrowsing API requests. + * Maps a domain name's {@code domainName} to its corresponding {@link DomainNameInfo} to + * facilitate batching SafeBrowsing API requests. */ private final Map domainNameInfoBuffer = new LinkedHashMap<>(BATCH_SIZE); @@ -186,8 +186,8 @@ public class SafeBrowsingTransforms { private JSONObject createRequestBody() throws JSONException { // Accumulate all domain names to evaluate. JSONArray threatArray = new JSONArray(); - for (String fullyQualifiedDomainName : domainNameInfoBuffer.keySet()) { - threatArray.put(new JSONObject().put("url", fullyQualifiedDomainName)); + for (String domainName : domainNameInfoBuffer.keySet()) { + threatArray.put(new JSONObject().put("url", domainName)); } // Construct the JSON request body return new JSONObject() diff --git a/core/src/main/java/google/registry/beam/spec11/Spec11Pipeline.java b/core/src/main/java/google/registry/beam/spec11/Spec11Pipeline.java index 68f525898..e478f551e 100644 --- a/core/src/main/java/google/registry/beam/spec11/Spec11Pipeline.java +++ b/core/src/main/java/google/registry/beam/spec11/Spec11Pipeline.java @@ -113,7 +113,7 @@ public class Spec11Pipeline implements Serializable { Read> read = RegistryJpaIO.read( "select d.repoId, r.emailAddress from Domain d join Registrar r on" - + " d.currentSponsorClientId = r.clientIdentifier where r.type = 'REAL' and" + + " d.currentSponsorClientId = r.registrarId where r.type = 'REAL' and" + " d.deletionTime > now()", false, Spec11Pipeline::parseRow); diff --git a/core/src/main/java/google/registry/beam/spec11/ThreatMatch.java b/core/src/main/java/google/registry/beam/spec11/ThreatMatch.java index c82eb7eae..1ef50f6a0 100644 --- a/core/src/main/java/google/registry/beam/spec11/ThreatMatch.java +++ b/core/src/main/java/google/registry/beam/spec11/ThreatMatch.java @@ -25,23 +25,23 @@ import org.json.JSONObject; public abstract class ThreatMatch implements Serializable { private static final String THREAT_TYPE_FIELD = "threatType"; - private static final String DOMAIN_NAME_FIELD = "fullyQualifiedDomainName"; + private static final String DOMAIN_NAME_FIELD = "domainName"; /** Returns what kind of threat it is (malware, phishing etc.) */ public abstract String threatType(); /** Returns the fully qualified domain name [SLD].[TLD] of the matched threat. */ - public abstract String fullyQualifiedDomainName(); + public abstract String domainName(); @VisibleForTesting - static ThreatMatch create(String threatType, String fullyQualifiedDomainName) { - return new AutoValue_ThreatMatch(threatType, fullyQualifiedDomainName); + static ThreatMatch create(String threatType, String domainName) { + return new AutoValue_ThreatMatch(threatType, domainName); } /** Returns a {@link JSONObject} representing a subset of this object's data. */ JSONObject toJSON() throws JSONException { return new JSONObject() .put(THREAT_TYPE_FIELD, threatType()) - .put(DOMAIN_NAME_FIELD, fullyQualifiedDomainName()); + .put(DOMAIN_NAME_FIELD, domainName()); } /** Parses a {@link JSONObject} and returns an equivalent {@link ThreatMatch}. */ 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 87cbf02be..444c540aa 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 @@ -37,7 +37,7 @@ import google.registry.dns.writer.BaseDnsWriter; import google.registry.dns.writer.DnsWriter; import google.registry.dns.writer.DnsWriterZone; import google.registry.model.domain.Domain; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.host.Host; import google.registry.model.tld.Registries; import google.registry.util.Clock; @@ -134,10 +134,10 @@ public class CloudDnsWriter extends BaseDnsWriter { ImmutableSet.Builder domainRecords = new ImmutableSet.Builder<>(); // Construct DS records (if any). - Set dsData = domain.get().getDsData(); + Set dsData = domain.get().getDsData(); if (!dsData.isEmpty()) { HashSet dsRrData = new HashSet<>(); - for (DelegationSignerData ds : dsData) { + for (DomainDsData ds : dsData) { dsRrData.add(ds.toRrData()); } 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 9b2771111..f5d9f2910 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 @@ -28,7 +28,7 @@ import google.registry.config.RegistryConfig.Config; import google.registry.dns.writer.BaseDnsWriter; import google.registry.dns.writer.DnsWriterZone; import google.registry.model.domain.Domain; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.host.Host; import google.registry.model.tld.Registries; import google.registry.util.Clock; @@ -185,7 +185,7 @@ public class DnsUpdateWriter extends BaseDnsWriter { private RRset makeDelegationSignerSet(Domain domain) { RRset signerSet = new RRset(); - for (DelegationSignerData signerData : domain.getDsData()) { + for (DomainDsData signerData : domain.getDsData()) { DSRecord dsRecord = new DSRecord( toAbsoluteName(domain.getDomainName()), diff --git a/core/src/main/java/google/registry/export/ExportDomainListsAction.java b/core/src/main/java/google/registry/export/ExportDomainListsAction.java index 5528d8f23..f6aa4717e 100644 --- a/core/src/main/java/google/registry/export/ExportDomainListsAction.java +++ b/core/src/main/java/google/registry/export/ExportDomainListsAction.java @@ -91,10 +91,10 @@ public class ExportDomainListsAction implements Runnable { // field that compares with the substituted value. jpaTm() .query( - "SELECT fullyQualifiedDomainName FROM Domain " + "SELECT domainName FROM Domain " + "WHERE tld = :tld " + "AND deletionTime > :now " - + "ORDER by fullyQualifiedDomainName ASC", + + "ORDER by domainName ASC", String.class) .setParameter("tld", tld) .setParameter("now", clock.nowUtc()) diff --git a/core/src/main/java/google/registry/export/sheet/SyncRegistrarsSheet.java b/core/src/main/java/google/registry/export/sheet/SyncRegistrarsSheet.java index 7c4aaf712..523a2351d 100644 --- a/core/src/main/java/google/registry/export/sheet/SyncRegistrarsSheet.java +++ b/core/src/main/java/google/registry/export/sheet/SyncRegistrarsSheet.java @@ -114,7 +114,7 @@ class SyncRegistrarsSheet { // and you'll need to remove deleted columns probably like a week after // deployment. // - builder.put("clientIdentifier", convert(registrar.getRegistrarId())); + builder.put("registrarId", convert(registrar.getRegistrarId())); builder.put("registrarName", convert(registrar.getRegistrarName())); builder.put("state", convert(registrar.getState())); builder.put("ianaIdentifier", convert(registrar.getIanaIdentifier())); 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 0bf91e8ff..9b7180a0a 100644 --- a/core/src/main/java/google/registry/flows/domain/DomainCreateFlow.java +++ b/core/src/main/java/google/registry/flows/domain/DomainCreateFlow.java @@ -248,7 +248,7 @@ public final class DomainCreateFlow implements TransactionalFlow { validateRegistrationPeriod(years); verifyResourceDoesNotExist(Domain.class, targetId, now, registrarId); // Validate that this is actually a legal domain name on a TLD that the registrar has access to. - InternetDomainName domainName = validateDomainName(command.getFullyQualifiedDomainName()); + InternetDomainName domainName = validateDomainName(command.getDomainName()); String domainLabel = domainName.parts().get(0); Registry registry = Registry.get(domainName.parent().toString()); validateCreateCommandContactsAndNameservers(command, registry, domainName); @@ -639,10 +639,7 @@ public final class DomainCreateFlow implements TransactionalFlow { } private static PollMessage.OneTime createNameCollisionOneTimePollMessage( - String fullyQualifiedDomainName, - HistoryEntry historyEntry, - String registrarId, - DateTime now) { + String domainName, HistoryEntry historyEntry, String registrarId, DateTime now) { return new PollMessage.OneTime.Builder() .setRegistrarId(registrarId) .setEventTime(now) @@ -650,7 +647,7 @@ public final class DomainCreateFlow implements TransactionalFlow { .setResponseData( ImmutableList.of( DomainPendingActionNotificationResponse.create( - fullyQualifiedDomainName, true, historyEntry.getTrid(), now))) + domainName, true, historyEntry.getTrid(), now))) .setHistoryEntry(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 7e8a7c7fd..240e06cd4 100644 --- a/core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java +++ b/core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java @@ -105,7 +105,7 @@ import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.launch.LaunchNotice.InvalidChecksumException; import google.registry.model.domain.launch.LaunchPhase; import google.registry.model.domain.metadata.MetadataExtension; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.domain.secdns.SecDnsCreateExtension; import google.registry.model.domain.secdns.SecDnsInfoExtension; import google.registry.model.domain.secdns.SecDnsUpdateExtension; @@ -316,14 +316,14 @@ public class DomainFlowUtils { } /** Check that the DS data that will be set on a domain is valid. */ - static void validateDsData(Set dsData) throws EppException { + static void validateDsData(Set dsData) throws EppException { if (dsData != null) { if (dsData.size() > MAX_DS_RECORDS_PER_DOMAIN) { throw new TooManyDsRecordsException( String.format( "A maximum of %s DS records are allowed per domain.", MAX_DS_RECORDS_PER_DOMAIN)); } - ImmutableList invalidAlgorithms = + ImmutableList invalidAlgorithms = dsData.stream() .filter(ds -> !validateAlgorithm(ds.getAlgorithm())) .collect(toImmutableList()); @@ -333,7 +333,7 @@ public class DomainFlowUtils { "Domain contains DS record(s) with an invalid algorithm wire value: %s", invalidAlgorithms)); } - ImmutableList invalidDigestTypes = + ImmutableList invalidDigestTypes = dsData.stream() .filter(ds -> !DigestType.fromWireValue(ds.getDigestType()).isPresent()) .collect(toImmutableList()); @@ -343,7 +343,7 @@ public class DomainFlowUtils { "Domain contains DS record(s) with an invalid digest type: %s", invalidDigestTypes)); } - ImmutableList digestsWithInvalidDigestLength = + ImmutableList digestsWithInvalidDigestLength = dsData.stream() .filter( ds -> @@ -920,16 +920,15 @@ public class DomainFlowUtils { * and we are going to ignore it; clients who don't care about secDNS can just ignore it. */ static void addSecDnsExtensionIfPresent( - ImmutableList.Builder extensions, - ImmutableSet dsData) { + ImmutableList.Builder extensions, ImmutableSet dsData) { if (!dsData.isEmpty()) { extensions.add(SecDnsInfoExtension.create(dsData)); } } - /** Update {@link DelegationSignerData} based on an update extension command. */ - static ImmutableSet updateDsData( - ImmutableSet oldDsData, SecDnsUpdateExtension secDnsUpdate) + /** Update {@link DomainDsData} based on an update extension command. */ + static ImmutableSet updateDsData( + ImmutableSet oldDsData, SecDnsUpdateExtension secDnsUpdate) throws EppException { // We don't support 'urgent' because we do everything as fast as we can anyways. if (Boolean.TRUE.equals(secDnsUpdate.getUrgent())) { // We allow both false and null. @@ -948,8 +947,8 @@ public class DomainFlowUtils { if (remove != null && Boolean.FALSE.equals(remove.getAll())) { throw new SecDnsAllUsageException(); // Explicit all=false is meaningless. } - Set toAdd = (add == null) ? ImmutableSet.of() : add.getDsData(); - Set toRemove = + Set toAdd = (add == null) ? ImmutableSet.of() : add.getDsData(); + Set toRemove = (remove == null) ? ImmutableSet.of() : (remove.getAll() == null) ? remove.getDsData() : oldDsData; @@ -1001,9 +1000,9 @@ public class DomainFlowUtils { validateRegistrantAllowedOnTld(tld, command.getRegistrantContactId()); validateNoDuplicateContacts(command.getContacts()); validateRequiredContactsPresent(command.getRegistrant(), command.getContacts()); - ImmutableSet fullyQualifiedHostNames = command.getNameserverFullyQualifiedHostNames(); - validateNameserversCountForTld(tld, domainName, fullyQualifiedHostNames.size()); - validateNameserversAllowedOnTld(tld, fullyQualifiedHostNames); + ImmutableSet hostNames = command.getNameserverHostNames(); + validateNameserversCountForTld(tld, domainName, hostNames.size()); + validateNameserversAllowedOnTld(tld, hostNames); } /** Validate the secDNS extension, if present. */ @@ -1542,11 +1541,11 @@ public class DomainFlowUtils { /** Nameservers are not allow-listed for this TLD. */ public static class NameserversNotAllowedForTldException extends StatusProhibitsOperationException { - public NameserversNotAllowedForTldException(Set fullyQualifiedHostNames) { + public NameserversNotAllowedForTldException(Set hostNames) { super( String.format( "Nameservers '%s' are not allow-listed for this TLD", - Joiner.on(',').join(fullyQualifiedHostNames))); + Joiner.on(',').join(hostNames))); } } 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 38caadd19..167f46643 100644 --- a/core/src/main/java/google/registry/flows/domain/DomainInfoFlow.java +++ b/core/src/main/java/google/registry/flows/domain/DomainInfoFlow.java @@ -109,7 +109,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.getDomainName()) + .setDomainName(domain.getDomainName()) .setRepoId(domain.getRepoId()) .setCurrentSponsorClientId(domain.getCurrentSponsorRegistrarId()) .setRegistrant( 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 f04d2d34c..2cb4df90f 100644 --- a/core/src/main/java/google/registry/flows/domain/DomainTransferUtils.java +++ b/core/src/main/java/google/registry/flows/domain/DomainTransferUtils.java @@ -218,7 +218,7 @@ public final class DomainTransferUtils { TransferData transferData, @Nullable DateTime extendedRegistrationExpirationTime) { return new DomainTransferResponse.Builder() - .setFullyQualifiedDomainName(targetId) + .setDomainName(targetId) .setGainingRegistrarId(transferData.getGainingRegistrarId()) .setLosingRegistrarId(transferData.getLosingRegistrarId()) .setPendingTransferExpirationTime(transferData.getPendingTransferExpirationTime()) 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 aa0b7c14b..95f709cc3 100644 --- a/core/src/main/java/google/registry/flows/domain/DomainUpdateFlow.java +++ b/core/src/main/java/google/registry/flows/domain/DomainUpdateFlow.java @@ -74,7 +74,7 @@ import google.registry.model.domain.DomainCommand.Update.Change; import google.registry.model.domain.DomainHistory; import google.registry.model.domain.fee.FeeUpdateCommandExtension; import google.registry.model.domain.metadata.MetadataExtension; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.domain.secdns.SecDnsUpdateExtension; import google.registry.model.domain.superuser.DomainUpdateSuperuserExtension; import google.registry.model.eppcommon.AuthInfo; @@ -87,6 +87,7 @@ import google.registry.model.poll.PendingActionNotificationResponse.DomainPendin import google.registry.model.poll.PollMessage; import google.registry.model.reporting.IcannReportingTypes.ActivityReportField; import google.registry.model.tld.Registry; +import java.util.Objects; import java.util.Optional; import javax.inject.Inject; import org.joda.time.DateTime; @@ -181,8 +182,8 @@ public final class DomainUpdateFlow implements TransactionalFlow { DomainHistory domainHistory = historyBuilder.setType(DOMAIN_UPDATE).setDomain(newDomain).build(); validateNewState(newDomain); - if (newDomain.getDsData() != existingDomain.getDsData() - || newDomain.getNsHosts() != existingDomain.getNsHosts()) { + if (!Objects.equals(newDomain.getDsData(), existingDomain.getDsData()) + || !Objects.equals(newDomain.getNsHosts(), existingDomain.getNsHosts())) { dnsQueue.addDomainRefreshTask(targetId); } ImmutableSet.Builder entitiesToSave = new ImmutableSet.Builder<>(); @@ -232,8 +233,7 @@ public final class DomainUpdateFlow implements TransactionalFlow { validateContactsHaveTypes(add.getContacts()); validateContactsHaveTypes(remove.getContacts()); validateRegistrantAllowedOnTld(tld, command.getInnerChange().getRegistrantContactId()); - validateNameserversAllowedOnTld( - tld, add.getNameserverFullyQualifiedHostNames()); + validateNameserversAllowedOnTld(tld, add.getNameserverHostNames()); } private Domain performUpdate(Update command, Domain domain, DateTime now) throws EppException { @@ -263,7 +263,7 @@ public final class DomainUpdateFlow implements TransactionalFlow { secDnsUpdate.isPresent() ? updateDsData( domain.getDsData().stream() - .map(DelegationSignerData::cloneWithoutDomainRepoId) + .map(DomainDsData::cloneWithoutDomainRepoId) .collect(toImmutableSet()), secDnsUpdate.get()) : domain.getDsData()) diff --git a/core/src/main/java/google/registry/flows/domain/token/AllocationTokenFlowUtils.java b/core/src/main/java/google/registry/flows/domain/token/AllocationTokenFlowUtils.java index c1c65e39d..629096fed 100644 --- a/core/src/main/java/google/registry/flows/domain/token/AllocationTokenFlowUtils.java +++ b/core/src/main/java/google/registry/flows/domain/token/AllocationTokenFlowUtils.java @@ -175,11 +175,7 @@ public class AllocationTokenFlowUtils { return Optional.empty(); } AllocationToken tokenEntity = loadToken(extension.get().getAllocationToken()); - validateToken( - InternetDomainName.from(command.getFullyQualifiedDomainName()), - tokenEntity, - registrarId, - now); + validateToken(InternetDomainName.from(command.getDomainName()), tokenEntity, registrarId, now); return Optional.of( tokenCustomLogic.validateToken(command, tokenEntity, registry, registrarId, now)); } 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 b1c170f31..f1be9a2b1 100644 --- a/core/src/main/java/google/registry/flows/host/HostCreateFlow.java +++ b/core/src/main/java/google/registry/flows/host/HostCreateFlow.java @@ -134,7 +134,7 @@ public final class HostCreateFlow implements TransactionalFlow { superordinateDomain .get() .asBuilder() - .addSubordinateHost(command.getFullyQualifiedHostName()) + .addSubordinateHost(command.getHostName()) .build()); // Only update DNS if this is a subordinate host. External hosts have no glue to write, so // they are only written as NS records from the referencing domain. 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 7aa369deb..5f62ced2b 100644 --- a/core/src/main/java/google/registry/flows/host/HostInfoFlow.java +++ b/core/src/main/java/google/registry/flows/host/HostInfoFlow.java @@ -93,7 +93,7 @@ public final class HostInfoFlow implements Flow { return responseBuilder .setResData( hostInfoDataBuilder - .setFullyQualifiedHostName(host.getHostName()) + .setHostName(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 db28d7548..f4948ab19 100644 --- a/core/src/main/java/google/registry/flows/host/HostUpdateFlow.java +++ b/core/src/main/java/google/registry/flows/host/HostUpdateFlow.java @@ -129,7 +129,7 @@ public final class HostUpdateFlow implements TransactionalFlow { extensionManager.validate(); Update command = (Update) resourceCommand; Change change = command.getInnerChange(); - String suppliedNewHostName = change.getFullyQualifiedHostName(); + String suppliedNewHostName = change.getHostName(); DateTime now = tm().getTransactionTime(); validateHostName(targetId); Host existingHost = loadAndVerifyExistence(Host.class, targetId, now); @@ -260,7 +260,7 @@ public final class HostUpdateFlow implements TransactionalFlow { 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 (((Update) resourceCommand).getInnerChange().getHostName() != null) { // If the renamed host is also subordinate, then we must enqueue an update to write the new // glue. if (newHost.isSubordinate()) { diff --git a/core/src/main/java/google/registry/model/EppResource.java b/core/src/main/java/google/registry/model/EppResource.java index a2de5cf71..41cbe15cc 100644 --- a/core/src/main/java/google/registry/model/EppResource.java +++ b/core/src/main/java/google/registry/model/EppResource.java @@ -140,10 +140,7 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable { DateTime lastEppUpdateTime; /** Status values associated with this resource. */ - @Ignore - @Column(name = "statuses") - // TODO(b/177567432): rename to "statuses" once we're off datastore. - Set status; + @Ignore Set statuses; public String getRepoId() { return repoId; @@ -189,7 +186,7 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable { } public final ImmutableSet getStatusValues() { - return nullToEmptyImmutableCopy(status); + return nullToEmptyImmutableCopy(statuses); } public DateTime getDeletionTime() { @@ -307,7 +304,7 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable { statusValue, resourceClass.getSimpleName()); } - getInstance().status = statusValues; + getInstance().statuses = statusValues; return thisCastToDerived(); } diff --git a/core/src/main/java/google/registry/model/ForeignKeyUtils.java b/core/src/main/java/google/registry/model/ForeignKeyUtils.java index 0dbf8e7a1..cd3072200 100644 --- a/core/src/main/java/google/registry/model/ForeignKeyUtils.java +++ b/core/src/main/java/google/registry/model/ForeignKeyUtils.java @@ -58,8 +58,8 @@ public final class ForeignKeyUtils { RESOURCE_TYPE_TO_FK_PROPERTY = ImmutableMap.of( Contact.class, "contactId", - Domain.class, "fullyQualifiedDomainName", - Host.class, "fullyQualifiedHostName"); + Domain.class, "domainName", + Host.class, "hostName"); /** * Loads a {@link VKey} to an {@link EppResource} from the database by foreign key. diff --git a/core/src/main/java/google/registry/model/OteStats.java b/core/src/main/java/google/registry/model/OteStats.java index 208074187..0b3d8e99e 100644 --- a/core/src/main/java/google/registry/model/OteStats.java +++ b/core/src/main/java/google/registry/model/OteStats.java @@ -68,7 +68,7 @@ public class OteStats { ((DomainCommand.Create) ((ResourceCommandWrapper) eppInput.getCommandWrapper().getCommand()) .getResourceCommand()) - .getFullyQualifiedDomainName() + .getDomainName() .startsWith(ACE_PREFIX); private static final Predicate IS_SUBORDINATE = diff --git a/core/src/main/java/google/registry/model/ResourceTransferUtils.java b/core/src/main/java/google/registry/model/ResourceTransferUtils.java index 0b5f4e153..a27814175 100644 --- a/core/src/main/java/google/registry/model/ResourceTransferUtils.java +++ b/core/src/main/java/google/registry/model/ResourceTransferUtils.java @@ -64,7 +64,7 @@ public final class ResourceTransferUtils { DomainTransferData domainTransferData = (DomainTransferData) transferData; builder = new DomainTransferResponse.Builder() - .setFullyQualifiedDomainName(eppResource.getForeignKey()) + .setDomainName(eppResource.getForeignKey()) .setExtendedRegistrationExpirationTime( ADD_EXDATE_STATUSES.contains(domainTransferData.getTransferStatus()) ? domainTransferData.getTransferredRegistrationExpirationTime() diff --git a/core/src/main/java/google/registry/model/bulkquery/BulkQueryEntities.java b/core/src/main/java/google/registry/model/bulkquery/BulkQueryEntities.java index c5ba6aab2..4aaba85a3 100644 --- a/core/src/main/java/google/registry/model/bulkquery/BulkQueryEntities.java +++ b/core/src/main/java/google/registry/model/bulkquery/BulkQueryEntities.java @@ -24,7 +24,7 @@ import google.registry.model.domain.DomainBase; import google.registry.model.domain.DomainHistory; import google.registry.model.domain.GracePeriod; import google.registry.model.domain.GracePeriod.GracePeriodHistory; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.domain.secdns.DomainDsDataHistory; import google.registry.model.host.Host; import google.registry.model.reporting.DomainTransactionRecord; @@ -67,12 +67,12 @@ public class BulkQueryEntities { public static Domain assembleDomain( DomainLite domainLite, ImmutableSet gracePeriods, - ImmutableSet delegationSignerData, + ImmutableSet domainDsData, ImmutableSet> nsHosts) { Domain.Builder builder = new Domain.Builder(); builder.copyFrom(domainLite); builder.setGracePeriods(gracePeriods); - builder.setDsData(delegationSignerData); + builder.setDsData(domainDsData); builder.setNameservers(nsHosts); // Restore the original update timestamp (this gets cleared when we set nameservers or DS data). builder.setUpdateTimestamp(domainLite.getUpdateTimestamp()); @@ -99,9 +99,7 @@ public class BulkQueryEntities { .map(GracePeriod::createFromHistory) .collect(toImmutableSet())) .setDsData( - dsDataHistories.stream() - .map(DelegationSignerData::create) - .collect(toImmutableSet())) + dsDataHistories.stream().map(DomainDsData::create).collect(toImmutableSet())) // Restore the original update timestamp (this gets cleared when we set nameservers or // DS data). .setUpdateTimestamp(domainHistoryLite.domainBase.getUpdateTimestamp()) diff --git a/core/src/main/java/google/registry/model/domain/Domain.java b/core/src/main/java/google/registry/model/domain/Domain.java index bd9add44b..fccaa8af7 100644 --- a/core/src/main/java/google/registry/model/domain/Domain.java +++ b/core/src/main/java/google/registry/model/domain/Domain.java @@ -19,7 +19,7 @@ import google.registry.model.EppResource; import google.registry.model.EppResource.ForeignKeyedEppResource; import google.registry.model.annotations.ExternalMessagingName; import google.registry.model.annotations.ReportedOn; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.host.Host; import google.registry.persistence.VKey; import google.registry.persistence.WithStringVKey; @@ -116,15 +116,14 @@ public class Domain extends DomainBase implements ForeignKeyedEppResource { } /** - * Returns the set of {@link DelegationSignerData} associated with the domain. + * Returns the set of {@link DomainDsData} associated with the domain. * *

This is the getter method specific for Hibernate to access the field, so it is set to * private. The caller can use the public {@link #getDsData()} to get the DS data. * *

Note that we need to set `insertable = false, updatable = false` for @JoinColumn, otherwise * Hibernate would try to set the foreign key to null(through an UPDATE TABLE sql) instead of - * deleting the whole entry from the table when the {@link DelegationSignerData} is removed from - * the set. + * deleting the whole entry from the table when the {@link DomainDsData} is removed from the set. */ @Access(AccessType.PROPERTY) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true) @@ -134,7 +133,7 @@ public class Domain extends DomainBase implements ForeignKeyedEppResource { insertable = false, updatable = false) @SuppressWarnings("UnusedMethod") - private Set getInternalDelegationSignerData() { + private Set getInternalDelegationSignerData() { return dsData; } 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 56d7ec172..01b397f02 100644 --- a/core/src/main/java/google/registry/model/domain/DomainBase.java +++ b/core/src/main/java/google/registry/model/domain/DomainBase.java @@ -53,7 +53,7 @@ import google.registry.model.billing.BillingEvent; import google.registry.model.contact.Contact; import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.rgp.GracePeriodStatus; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.domain.token.AllocationToken; import google.registry.model.eppcommon.StatusValue; import google.registry.model.host.Host; @@ -112,17 +112,14 @@ public class DomainBase extends EppResource * Fully qualified domain name (puny-coded), which serves as the foreign key for this domain. * *

This is only unique in the sense that for any given lifetime specified as the time range - * from (creationTime, deletionTime) there can only be one domain in Datastore with this name. + * from (creationTime, deletionTime) there can only be one domain in the database with this name. * However, there can be many domains with the same name and non-overlapping lifetimes. * - * @invariant fullyQualifiedDomainName == fullyQualifiedDomainName.toLowerCase(Locale.ENGLISH) + * @invariant domainName == domainName.toLowerCase(Locale.ENGLISH) */ - // TODO(b/177567432): Rename this to domainName when we are off Datastore - @Column(name = "domainName") - @Index - String fullyQualifiedDomainName; + @Index String domainName; - /** The top level domain this is under, dernormalized from {@link #fullyQualifiedDomainName}. */ + /** The top level domain this is under, dernormalized from {@link #domainName}. */ @Index String tld; /** References to hosts that are the nameservers for the domain. */ @@ -145,7 +142,7 @@ public class DomainBase extends EppResource DomainAuthInfo authInfo; /** Data used to construct DS records for this domain. */ - @Ignore @Transient Set dsData; + @Ignore @Transient Set dsData; /** * The claims notice supplied when this domain was created, if there was one. @@ -340,14 +337,14 @@ public class DomainBase extends EppResource @Override public String getForeignKey() { - return fullyQualifiedDomainName; + return domainName; } public String getDomainName() { - return fullyQualifiedDomainName; + return domainName; } - public ImmutableSet getDsData() { + public ImmutableSet getDsData() { return nullToEmptyImmutableCopy(dsData); } @@ -392,9 +389,9 @@ public class DomainBase extends EppResource // Hibernate needs this in order to populate dsData but no one else should ever use it @SuppressWarnings("UnusedMethod") - private void setInternalDelegationSignerData(Set dsData) { + private void setInternalDelegationSignerData(Set dsData) { if (this.dsData instanceof PersistentSet) { - Set nonNullDsData = nullToEmpty(dsData); + Set nonNullDsData = nullToEmpty(dsData); this.dsData.retainAll(nonNullDsData); this.dsData.addAll(nonNullDsData); } else { @@ -728,9 +725,9 @@ public class DomainBase extends EppResource // If there is no autorenew end time, set it to END_OF_TIME. instance.autorenewEndTime = firstNonNull(getInstance().autorenewEndTime, END_OF_TIME); - checkArgumentNotNull(emptyToNull(instance.fullyQualifiedDomainName), "Missing domainName"); + checkArgumentNotNull(emptyToNull(instance.domainName), "Missing domainName"); checkArgumentNotNull(instance.getRegistrant(), "Missing registrant"); - instance.tld = getTldFromDomainName(instance.fullyQualifiedDomainName); + instance.tld = getTldFromDomainName(instance.domainName); T newDomain = super.build(); // Hibernate throws exception if gracePeriods or dsData is null because we enabled all @@ -751,11 +748,11 @@ public class DomainBase extends EppResource domainName.equals(canonicalizeHostname(domainName)), "Domain name %s not in puny-coded, lower-case form", domainName); - getInstance().fullyQualifiedDomainName = domainName; + getInstance().domainName = domainName; return thisCastToDerived(); } - public B setDsData(ImmutableSet dsData) { + public B setDsData(ImmutableSet dsData) { getInstance().dsData = dsData; getInstance().resetUpdateTimestamp(); return thisCastToDerived(); diff --git a/core/src/main/java/google/registry/model/domain/DomainCommand.java b/core/src/main/java/google/registry/model/domain/DomainCommand.java index b4dcd4615..02be7109a 100644 --- a/core/src/main/java/google/registry/model/domain/DomainCommand.java +++ b/core/src/main/java/google/registry/model/domain/DomainCommand.java @@ -105,9 +105,9 @@ public class DomainCommand { @XmlRootElement @XmlType( propOrder = { - "fullyQualifiedDomainName", + "domainName", "period", - "nameserverFullyQualifiedHostNames", + "nameserverHostNames", "registrantContactId", "foreignKeyedDesignatedContacts", "authInfo" @@ -117,12 +117,12 @@ public class DomainCommand { /** Fully qualified domain name, which serves as a unique identifier for this domain. */ @XmlElement(name = "name") - String fullyQualifiedDomainName; + String domainName; /** Fully qualified host names of the hosts that are the nameservers for the domain. */ @XmlElementWrapper(name = "ns") @XmlElement(name = "hostObj") - Set nameserverFullyQualifiedHostNames; + Set nameserverHostNames; /** Resolved keys to hosts that are the nameservers for the domain. */ @XmlTransient Set> nameservers; @@ -144,15 +144,15 @@ public class DomainCommand { @Override public String getTargetId() { - return fullyQualifiedDomainName; + return domainName; } - public String getFullyQualifiedDomainName() { - return fullyQualifiedDomainName; + public String getDomainName() { + return domainName; } - public ImmutableSet getNameserverFullyQualifiedHostNames() { - return nullToEmptyImmutableCopy(nameserverFullyQualifiedHostNames); + public ImmutableSet getNameserverHostNames() { + return nullToEmptyImmutableCopy(nameserverHostNames); } public ImmutableSet> getNameservers() { @@ -172,7 +172,7 @@ public class DomainCommand { @Override public Create cloneAndLinkReferences(DateTime now) throws InvalidReferencesException { Create clone = clone(this); - clone.nameservers = linkHosts(clone.nameserverFullyQualifiedHostNames, now); + clone.nameservers = linkHosts(clone.nameserverHostNames, now); if (registrantContactId == null) { clone.contacts = linkContacts(clone.foreignKeyedDesignatedContacts, now); } else { @@ -205,7 +205,7 @@ public class DomainCommand { /** The name of the domain to look up, and an attribute specifying the host lookup type. */ @XmlElement(name = "name") - NameWithHosts fullyQualifiedDomainName; + NameWithHosts domainName; DomainAuthInfo authInfo; @@ -244,12 +244,12 @@ public class DomainCommand { /** Get the enum that specifies the requested hosts (applies only to info flows). */ public HostsRequest getHostsRequest() { // Null "hosts" is implicitly ALL. - return MoreObjects.firstNonNull(fullyQualifiedDomainName.hosts, HostsRequest.ALL); + return MoreObjects.firstNonNull(domainName.hosts, HostsRequest.ALL); } @Override public String getTargetId() { - return fullyQualifiedDomainName.name; + return domainName.name; } @Override @@ -337,15 +337,12 @@ public class DomainCommand { } /** The inner change type on a domain update command. */ - @XmlType(propOrder = { - "nameserverFullyQualifiedHostNames", - "foreignKeyedDesignatedContacts", - "statusValues"}) + @XmlType(propOrder = {"nameserverHostNames", "foreignKeyedDesignatedContacts", "statusValues"}) public static class AddRemove extends ResourceUpdate.AddRemove { /** Fully qualified host names of the hosts that are the nameservers for the domain. */ @XmlElementWrapper(name = "ns") @XmlElement(name = "hostObj") - Set nameserverFullyQualifiedHostNames; + Set nameserverHostNames; /** Resolved keys to hosts that are the nameservers for the domain. */ @XmlTransient Set> nameservers; @@ -358,8 +355,8 @@ public class DomainCommand { @XmlTransient Set contacts; - public ImmutableSet getNameserverFullyQualifiedHostNames() { - return nullSafeImmutableCopy(nameserverFullyQualifiedHostNames); + public ImmutableSet getNameserverHostNames() { + return nullSafeImmutableCopy(nameserverHostNames); } public ImmutableSet> getNameservers() { @@ -373,7 +370,7 @@ public class DomainCommand { /** Creates a copy of this {@link AddRemove} with hard links to hosts and contacts. */ private AddRemove cloneAndLinkReferences(DateTime now) throws InvalidReferencesException { AddRemove clone = clone(this); - clone.nameservers = linkHosts(clone.nameserverFullyQualifiedHostNames, now); + clone.nameservers = linkHosts(clone.nameserverHostNames, now); clone.contacts = linkContacts(clone.foreignKeyedDesignatedContacts, now); return clone; } @@ -412,13 +409,12 @@ public class DomainCommand { } } - private static Set> linkHosts(Set fullyQualifiedHostNames, DateTime now) + private static Set> linkHosts(Set hostNames, DateTime now) throws InvalidReferencesException { - if (fullyQualifiedHostNames == null) { + if (hostNames == null) { return null; } - return ImmutableSet.copyOf( - loadByForeignKeysCached(fullyQualifiedHostNames, Host.class, now).values()); + return ImmutableSet.copyOf(loadByForeignKeysCached(hostNames, Host.class, now).values()); } private static Set linkContacts( diff --git a/core/src/main/java/google/registry/model/domain/DomainHistory.java b/core/src/main/java/google/registry/model/domain/DomainHistory.java index e752c9995..e494bccb8 100644 --- a/core/src/main/java/google/registry/model/domain/DomainHistory.java +++ b/core/src/main/java/google/registry/model/domain/DomainHistory.java @@ -25,7 +25,7 @@ import google.registry.model.EppResource; import google.registry.model.ImmutableObject; import google.registry.model.domain.DomainHistory.DomainHistoryId; import google.registry.model.domain.GracePeriod.GracePeriodHistory; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.domain.secdns.DomainDsDataHistory; import google.registry.model.host.Host; import google.registry.model.reporting.DomainTransactionRecord; @@ -280,7 +280,7 @@ public class DomainHistory extends HistoryEntry { .map(GracePeriod::createFromHistory) .collect(toImmutableSet()); domainBase.dsData = - dsDataHistories.stream().map(DelegationSignerData::create).collect(toImmutableSet()); + dsDataHistories.stream().map(DomainDsData::create).collect(toImmutableSet()); // Normally Hibernate would see that the domain fields are all null and would fill // domainBase with a null object. Unfortunately, the updateTimestamp is never null in SQL. if (domainBase.getDomainName() == null) { diff --git a/core/src/main/java/google/registry/model/domain/DomainInfoData.java b/core/src/main/java/google/registry/model/domain/DomainInfoData.java index 810eac878..02c7116c6 100644 --- a/core/src/main/java/google/registry/model/domain/DomainInfoData.java +++ b/core/src/main/java/google/registry/model/domain/DomainInfoData.java @@ -30,28 +30,30 @@ import org.joda.time.DateTime; /** The {@link ResponseData} returned for an EPP info flow on a domain. */ @XmlRootElement(name = "infData") -@XmlType(propOrder = { - "fullyQualifiedDomainName", - "repoId", - "statusValues", - "registrant", - "contacts", - "nameservers", - "subordinateHosts", - "currentSponsorClientId", - "creationClientId", - "creationTime", - "lastEppUpdateClientId", - "lastEppUpdateTime", - "registrationExpirationTime", - "lastTransferTime", - "authInfo"}) +@XmlType( + propOrder = { + "domainName", + "repoId", + "statusValues", + "registrant", + "contacts", + "nameservers", + "subordinateHosts", + "currentSponsorClientId", + "creationClientId", + "creationTime", + "lastEppUpdateClientId", + "lastEppUpdateTime", + "registrationExpirationTime", + "lastTransferTime", + "authInfo" + }) @AutoValue @CopyAnnotations public abstract class DomainInfoData implements ResponseData { @XmlElement(name = "name") - abstract String getFullyQualifiedDomainName(); + abstract String getDomainName(); @XmlElement(name = "roid") abstract String getRepoId(); @@ -110,7 +112,8 @@ public abstract class DomainInfoData implements ResponseData { /** Builder for {@link DomainInfoData}. */ @AutoValue.Builder public abstract static class Builder { - public abstract Builder setFullyQualifiedDomainName(String fullyQualifiedDomainName); + public abstract Builder setDomainName(String domainName); + public abstract Builder setRepoId(String repoId); public abstract Builder setStatusValues(@Nullable ImmutableSet statusValues); public abstract Builder setRegistrant(String registrant); diff --git a/core/src/main/java/google/registry/model/domain/secdns/DelegationSignerData.java b/core/src/main/java/google/registry/model/domain/secdns/DomainDsData.java similarity index 85% rename from core/src/main/java/google/registry/model/domain/secdns/DelegationSignerData.java rename to core/src/main/java/google/registry/model/domain/secdns/DomainDsData.java index 066d784a1..df1ac2610 100644 --- a/core/src/main/java/google/registry/model/domain/secdns/DelegationSignerData.java +++ b/core/src/main/java/google/registry/model/domain/secdns/DomainDsData.java @@ -17,7 +17,7 @@ package google.registry.model.domain.secdns; import static google.registry.util.PreconditionsUtils.checkArgumentNotNull; import google.registry.model.ImmutableObject; -import google.registry.model.domain.secdns.DelegationSignerData.DomainDsDataId; +import google.registry.model.domain.secdns.DomainDsData.DomainDsDataId; import java.io.Serializable; import javax.persistence.Access; import javax.persistence.AccessType; @@ -34,15 +34,14 @@ import javax.xml.bind.annotation.XmlType; * * @see RFC 5910 * @see RFC 4034 - *

TODO(b/177567432): Rename this class to DomainDsData. */ @XmlType(name = "dsData") @Entity @IdClass(DomainDsDataId.class) -@Table(indexes = @Index(columnList = "domainRepoId")) -public class DelegationSignerData extends DomainDsDataBase { +@Table(name = "DelegationSignerData", indexes = @Index(columnList = "domainRepoId")) +public class DomainDsData extends DomainDsDataBase { - private DelegationSignerData() {} + private DomainDsData() {} @Override @Id @@ -79,21 +78,21 @@ public class DelegationSignerData extends DomainDsDataBase { return super.getDigest(); } - public DelegationSignerData cloneWithDomainRepoId(String domainRepoId) { - DelegationSignerData clone = clone(this); + public DomainDsData cloneWithDomainRepoId(String domainRepoId) { + DomainDsData clone = clone(this); clone.domainRepoId = checkArgumentNotNull(domainRepoId); return clone; } - public DelegationSignerData cloneWithoutDomainRepoId() { - DelegationSignerData clone = clone(this); + public DomainDsData cloneWithoutDomainRepoId() { + DomainDsData clone = clone(this); clone.domainRepoId = null; return clone; } - public static DelegationSignerData create( + public static DomainDsData create( int keyTag, int algorithm, int digestType, byte[] digest, String domainRepoId) { - DelegationSignerData instance = new DelegationSignerData(); + DomainDsData instance = new DomainDsData(); instance.keyTag = keyTag; instance.algorithm = algorithm; instance.digestType = digestType; @@ -102,17 +101,15 @@ public class DelegationSignerData extends DomainDsDataBase { return instance; } - public static DelegationSignerData create( - int keyTag, int algorithm, int digestType, byte[] digest) { + public static DomainDsData create(int keyTag, int algorithm, int digestType, byte[] digest) { return create(keyTag, algorithm, digestType, digest, null); } - public static DelegationSignerData create( - int keyTag, int algorithm, int digestType, String digestAsHex) { + public static DomainDsData create(int keyTag, int algorithm, int digestType, String digestAsHex) { return create(keyTag, algorithm, digestType, DatatypeConverter.parseHexBinary(digestAsHex)); } - public static DelegationSignerData create(DomainDsDataHistory history) { + public static DomainDsData create(DomainDsDataHistory history) { return create( history.keyTag, history.algorithm, @@ -121,7 +118,7 @@ public class DelegationSignerData extends DomainDsDataBase { history.domainRepoId); } - /** Class to represent the composite primary key of {@link DelegationSignerData} entity. */ + /** Class to represent the composite primary key of {@link DomainDsData} entity. */ static class DomainDsDataId extends ImmutableObject implements Serializable { String domainRepoId; diff --git a/core/src/main/java/google/registry/model/domain/secdns/DomainDsDataBase.java b/core/src/main/java/google/registry/model/domain/secdns/DomainDsDataBase.java index b5821d68a..4c5e517ff 100644 --- a/core/src/main/java/google/registry/model/domain/secdns/DomainDsDataBase.java +++ b/core/src/main/java/google/registry/model/domain/secdns/DomainDsDataBase.java @@ -26,7 +26,7 @@ import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.adapters.HexBinaryAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -/** Base class for {@link DelegationSignerData} and {@link DomainDsDataHistory}. */ +/** Base class for {@link DomainDsData} and {@link DomainDsDataHistory}. */ @MappedSuperclass @Access(AccessType.FIELD) public abstract class DomainDsDataBase extends ImmutableObject implements UnsafeSerializable { diff --git a/core/src/main/java/google/registry/model/domain/secdns/DomainDsDataHistory.java b/core/src/main/java/google/registry/model/domain/secdns/DomainDsDataHistory.java index bcdf392dc..0c9ce94a8 100644 --- a/core/src/main/java/google/registry/model/domain/secdns/DomainDsDataHistory.java +++ b/core/src/main/java/google/registry/model/domain/secdns/DomainDsDataHistory.java @@ -25,7 +25,7 @@ import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; -/** Entity class to represent a historic {@link DelegationSignerData}. */ +/** Entity class to represent a historic {@link DomainDsData}. */ @Entity public class DomainDsDataHistory extends DomainDsDataBase implements UnsafeSerializable { @@ -39,10 +39,9 @@ public class DomainDsDataHistory extends DomainDsDataBase implements UnsafeSeria /** * Creates a {@link DomainDsDataHistory} instance from given {@link #domainHistoryRevisionId} and - * {@link DelegationSignerData} instance. + * {@link DomainDsData} instance. */ - public static DomainDsDataHistory createFrom( - long domainHistoryRevisionId, DelegationSignerData dsData) { + public static DomainDsDataHistory createFrom(long domainHistoryRevisionId, DomainDsData dsData) { DomainDsDataHistory instance = new DomainDsDataHistory(); instance.domainHistoryRevisionId = domainHistoryRevisionId; instance.domainRepoId = dsData.domainRepoId; diff --git a/core/src/main/java/google/registry/model/domain/secdns/SecDnsCreateExtension.java b/core/src/main/java/google/registry/model/domain/secdns/SecDnsCreateExtension.java index 79ecafdec..e54c7f98b 100644 --- a/core/src/main/java/google/registry/model/domain/secdns/SecDnsCreateExtension.java +++ b/core/src/main/java/google/registry/model/domain/secdns/SecDnsCreateExtension.java @@ -36,13 +36,13 @@ public class SecDnsCreateExtension extends ImmutableObject implements CommandExt Long maxSigLife; /** Signatures for this domain. */ - Set dsData; + Set dsData; public Long getMaxSigLife() { return maxSigLife; } - public ImmutableSet getDsData() { + public ImmutableSet getDsData() { return nullSafeImmutableCopy(dsData); } } diff --git a/core/src/main/java/google/registry/model/domain/secdns/SecDnsInfoExtension.java b/core/src/main/java/google/registry/model/domain/secdns/SecDnsInfoExtension.java index 4e15a6720..250763104 100644 --- a/core/src/main/java/google/registry/model/domain/secdns/SecDnsInfoExtension.java +++ b/core/src/main/java/google/registry/model/domain/secdns/SecDnsInfoExtension.java @@ -24,9 +24,9 @@ import javax.xml.bind.annotation.XmlRootElement; public class SecDnsInfoExtension extends ImmutableObject implements ResponseExtension { /** Signatures for this domain. */ - ImmutableSet dsData; + ImmutableSet dsData; - public static SecDnsInfoExtension create(ImmutableSet dsData) { + public static SecDnsInfoExtension create(ImmutableSet dsData) { SecDnsInfoExtension instance = new SecDnsInfoExtension(); instance.dsData = dsData; return instance; diff --git a/core/src/main/java/google/registry/model/domain/secdns/SecDnsUpdateExtension.java b/core/src/main/java/google/registry/model/domain/secdns/SecDnsUpdateExtension.java index 975e540a1..9ff2840b8 100644 --- a/core/src/main/java/google/registry/model/domain/secdns/SecDnsUpdateExtension.java +++ b/core/src/main/java/google/registry/model/domain/secdns/SecDnsUpdateExtension.java @@ -70,9 +70,9 @@ public class SecDnsUpdateExtension extends ImmutableObject implements CommandExt @XmlTransient abstract static class AddRemoveBase extends ImmutableObject { /** Delegations to add or remove. */ - Set dsData; + Set dsData; - public ImmutableSet getDsData() { + public ImmutableSet getDsData() { return nullToEmptyImmutableCopy(dsData); } } 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 868d23131..b4b44b59f 100644 --- a/core/src/main/java/google/registry/model/host/HostBase.java +++ b/core/src/main/java/google/registry/model/host/HostBase.java @@ -35,7 +35,6 @@ 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,10 +63,7 @@ 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. */ - // TODO(b/177567432): Rename this to hostName when we are off Datastore - @Index - @Column(name = "hostName") - String fullyQualifiedHostName; + @Index String hostName; /** IP Addresses for this host. Can be null if this is an external host. */ @Index Set inetAddresses; @@ -95,7 +91,7 @@ public class HostBase extends EppResource { DateTime lastSuperordinateChange; public String getHostName() { - return fullyQualifiedHostName; + return hostName; } public VKey getSuperordinateDomain() { @@ -120,7 +116,7 @@ public class HostBase extends EppResource { @Override public String getForeignKey() { - return fullyQualifiedHostName; + return hostName; } @Override @@ -197,7 +193,7 @@ public class HostBase extends EppResource { hostName.equals(canonicalizeHostname(hostName)), "Host name %s not in puny-coded, lower-case form", hostName); - getInstance().fullyQualifiedHostName = hostName; + getInstance().hostName = hostName; return thisCastToDerived(); } diff --git a/core/src/main/java/google/registry/model/host/HostCommand.java b/core/src/main/java/google/registry/model/host/HostCommand.java index 7d584572f..ae77d4f5a 100644 --- a/core/src/main/java/google/registry/model/host/HostCommand.java +++ b/core/src/main/java/google/registry/model/host/HostCommand.java @@ -36,7 +36,7 @@ public class HostCommand { @XmlTransient abstract static class HostCreateOrChange extends AbstractSingleResourceCommand implements ResourceCreateOrChange { - public String getFullyQualifiedHostName() { + public String getHostName() { return getTargetId(); } } diff --git a/core/src/main/java/google/registry/model/host/HostInfoData.java b/core/src/main/java/google/registry/model/host/HostInfoData.java index fde7b6bad..8358c6e62 100644 --- a/core/src/main/java/google/registry/model/host/HostInfoData.java +++ b/core/src/main/java/google/registry/model/host/HostInfoData.java @@ -28,23 +28,25 @@ import org.joda.time.DateTime; /** The {@link ResponseData} returned for an EPP info flow on a host. */ @XmlRootElement(name = "infData") -@XmlType(propOrder = { - "fullyQualifiedHostName", - "repoId", - "statusValues", - "inetAddresses", - "currentSponsorClientId", - "creationClientId", - "creationTime", - "lastEppUpdateClientId", - "lastEppUpdateTime", - "lastTransferTime" }) +@XmlType( + propOrder = { + "hostName", + "repoId", + "statusValues", + "inetAddresses", + "currentSponsorClientId", + "creationClientId", + "creationTime", + "lastEppUpdateClientId", + "lastEppUpdateTime", + "lastTransferTime" + }) @AutoValue @CopyAnnotations public abstract class HostInfoData implements ResponseData { @XmlElement(name = "name") - abstract String getFullyQualifiedHostName(); + abstract String getHostName(); @XmlElement(name = "roid") abstract String getRepoId(); @@ -79,7 +81,8 @@ public abstract class HostInfoData implements ResponseData { /** Builder for {@link HostInfoData}. */ @AutoValue.Builder public abstract static class Builder { - public abstract Builder setFullyQualifiedHostName(String fullyQualifiedHostName); + public abstract Builder setHostName(String hostName); + public abstract Builder setRepoId(String repoId); public abstract Builder setStatusValues(ImmutableSet statusValues); public abstract Builder setInetAddresses(ImmutableSet inetAddresses); diff --git a/core/src/main/java/google/registry/model/poll/PendingActionNotificationResponse.java b/core/src/main/java/google/registry/model/poll/PendingActionNotificationResponse.java index 1f463fd30..97078c7ca 100644 --- a/core/src/main/java/google/registry/model/poll/PendingActionNotificationResponse.java +++ b/core/src/main/java/google/registry/model/poll/PendingActionNotificationResponse.java @@ -91,10 +91,10 @@ public class PendingActionNotificationResponse extends ImmutableObject } public static DomainPendingActionNotificationResponse create( - String fullyQualifiedDomainName, boolean actionResult, Trid trid, DateTime processedDate) { + String domainName, boolean actionResult, Trid trid, DateTime processedDate) { return init( new DomainPendingActionNotificationResponse(), - fullyQualifiedDomainName, + domainName, actionResult, trid, processedDate); @@ -140,13 +140,9 @@ public class PendingActionNotificationResponse extends ImmutableObject } public static HostPendingActionNotificationResponse create( - String fullyQualifiedHostName, boolean actionResult, Trid trid, DateTime processedDate) { + String hostName, boolean actionResult, Trid trid, DateTime processedDate) { return init( - new HostPendingActionNotificationResponse(), - fullyQualifiedHostName, - actionResult, - trid, - processedDate); + new HostPendingActionNotificationResponse(), hostName, actionResult, trid, processedDate); } } } diff --git a/core/src/main/java/google/registry/model/poll/PollMessage.java b/core/src/main/java/google/registry/model/poll/PollMessage.java index b4052c964..b52c75c95 100644 --- a/core/src/main/java/google/registry/model/poll/PollMessage.java +++ b/core/src/main/java/google/registry/model/poll/PollMessage.java @@ -386,7 +386,7 @@ public abstract class PollMessage extends ImmutableObject TransferResponse transferResponse; @Column(name = "transfer_response_domain_name") - String fullyQualifiedDomainName; + String domainName; @Column(name = "transfer_response_domain_expiration_time") DateTime extendedRegistrationExpirationTime; @@ -427,7 +427,7 @@ public abstract class PollMessage extends ImmutableObject pendingActionNotificationResponse.getActionResult(), pendingActionNotificationResponse.getTrid(), pendingActionNotificationResponse.processedDate); - } else if (fullyQualifiedDomainName != null) { + } else if (domainName != null) { pendingActionNotificationResponse = DomainPendingActionNotificationResponse.create( pendingActionNotificationResponse.nameOrId.value, @@ -457,10 +457,10 @@ public abstract class PollMessage extends ImmutableObject .setPendingTransferExpirationTime( transferResponse.getPendingTransferExpirationTime()) .build(); - } else if (fullyQualifiedDomainName != null) { + } else if (domainName != null) { transferResponse = new DomainTransferResponse.Builder() - .setFullyQualifiedDomainName(fullyQualifiedDomainName) + .setDomainName(domainName) .setGainingRegistrarId(transferResponse.getGainingRegistrarId()) .setLosingRegistrarId(transferResponse.getLosingRegistrarId()) .setTransferStatus(transferResponse.getTransferStatus()) @@ -486,7 +486,7 @@ public abstract class PollMessage extends ImmutableObject OneTime instance = getInstance(); // Note: In its current form, the code will basically just ignore everything but the first // PendingActionNotificationResponse and TransferResponse in responseData, and will override - // any identifier fields (e.g. contactId, fullyQualifiedDomainName) obtained from the + // any identifier fields (e.g. contactId, domainName) obtained from the // PendingActionNotificationResponse if a TransferResponse is found with different values // for those fields. It is not clear what the constraints should be on this data or // whether we should enforce them here, though historically we have not, so the current @@ -507,8 +507,7 @@ public abstract class PollMessage extends ImmutableObject instance.contactId = instance.pendingActionNotificationResponse.nameOrId.value; } else if (instance.pendingActionNotificationResponse instanceof DomainPendingActionNotificationResponse) { - instance.fullyQualifiedDomainName = - instance.pendingActionNotificationResponse.nameOrId.value; + instance.domainName = instance.pendingActionNotificationResponse.nameOrId.value; } else if (instance.pendingActionNotificationResponse instanceof HostPendingActionNotificationResponse) { instance.hostId = instance.pendingActionNotificationResponse.nameOrId.value; @@ -527,7 +526,7 @@ public abstract class PollMessage extends ImmutableObject instance.contactId = ((ContactTransferResponse) instance.transferResponse).getContactId(); } else if (instance.transferResponse instanceof DomainTransferResponse) { DomainTransferResponse response = (DomainTransferResponse) instance.transferResponse; - instance.fullyQualifiedDomainName = response.getFullyQualifiedDomainName(); + instance.domainName = response.getDomainName(); instance.extendedRegistrationExpirationTime = response.getExtendedRegistrationExpirationTime(); } diff --git a/core/src/main/java/google/registry/model/pricing/PremiumPricingEngine.java b/core/src/main/java/google/registry/model/pricing/PremiumPricingEngine.java index cbabe8d79..ff62793e4 100644 --- a/core/src/main/java/google/registry/model/pricing/PremiumPricingEngine.java +++ b/core/src/main/java/google/registry/model/pricing/PremiumPricingEngine.java @@ -28,10 +28,10 @@ public interface PremiumPricingEngine { /** * Returns the prices for the given fully qualified domain name at the given time. * - *

Note that the fullyQualifiedDomainName must only contain a single part left of the TLD, i.e. - * subdomains are not allowed, but multi-part TLDs are. + *

Note that the domainName must only contain a single part left of the TLD, i.e. subdomains + * are not allowed, but multi-part TLDs are. */ - DomainPrices getDomainPrices(String fullyQualifiedDomainName, DateTime priceTime); + DomainPrices getDomainPrices(String domainName, DateTime priceTime); /** * A class containing information on premium prices for a specific domain name. diff --git a/core/src/main/java/google/registry/model/pricing/StaticPremiumListPricingEngine.java b/core/src/main/java/google/registry/model/pricing/StaticPremiumListPricingEngine.java index 5ce94806d..959786d1f 100644 --- a/core/src/main/java/google/registry/model/pricing/StaticPremiumListPricingEngine.java +++ b/core/src/main/java/google/registry/model/pricing/StaticPremiumListPricingEngine.java @@ -34,9 +34,9 @@ public final class StaticPremiumListPricingEngine implements PremiumPricingEngin @Inject StaticPremiumListPricingEngine() {} @Override - public DomainPrices getDomainPrices(String fullyQualifiedDomainName, DateTime priceTime) { - String tld = getTldFromDomainName(fullyQualifiedDomainName); - String label = InternetDomainName.from(fullyQualifiedDomainName).parts().get(0); + public DomainPrices getDomainPrices(String domainName, DateTime priceTime) { + String tld = getTldFromDomainName(domainName); + String label = InternetDomainName.from(domainName).parts().get(0); Registry registry = Registry.get(checkNotNull(tld, "tld")); Optional premiumPrice = registry.getPremiumListName().flatMap(pl -> PremiumListDao.getPremiumPrice(pl, label)); diff --git a/core/src/main/java/google/registry/model/registrar/Registrar.java b/core/src/main/java/google/registry/model/registrar/Registrar.java index 0a811dbec..1d7659686 100644 --- a/core/src/main/java/google/registry/model/registrar/Registrar.java +++ b/core/src/main/java/google/registry/model/registrar/Registrar.java @@ -207,11 +207,10 @@ public class Registrar extends ImmutableObject * Unique registrar client id. Must conform to "clIDType" as defined in RFC5730. * * @see Shared Structure Schema - *

TODO(b/177567432): Rename this field to registrarId. */ @Id - @Column(name = "registrarId", nullable = false) - String clientIdentifier; + @Column(nullable = false) + String registrarId; /** * Registrar name. This is a distinct from the client identifier since there are no restrictions @@ -270,9 +269,7 @@ public class Registrar extends ImmutableObject String failoverClientCertificateHash; /** An allow list of netmasks (in CIDR notation) which the client is allowed to connect from. */ - // TODO(b/177567432): Rename to ipAddressAllowList once Cloud SQL migration is complete. - @Column(name = "ip_address_allow_list") - List ipAddressWhitelist; + List ipAddressAllowList; /** A hashed password for EPP access. The hash is a base64 encoded SHA256 string. */ String passwordHash; @@ -408,7 +405,7 @@ public class Registrar extends ImmutableObject boolean registryLockAllowed = false; public String getRegistrarId() { - return clientIdentifier; + return registrarId; } public DateTime getCreationTime() { @@ -498,7 +495,7 @@ public class Registrar extends ImmutableObject } public ImmutableList getIpAddressAllowList() { - return nullToEmptyImmutableCopy(ipAddressWhitelist); + return nullToEmptyImmutableCopy(ipAddressAllowList); } public RegistrarAddress getLocalizedAddress() { @@ -587,7 +584,7 @@ public class Registrar extends ImmutableObject () -> jpaTm() .query("FROM RegistrarPoc WHERE registrarId = :registrarId", RegistrarPoc.class) - .setParameter("registrarId", clientIdentifier) + .setParameter("registrarId", registrarId) .getResultStream() .collect(toImmutableList())); } @@ -595,7 +592,7 @@ public class Registrar extends ImmutableObject @Override public Map toJsonMap() { return new JsonMapBuilder() - .put("clientIdentifier", clientIdentifier) + .put("registrarId", registrarId) .put("ianaIdentifier", ianaIdentifier) .putString("creationTime", creationTime.getTimestamp()) .putString("lastUpdateTime", lastUpdateTime.getTimestamp()) @@ -655,7 +652,7 @@ public class Registrar extends ImmutableObject /** Creates a {@link VKey} for this instance. */ @Override public VKey createVKey() { - return createVKey(clientIdentifier); + return createVKey(registrarId); } /** Creates a {@link VKey} for the given {@code registrarId}. */ @@ -678,7 +675,7 @@ public class Registrar extends ImmutableObject checkArgument( Range.closed(3, 16).contains(registrarId.length()), "Registrar ID must be 3-16 characters long."); - getInstance().clientIdentifier = registrarId; + getInstance().registrarId = registrarId; return this; } @@ -796,7 +793,7 @@ public class Registrar extends ImmutableObject } public Builder setIpAddressAllowList(Iterable ipAddressAllowList) { - getInstance().ipAddressWhitelist = ImmutableList.copyOf(ipAddressAllowList); + getInstance().ipAddressAllowList = ImmutableList.copyOf(ipAddressAllowList); return this; } diff --git a/core/src/main/java/google/registry/model/tmch/ClaimsList.java b/core/src/main/java/google/registry/model/tmch/ClaimsList.java index f4c428d1e..85ecc91cb 100644 --- a/core/src/main/java/google/registry/model/tmch/ClaimsList.java +++ b/core/src/main/java/google/registry/model/tmch/ClaimsList.java @@ -72,11 +72,9 @@ public class ClaimsList extends ImmutableObject { *

Note that the value of this field is parsed from the claims list file(See this RFC), it is * the DNL List creation datetime from the rfc. - * - *

TODO(b/177567432): Rename this field to tmdbGenerationTime. */ - @Column(name = "tmdb_generation_time", nullable = false) - DateTime creationTime; + @Column(nullable = false) + DateTime tmdbGenerationTime; /** * A map from labels to claims keys. @@ -143,7 +141,7 @@ public class ClaimsList extends ImmutableObject { * creation datetime */ public DateTime getTmdbGenerationTime() { - return creationTime; + return tmdbGenerationTime; } /** Returns the creation time of this claims list. */ @@ -225,7 +223,7 @@ public class ClaimsList extends ImmutableObject { public static ClaimsList create( DateTime tmdbGenerationTime, ImmutableMap labelsToKeys) { ClaimsList instance = new ClaimsList(); - instance.creationTime = checkNotNull(tmdbGenerationTime); + instance.tmdbGenerationTime = checkNotNull(tmdbGenerationTime); instance.labelsToKeys = checkNotNull(labelsToKeys); return instance; } diff --git a/core/src/main/java/google/registry/model/transfer/TransferResponse.java b/core/src/main/java/google/registry/model/transfer/TransferResponse.java index c72ab210e..58129998f 100644 --- a/core/src/main/java/google/registry/model/transfer/TransferResponse.java +++ b/core/src/main/java/google/registry/model/transfer/TransferResponse.java @@ -33,22 +33,24 @@ public class TransferResponse extends BaseTransferObject implements ResponseData /** An adapter to output the XML in response to a transfer command on a domain. */ @XmlRootElement(name = "trnData", namespace = "urn:ietf:params:xml:ns:domain-1.0") - @XmlType(propOrder = { - "fullyQualifiedDomainName", - "transferStatus", - "gainingClientId", - "transferRequestTime", - "losingClientId", - "pendingTransferExpirationTime", - "extendedRegistrationExpirationTime"}, - namespace = "urn:ietf:params:xml:ns:domain-1.0") + @XmlType( + propOrder = { + "domainName", + "transferStatus", + "gainingClientId", + "transferRequestTime", + "losingClientId", + "pendingTransferExpirationTime", + "extendedRegistrationExpirationTime" + }, + namespace = "urn:ietf:params:xml:ns:domain-1.0") public static class DomainTransferResponse extends TransferResponse { @XmlElement(name = "name") - String fullyQualifiedDomainName; + String domainName; - public String getFullyQualifiedDomainName() { - return fullyQualifiedDomainName; + public String getDomainName() { + return domainName; } /** @@ -65,8 +67,8 @@ public class TransferResponse extends BaseTransferObject implements ResponseData /** Builder for {@link DomainTransferResponse}. */ public static class Builder extends BaseTransferObject.Builder { - public Builder setFullyQualifiedDomainName(String fullyQualifiedDomainName) { - getInstance().fullyQualifiedDomainName = fullyQualifiedDomainName; + public Builder setDomainName(String domainName) { + getInstance().domainName = domainName; return this; } diff --git a/core/src/main/java/google/registry/persistence/transaction/JpaTransactionManager.java b/core/src/main/java/google/registry/persistence/transaction/JpaTransactionManager.java index a79c37c18..9a5b8964c 100644 --- a/core/src/main/java/google/registry/persistence/transaction/JpaTransactionManager.java +++ b/core/src/main/java/google/registry/persistence/transaction/JpaTransactionManager.java @@ -61,7 +61,7 @@ public interface JpaTransactionManager extends TransactionManager { */ TypedQuery query(String sqlString, Class resultClass); - /** Creates a JPA SQU query for the given criteria query. */ + /** Creates a JPA SQL query for the given criteria query. */ TypedQuery criteriaQuery(CriteriaQuery criteriaQuery); /** diff --git a/core/src/main/java/google/registry/rdap/RdapDomainSearchAction.java b/core/src/main/java/google/registry/rdap/RdapDomainSearchAction.java index 8bafb6f7e..71a98dc1f 100644 --- a/core/src/main/java/google/registry/rdap/RdapDomainSearchAction.java +++ b/core/src/main/java/google/registry/rdap/RdapDomainSearchAction.java @@ -199,13 +199,12 @@ public class RdapDomainSearchAction extends RdapSearchActionBase { final RdapSearchPattern partialStringQuery) { // We can't query for undeleted domains as part of the query itself; that would require an // inequality query on deletion time, and we are already using inequality queries on - // fullyQualifiedDomainName. So we instead pick an arbitrary limit of - // RESULT_SET_SIZE_SCALING_FACTOR times the result set size limit, fetch up to that many, and - // weed out all deleted domains. If there still isn't a full result set's worth of domains, we - // give up and return just the ones we found. Don't use queryItems, because it checks that the - // initial string is at least a certain length, which we don't need in this case. Query the - // domains directly, rather than the foreign keys, because then we have an index on TLD if we - // need it. + // domainName. So we instead pick an arbitrary limit of RESULT_SET_SIZE_SCALING_FACTOR times the + // result set size limit, fetch up to that many, and weed out all deleted domains. If there + // still isn't a full result set's worth of domains, we give up and return just the ones we + // found. Don't use queryItems, because it checks that the initial string is at least a certain + // length, which we don't need in this case. Query the domains directly, rather than the foreign + // keys, because then we have an index on TLD if we need it. int querySizeLimit = RESULT_SET_SIZE_SCALING_FACTOR * rdapResultSetMaxSize; RdapResultSet resultSet; if (tm().isOfy()) { @@ -213,10 +212,10 @@ public class RdapDomainSearchAction extends RdapSearchActionBase { auditedOfy() .load() .type(Domain.class) - .filter("fullyQualifiedDomainName <", partialStringQuery.getNextInitialString()) - .filter("fullyQualifiedDomainName >=", partialStringQuery.getInitialString()); + .filter("domainName <", partialStringQuery.getNextInitialString()) + .filter("domainName >=", partialStringQuery.getInitialString()); if (cursorString.isPresent()) { - query = query.filter("fullyQualifiedDomainName >", cursorString.get()); + query = query.filter("domainName >", cursorString.get()); } if (partialStringQuery.getSuffix() != null) { query = query.filter("tld", partialStringQuery.getSuffix()); @@ -234,16 +233,14 @@ public class RdapDomainSearchAction extends RdapSearchActionBase { CriteriaQueryBuilder queryBuilder = CriteriaQueryBuilder.create(replicaJpaTm(), Domain.class) .where( - "fullyQualifiedDomainName", + "domainName", criteriaBuilder::like, String.format("%s%%", partialStringQuery.getInitialString())) - .orderByAsc("fullyQualifiedDomainName"); + .orderByAsc("domainName"); if (cursorString.isPresent()) { queryBuilder = queryBuilder.where( - "fullyQualifiedDomainName", - criteriaBuilder::greaterThan, - cursorString.get()); + "domainName", criteriaBuilder::greaterThan, cursorString.get()); } if (partialStringQuery.getSuffix() != null) { queryBuilder = @@ -258,18 +255,18 @@ public class RdapDomainSearchAction extends RdapSearchActionBase { /** Searches for domains by domain name with a TLD suffix. */ private DomainSearchResponse searchByDomainNameByTld(String tld) { - // Even though we are not searching on fullyQualifiedDomainName, we want the results to come - // back ordered by name, so we are still in the same boat as - // searchByDomainNameWithInitialString, unable to perform an inequality query on deletion time. - // Don't use queryItems, because it doesn't handle pending deletes. + // Even though we are not searching on domainName, we want the results to come back ordered by + // name, so we are still in the same boat as searchByDomainNameWithInitialString, unable to + // perform an inequality query on deletion time. Don't use queryItems, because it doesn't handle + // pending deletes. int querySizeLimit = RESULT_SET_SIZE_SCALING_FACTOR * rdapResultSetMaxSize; RdapResultSet resultSet; if (tm().isOfy()) { Query query = auditedOfy().load().type(Domain.class).filter("tld", tld); if (cursorString.isPresent()) { - query = query.filter("fullyQualifiedDomainName >", cursorString.get()); + query = query.filter("domainName >", cursorString.get()); } - query = query.order("fullyQualifiedDomainName").limit(querySizeLimit); + query = query.order("domainName").limit(querySizeLimit); resultSet = getMatchingResources(query, true, querySizeLimit); } else { resultSet = @@ -281,10 +278,10 @@ public class RdapDomainSearchAction extends RdapSearchActionBase { Domain.class, "tld", tld, - Optional.of("fullyQualifiedDomainName"), + Optional.of("domainName"), cursorString, DeletedItemHandling.INCLUDE) - .orderByAsc("fullyQualifiedDomainName"); + .orderByAsc("domainName"); return getMatchingResourcesSql(builder, true, querySizeLimit); }); } @@ -344,7 +341,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase { Query query = queryItems( Host.class, - "fullyQualifiedHostName", + "hostName", partialStringQuery, Optional.empty(), DeletedItemHandling.EXCLUDE, @@ -362,7 +359,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase { CriteriaQueryBuilder builder = queryItemsSql( Host.class, - "fullyQualifiedHostName", + "hostName", partialStringQuery, Optional.empty(), DeletedItemHandling.EXCLUDE); @@ -558,7 +555,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase { // If we are not performing an inequality query, we can filter on the cursor in the query. // Otherwise, we will need to filter the results afterward. } else if (cursorString.isPresent()) { - query = query.filter("fullyQualifiedDomainName >", cursorString.get()); + query = query.filter("domainName >", cursorString.get()); } Stream stream = Streams.stream(query).filter(this::isAuthorized); if (cursorString.isPresent()) { @@ -574,7 +571,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase { CriteriaQueryBuilder queryBuilder = CriteriaQueryBuilder.create(replicaJpaTm(), Domain.class) .whereFieldContains("nsHosts", hostKey) - .orderByAsc("fullyQualifiedDomainName"); + .orderByAsc("domainName"); CriteriaBuilder criteriaBuilder = replicaJpaTm().getEntityManager().getCriteriaBuilder(); if (!shouldIncludeDeleted()) { @@ -585,9 +582,7 @@ public class RdapDomainSearchAction extends RdapSearchActionBase { if (cursorString.isPresent()) { queryBuilder = queryBuilder.where( - "fullyQualifiedDomainName", - criteriaBuilder::greaterThan, - cursorString.get()); + "domainName", criteriaBuilder::greaterThan, cursorString.get()); } replicaJpaTm() .criteriaQuery(queryBuilder.build()) diff --git a/core/src/main/java/google/registry/rdap/RdapNameserverSearchAction.java b/core/src/main/java/google/registry/rdap/RdapNameserverSearchAction.java index 21992cca3..92d25261c 100644 --- a/core/src/main/java/google/registry/rdap/RdapNameserverSearchAction.java +++ b/core/src/main/java/google/registry/rdap/RdapNameserverSearchAction.java @@ -223,7 +223,7 @@ public class RdapNameserverSearchAction extends RdapSearchActionBase { Query query = queryItems( Host.class, - "fullyQualifiedHostName", + "hostName", partialStringQuery, cursorString, getDeletedItemHandling(), @@ -237,7 +237,7 @@ public class RdapNameserverSearchAction extends RdapSearchActionBase { CriteriaQueryBuilder queryBuilder = queryItemsSql( Host.class, - "fullyQualifiedHostName", + "hostName", partialStringQuery, cursorString, getDeletedItemHandling()); diff --git a/core/src/main/java/google/registry/rdap/RdapObjectClasses.java b/core/src/main/java/google/registry/rdap/RdapObjectClasses.java index 831e6486b..8d1f33b62 100644 --- a/core/src/main/java/google/registry/rdap/RdapObjectClasses.java +++ b/core/src/main/java/google/registry/rdap/RdapObjectClasses.java @@ -25,7 +25,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.rdap.AbstractJsonableObject.RestrictJsonNames; import google.registry.rdap.RdapDataStructures.Event; import google.registry.rdap.RdapDataStructures.EventWithoutActor; @@ -444,7 +444,7 @@ final class RdapObjectClasses { @JsonableElement abstract int digestType(); - static DsData create(DelegationSignerData dsData) { + static DsData create(DomainDsData dsData) { return new AutoValue_RdapObjectClasses_SecureDns_DsData( dsData.getKeyTag(), dsData.getAlgorithm(), @@ -490,7 +490,7 @@ final class RdapObjectClasses { abstract ImmutableList.Builder dsDataBuilder(); - Builder addDsData(DelegationSignerData dsData) { + Builder addDsData(DomainDsData dsData) { dsDataBuilder().add(DsData.create(dsData)); return this; } diff --git a/core/src/main/java/google/registry/rde/DomainToXjcConverter.java b/core/src/main/java/google/registry/rde/DomainToXjcConverter.java index 701a6cf9f..a09e054a5 100644 --- a/core/src/main/java/google/registry/rde/DomainToXjcConverter.java +++ b/core/src/main/java/google/registry/rde/DomainToXjcConverter.java @@ -25,7 +25,7 @@ import google.registry.model.contact.Contact; import google.registry.model.domain.DesignatedContact; import google.registry.model.domain.Domain; import google.registry.model.domain.rgp.GracePeriodStatus; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.StatusValue; import google.registry.model.rde.RdeMode; import google.registry.model.transfer.DomainTransferData; @@ -197,7 +197,7 @@ final class DomainToXjcConverter { // completely useless. if (!model.getDsData().isEmpty()) { XjcSecdnsDsOrKeyType secdns = new XjcSecdnsDsOrKeyType(); - for (DelegationSignerData ds : model.getDsData()) { + for (DomainDsData ds : model.getDsData()) { secdns.getDsDatas().add(convertDelegationSignerData(ds)); } bean.setSecDNS(secdns); @@ -284,8 +284,8 @@ final class DomainToXjcConverter { return bean; } - /** Converts {@link DelegationSignerData} to {@link XjcSecdnsDsDataType}. */ - private static XjcSecdnsDsDataType convertDelegationSignerData(DelegationSignerData model) { + /** Converts {@link DomainDsData} to {@link XjcSecdnsDsDataType}. */ + private static XjcSecdnsDsDataType convertDelegationSignerData(DomainDsData model) { XjcSecdnsDsDataType bean = new XjcSecdnsDsDataType(); bean.setKeyTag(model.getKeyTag()); bean.setAlg((short) model.getAlgorithm()); diff --git a/core/src/main/java/google/registry/reporting/icann/sql/cloud_sql_total_domains.sql b/core/src/main/java/google/registry/reporting/icann/sql/cloud_sql_total_domains.sql index 5e12cbbc5..6dd93d64b 100644 --- a/core/src/main/java/google/registry/reporting/icann/sql/cloud_sql_total_domains.sql +++ b/core/src/main/java/google/registry/reporting/icann/sql/cloud_sql_total_domains.sql @@ -15,7 +15,7 @@ -- Determine the number of domains each registrar sponsors per tld. - -- This is just the number of fullyQualifiedDomainNames under each + -- This is just the number of domainNames under each -- tld-registrar pair. SELECT diff --git a/core/src/main/java/google/registry/reporting/spec11/Spec11EmailUtils.java b/core/src/main/java/google/registry/reporting/spec11/Spec11EmailUtils.java index 6a0a6b3cd..5691db54d 100644 --- a/core/src/main/java/google/registry/reporting/spec11/Spec11EmailUtils.java +++ b/core/src/main/java/google/registry/reporting/spec11/Spec11EmailUtils.java @@ -137,10 +137,7 @@ public class Spec11EmailUtils { threatMatch -> tm() .createQueryComposer(Domain.class) - .where( - "fullyQualifiedDomainName", - Comparator.EQ, - threatMatch.fullyQualifiedDomainName()) + .where("domainName", Comparator.EQ, threatMatch.domainName()) .stream() .anyMatch(Domain::shouldPublishToDns)) .collect(toImmutableList()); @@ -176,7 +173,7 @@ public class Spec11EmailUtils { .map( threatMatch -> ImmutableMap.of( - "fullyQualifiedDomainName", threatMatch.fullyQualifiedDomainName(), + "domainName", threatMatch.domainName(), "threatType", threatMatch.threatType())) .collect(toImmutableList()); diff --git a/core/src/main/java/google/registry/request/auth/AuthenticatedRegistrarAccessor.java b/core/src/main/java/google/registry/request/auth/AuthenticatedRegistrarAccessor.java index 60f982655..f293c9260 100644 --- a/core/src/main/java/google/registry/request/auth/AuthenticatedRegistrarAccessor.java +++ b/core/src/main/java/google/registry/request/auth/AuthenticatedRegistrarAccessor.java @@ -316,7 +316,7 @@ public class AuthenticatedRegistrarAccessor { jpaTm() .query( "SELECT r FROM Registrar r INNER JOIN RegistrarPoc rp ON " - + "r.clientIdentifier = rp.registrarId WHERE rp.gaeUserId = " + + "r.registrarId = rp.registrarId WHERE rp.gaeUserId = " + ":gaeUserId AND r.state != :state", Registrar.class) .setParameter("gaeUserId", user.getUserId()) diff --git a/core/src/main/java/google/registry/tools/UniformRapidSuspensionCommand.java b/core/src/main/java/google/registry/tools/UniformRapidSuspensionCommand.java index 10e77444f..0650bfe73 100644 --- a/core/src/main/java/google/registry/tools/UniformRapidSuspensionCommand.java +++ b/core/src/main/java/google/registry/tools/UniformRapidSuspensionCommand.java @@ -33,7 +33,7 @@ import com.google.common.collect.ImmutableSortedSet; import com.google.template.soy.data.SoyListData; import com.google.template.soy.data.SoyMapData; import google.registry.model.domain.Domain; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.StatusValue; import google.registry.model.host.Host; import google.registry.tools.soy.DomainRenewSoyInfo; @@ -232,7 +232,7 @@ final class UniformRapidSuspensionCommand extends MutatingEppToolCommand { private ImmutableList> getExistingDsData(Domain domain) { ImmutableList.Builder> dsDataJsons = new ImmutableList.Builder(); HexBinaryAdapter hexBinaryAdapter = new HexBinaryAdapter(); - for (DelegationSignerData dsData : domain.getDsData()) { + for (DomainDsData dsData : domain.getDsData()) { dsDataJsons.add( ImmutableMap.of( "keyTag", dsData.getKeyTag(), 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 ba7f254e7..166456c1c 100644 --- a/core/src/main/java/google/registry/tools/server/GenerateZoneFilesAction.java +++ b/core/src/main/java/google/registry/tools/server/GenerateZoneFilesAction.java @@ -30,7 +30,7 @@ import com.google.common.flogger.FluentLogger; import google.registry.config.RegistryConfig.Config; import google.registry.gcs.GcsUtils; import google.registry.model.domain.Domain; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.host.Host; import google.registry.request.Action; import google.registry.request.HttpException.BadRequestException; @@ -241,7 +241,7 @@ public class GenerateZoneFilesAction implements Runnable, JsonActionRunner.JsonA // Load the nameservers at the export time in case they've been renamed or deleted. loadAtPointInTime(nameserver, exportTime).getHostName())); } - for (DelegationSignerData dsData : domain.getDsData()) { + for (DomainDsData dsData : domain.getDsData()) { result.append( String.format( DS_FORMAT, diff --git a/core/src/main/java/google/registry/tools/server/ListDomainsAction.java b/core/src/main/java/google/registry/tools/server/ListDomainsAction.java index a6eecb3b7..92807b143 100644 --- a/core/src/main/java/google/registry/tools/server/ListDomainsAction.java +++ b/core/src/main/java/google/registry/tools/server/ListDomainsAction.java @@ -69,7 +69,7 @@ public final class ListDomainsAction extends ListObjectsAction { @Override public ImmutableSet getPrimaryKeyFields() { - return ImmutableSet.of("fullyQualifiedDomainName"); + return ImmutableSet.of("domainName"); } @Override 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 7c9d27c22..d0e2bb524 100644 --- a/core/src/main/java/google/registry/tools/server/ListHostsAction.java +++ b/core/src/main/java/google/registry/tools/server/ListHostsAction.java @@ -44,7 +44,7 @@ public final class ListHostsAction extends ListObjectsAction { @Override public ImmutableSet getPrimaryKeyFields() { - return ImmutableSet.of("fullyQualifiedHostName"); + return ImmutableSet.of("hostName"); } @Override diff --git a/core/src/main/java/google/registry/tools/server/ListRegistrarsAction.java b/core/src/main/java/google/registry/tools/server/ListRegistrarsAction.java index 799acf607..d8e9fe475 100644 --- a/core/src/main/java/google/registry/tools/server/ListRegistrarsAction.java +++ b/core/src/main/java/google/registry/tools/server/ListRegistrarsAction.java @@ -39,7 +39,7 @@ public final class ListRegistrarsAction extends ListObjectsAction { @Override public ImmutableSet getPrimaryKeyFields() { - return ImmutableSet.of("clientIdentifier"); + return ImmutableSet.of("registrarId"); } @Override @@ -51,7 +51,7 @@ public final class ListRegistrarsAction extends ListObjectsAction { public ImmutableBiMap getFieldAliases() { return ImmutableBiMap.of( "billingId", "billingIdentifier", - "clientId", "clientIdentifier", + "clientId", "registrarId", "premiumNames", "blockPremiumNames"); } 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 6b7c20c75..b47e01606 100644 --- a/core/src/main/java/google/registry/tools/server/RefreshDnsForAllDomainsAction.java +++ b/core/src/main/java/google/registry/tools/server/RefreshDnsForAllDomainsAction.java @@ -82,7 +82,7 @@ public class RefreshDnsForAllDomainsAction implements Runnable { () -> jpaTm() .query( - "SELECT fullyQualifiedDomainName FROM Domain " + "SELECT domainName FROM Domain " + "WHERE tld IN (:tlds) " + "AND deletionTime > :now", String.class) 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 d398baa7a..83f0f789d 100644 --- a/core/src/main/javascript/google/registry/ui/externs/json.js +++ b/core/src/main/javascript/google/registry/ui/externs/json.js @@ -132,7 +132,7 @@ registry.json.Response.prototype.results; /** * @typedef {{ * allowedTlds: !Array, - * clientIdentifier: string, + * registrarId: string, * clientCertificate: string?, * clientCertificateHash: string?, * failoverClientCertificate: string?, diff --git a/core/src/main/resources/META-INF/persistence.xml b/core/src/main/resources/META-INF/persistence.xml index 413c0ff53..0be2ca382 100644 --- a/core/src/main/resources/META-INF/persistence.xml +++ b/core/src/main/resources/META-INF/persistence.xml @@ -50,7 +50,7 @@ google.registry.model.domain.DomainHistory google.registry.model.domain.GracePeriod google.registry.model.domain.GracePeriod$GracePeriodHistory - google.registry.model.domain.secdns.DelegationSignerData + google.registry.model.domain.secdns.DomainDsData google.registry.model.domain.secdns.DomainDsDataHistory google.registry.model.domain.token.AllocationToken google.registry.model.domain.token.PackagePromotion diff --git a/core/src/main/resources/google/registry/beam/invoicing/sql/cloud_sql_billing_events.sql b/core/src/main/resources/google/registry/beam/invoicing/sql/cloud_sql_billing_events.sql index 09f932798..2cf65334c 100644 --- a/core/src/main/resources/google/registry/beam/invoicing/sql/cloud_sql_billing_events.sql +++ b/core/src/main/resources/google/registry/beam/invoicing/sql/cloud_sql_billing_events.sql @@ -26,7 +26,7 @@ -- query's performance and consider switching to using a native query. SELECT b, r FROM BillingEvent b -JOIN Registrar r ON b.clientId = r.clientIdentifier +JOIN Registrar r ON b.clientId = r.registrarId JOIN Domain d ON b.domainRepoId = d.repoId JOIN Tld t ON t.tldStr = d.tld LEFT JOIN BillingCancellation c ON b.id = c.refOneTime diff --git a/core/src/main/resources/google/registry/beam/spec11/sql/domain_name_infos.sql b/core/src/main/resources/google/registry/beam/spec11/sql/domain_name_infos.sql index e644e8540..2f81cb609 100644 --- a/core/src/main/resources/google/registry/beam/spec11/sql/domain_name_infos.sql +++ b/core/src/main/resources/google/registry/beam/spec11/sql/domain_name_infos.sql @@ -19,14 +19,14 @@ -- email address. SELECT - domain.fullyQualifiedDomainName AS domainName, + domain.domainName AS domainName, domain.__key__.name AS domainRepoId, registrar.clientId AS registrarId, COALESCE(registrar.emailAddress, '') AS registrarEmailAddress FROM ( ( SELECT __key__, - fullyQualifiedDomainName, + domainName, currentSponsorClientId, creationTime FROM diff --git a/core/src/main/resources/google/registry/reporting/spec11/soy/Spec11Email.soy b/core/src/main/resources/google/registry/reporting/spec11/soy/Spec11Email.soy index 31d0fb125..4864e8074 100644 --- a/core/src/main/resources/google/registry/reporting/spec11/soy/Spec11Email.soy +++ b/core/src/main/resources/google/registry/reporting/spec11/soy/Spec11Email.soy @@ -122,7 +122,7 @@ {for $threat in $threats} - {$threat['fullyQualifiedDomainName']} + {$threat['domainName']} {$threat['threatType']} {/for} diff --git a/core/src/main/resources/google/registry/ui/soy/registrar/WhoisSettings.soy b/core/src/main/resources/google/registry/ui/soy/registrar/WhoisSettings.soy index aa922bf8e..b7195d098 100644 --- a/core/src/main/resources/google/registry/ui/soy/registrar/WhoisSettings.soy +++ b/core/src/main/resources/google/registry/ui/soy/registrar/WhoisSettings.soy @@ -18,7 +18,7 @@ /** Registrar whois settings page for view and edit. */ {template .settings} - {@param clientIdentifier: string} + {@param registrarId: string} {@param? ianaIdentifier: int} {@param? icannReferralEmail: string} {@param readonly: bool} @@ -40,8 +40,8 @@ {call registry.soy.forms.inputFieldRowWithValue} {param label: 'Name' /} - {param name: 'clientIdentifier' /} - {param value: $clientIdentifier /} + {param name: 'registrarId' /} + {param value: $registrarId /} {param readonly: true /} {/call} {call registry.soy.forms.inputFieldRowWithValue} diff --git a/core/src/test/java/google/registry/beam/common/RegistryJpaReadTest.java b/core/src/test/java/google/registry/beam/common/RegistryJpaReadTest.java index fa4228a85..0d5b822fc 100644 --- a/core/src/test/java/google/registry/beam/common/RegistryJpaReadTest.java +++ b/core/src/test/java/google/registry/beam/common/RegistryJpaReadTest.java @@ -33,7 +33,7 @@ import google.registry.model.domain.DomainAuthInfo; import google.registry.model.domain.GracePeriod; import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.rgp.GracePeriodStatus; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.AuthInfo.PasswordAuth; import google.registry.model.eppcommon.StatusValue; import google.registry.model.registrar.Registrar; @@ -110,7 +110,7 @@ public class RegistryJpaReadTest { Read read = RegistryJpaIO.read( "select d, r.emailAddress from Domain d join Registrar r on" - + " d.currentSponsorClientId = r.clientIdentifier where r.type = :type" + + " d.currentSponsorClientId = r.registrarId where r.type = :type" + " and d.deletionTime > now()", ImmutableMap.of("type", Registrar.Type.REAL), false, @@ -152,7 +152,7 @@ public class RegistryJpaReadTest { Read read = RegistryJpaIO.read( "select d from Domain d join Registrar r on" - + " d.currentSponsorClientId = r.clientIdentifier where r.type = :type" + + " d.currentSponsorClientId = r.registrarId where r.type = :type" + " and d.deletionTime > now()", ImmutableMap.of("type", Registrar.Type.REAL), Domain.class, @@ -200,7 +200,7 @@ public class RegistryJpaReadTest { .setPersistedCurrentSponsorRegistrarId(registrar.getRegistrarId()) .setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1)) .setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password"))) - .setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) + .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2}))) .setLaunchNotice( LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME)) .setSmdId("smdid") diff --git a/core/src/test/java/google/registry/beam/invoicing/InvoicingPipelineTest.java b/core/src/test/java/google/registry/beam/invoicing/InvoicingPipelineTest.java index cc77576d7..c942eff9f 100644 --- a/core/src/test/java/google/registry/beam/invoicing/InvoicingPipelineTest.java +++ b/core/src/test/java/google/registry/beam/invoicing/InvoicingPipelineTest.java @@ -355,7 +355,7 @@ class InvoicingPipelineTest { .isEqualTo( '\n' + "SELECT b, r FROM BillingEvent b\n" - + "JOIN Registrar r ON b.clientId = r.clientIdentifier\n" + + "JOIN Registrar r ON b.clientId = r.registrarId\n" + "JOIN Domain d ON b.domainRepoId = d.repoId\n" + "JOIN Tld t ON t.tldStr = d.tld\n" + "LEFT JOIN BillingCancellation c ON b.id = c.refOneTime\n" diff --git a/core/src/test/java/google/registry/dns/writer/clouddns/CloudDnsWriterTest.java b/core/src/test/java/google/registry/dns/writer/clouddns/CloudDnsWriterTest.java index 1487c8b49..b1b95e8bf 100644 --- a/core/src/test/java/google/registry/dns/writer/clouddns/CloudDnsWriterTest.java +++ b/core/src/test/java/google/registry/dns/writer/clouddns/CloudDnsWriterTest.java @@ -39,7 +39,7 @@ import com.google.common.net.InetAddresses; import com.google.common.util.concurrent.RateLimiter; import google.registry.dns.writer.clouddns.CloudDnsWriter.ZoneStateException; import google.registry.model.domain.Domain; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.StatusValue; import google.registry.model.host.Host; import google.registry.persistence.VKey; @@ -267,7 +267,7 @@ public class CloudDnsWriterTest { for (int i = 0; i < dsRecords; i++) { dsRecordData.add( - DelegationSignerData.create(i, 3, 1, base16().decode("1234567890ABCDEF")).toRrData()); + DomainDsData.create(i, 3, 1, base16().decode("1234567890ABCDEF")).toRrData()); } recordSetBuilder.add( new ResourceRecordSet() @@ -284,10 +284,10 @@ public class CloudDnsWriterTest { /** Returns a domain to be persisted in Datastore. */ private static Domain fakeDomain( String domainName, ImmutableSet nameservers, int numDsRecords) { - ImmutableSet.Builder dsDataBuilder = new ImmutableSet.Builder<>(); + ImmutableSet.Builder dsDataBuilder = new ImmutableSet.Builder<>(); for (int i = 0; i < numDsRecords; i++) { - dsDataBuilder.add(DelegationSignerData.create(i, 3, 1, base16().decode("1234567890ABCDEF"))); + dsDataBuilder.add(DomainDsData.create(i, 3, 1, base16().decode("1234567890ABCDEF"))); } ImmutableSet.Builder> hostRefBuilder = new ImmutableSet.Builder<>(); diff --git a/core/src/test/java/google/registry/dns/writer/dnsupdate/DnsUpdateWriterTest.java b/core/src/test/java/google/registry/dns/writer/dnsupdate/DnsUpdateWriterTest.java index f7c3e0903..62d6c00ea 100644 --- a/core/src/test/java/google/registry/dns/writer/dnsupdate/DnsUpdateWriterTest.java +++ b/core/src/test/java/google/registry/dns/writer/dnsupdate/DnsUpdateWriterTest.java @@ -36,7 +36,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.net.InetAddresses; import google.registry.model.domain.Domain; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.StatusValue; import google.registry.model.host.Host; import google.registry.testing.AppEngineExtension; @@ -177,8 +177,7 @@ public class DnsUpdateWriterTest { .asBuilder() .setNameservers(ImmutableSet.of(persistActiveHost("ns1.example.tld").createVKey())) .setDsData( - ImmutableSet.of( - DelegationSignerData.create(1, 3, 1, base16().decode("0123456789ABCDEF")))) + ImmutableSet.of(DomainDsData.create(1, 3, 1, base16().decode("0123456789ABCDEF")))) .build(); persistResource(domain); diff --git a/core/src/test/java/google/registry/export/sheet/SyncRegistrarsSheetTest.java b/core/src/test/java/google/registry/export/sheet/SyncRegistrarsSheetTest.java index eb49394d3..e4d9f3dd2 100644 --- a/core/src/test/java/google/registry/export/sheet/SyncRegistrarsSheetTest.java +++ b/core/src/test/java/google/registry/export/sheet/SyncRegistrarsSheetTest.java @@ -193,7 +193,7 @@ public class SyncRegistrarsSheetTest { assertThat(rows).hasSize(2); ImmutableMap row = rows.get(0); - assertThat(row).containsEntry("clientIdentifier", "aaaregistrar"); + assertThat(row).containsEntry("registrarId", "aaaregistrar"); assertThat(row).containsEntry("registrarName", "AAA Registrar Inc."); assertThat(row).containsEntry("state", "SUSPENDED"); assertThat(row).containsEntry("ianaIdentifier", "8"); @@ -288,7 +288,7 @@ public class SyncRegistrarsSheetTest { assertThat(row).containsEntry("billingAccountMap", "{JPY=JPY7890, USD=USD1234}"); row = rows.get(1); - assertThat(row).containsEntry("clientIdentifier", "anotherregistrar"); + assertThat(row).containsEntry("registrarId", "anotherregistrar"); assertThat(row).containsEntry("registrarName", "Another Registrar LLC"); assertThat(row).containsEntry("state", "ACTIVE"); assertThat(row).containsEntry("ianaIdentifier", "1"); @@ -337,7 +337,7 @@ public class SyncRegistrarsSheetTest { verify(sheetSynchronizer).synchronize(eq("foobar"), rowsCaptor.capture()); ImmutableMap row = getOnlyElement(getOnlyElement(rowsCaptor.getAllValues())); - assertThat(row).containsEntry("clientIdentifier", "SomeRegistrar"); + assertThat(row).containsEntry("registrarId", "SomeRegistrar"); assertThat(row).containsEntry("registrarName", "Some Registrar"); assertThat(row).containsEntry("state", "ACTIVE"); assertThat(row).containsEntry("ianaIdentifier", "8"); diff --git a/core/src/test/java/google/registry/flows/domain/DomainCreateFlowTest.java b/core/src/test/java/google/registry/flows/domain/DomainCreateFlowTest.java index d468fb96b..96fdda69b 100644 --- a/core/src/test/java/google/registry/flows/domain/DomainCreateFlowTest.java +++ b/core/src/test/java/google/registry/flows/domain/DomainCreateFlowTest.java @@ -161,7 +161,7 @@ import google.registry.model.domain.fee.BaseFee.FeeType; import google.registry.model.domain.fee.Fee; import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.rgp.GracePeriodStatus; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.domain.token.AllocationToken; import google.registry.model.domain.token.AllocationToken.RegistrationBehavior; import google.registry.model.domain.token.AllocationToken.TokenStatus; @@ -860,7 +860,7 @@ class DomainCreateFlowTest extends ResourceFlowTestCase { .asBuilder() .setDsData( ImmutableSet.of( - DelegationSignerData.create( - 12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC")))) + DomainDsData.create(12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC")))) .setNameservers(ImmutableSet.of(host1.createVKey(), host3.createVKey())) .build()); doSuccessfulTest("domain_info_response_dsdata.xml", false); @@ -541,8 +540,7 @@ class DomainInfoFlowTest extends ResourceFlowTestCase { null)) .setDsData( ImmutableSet.of( - DelegationSignerData.create( - 12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC")))) + DomainDsData.create(12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC")))) .build()); doSuccessfulTest("domain_info_response_dsdata_addperiod.xml", false); } diff --git a/core/src/test/java/google/registry/flows/domain/DomainTransferCancelFlowTest.java b/core/src/test/java/google/registry/flows/domain/DomainTransferCancelFlowTest.java index cb7a3d6f2..6b708c5ab 100644 --- a/core/src/test/java/google/registry/flows/domain/DomainTransferCancelFlowTest.java +++ b/core/src/test/java/google/registry/flows/domain/DomainTransferCancelFlowTest.java @@ -170,7 +170,7 @@ class DomainTransferCancelFlowTest .setResponseData( ImmutableList.of( new DomainTransferResponse.Builder() - .setFullyQualifiedDomainName(getUniqueIdFromCommand()) + .setDomainName(getUniqueIdFromCommand()) .setTransferStatus(TransferStatus.CLIENT_CANCELLED) .setTransferRequestTime(TRANSFER_REQUEST_TIME) .setGainingRegistrarId("NewRegistrar") diff --git a/core/src/test/java/google/registry/flows/domain/DomainUpdateFlowTest.java b/core/src/test/java/google/registry/flows/domain/DomainUpdateFlowTest.java index 9e6645706..7fefa2ae8 100644 --- a/core/src/test/java/google/registry/flows/domain/DomainUpdateFlowTest.java +++ b/core/src/test/java/google/registry/flows/domain/DomainUpdateFlowTest.java @@ -97,7 +97,7 @@ import google.registry.model.domain.DesignatedContact; import google.registry.model.domain.DesignatedContact.Type; import google.registry.model.domain.Domain; import google.registry.model.domain.DomainHistory; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.Trid; import google.registry.model.host.Host; @@ -115,8 +115,8 @@ import org.junit.jupiter.api.Test; /** Unit tests for {@link DomainUpdateFlow}. */ class DomainUpdateFlowTest extends ResourceFlowTestCase { - private static final DelegationSignerData SOME_DSDATA = - DelegationSignerData.create( + private static final DomainDsData SOME_DSDATA = + DomainDsData.create( 1, 2, 2, @@ -148,7 +148,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase originalDsData, - ImmutableSet expectedDsData) + ImmutableSet originalDsData, + ImmutableSet expectedDsData, + boolean dnsTaskEnqueued) throws Exception { - doSecDnsSuccessfulTest(xmlFilename, originalDsData, expectedDsData, OTHER_DSDATA_TEMPLATE_MAP); + doSecDnsSuccessfulTest( + xmlFilename, originalDsData, expectedDsData, OTHER_DSDATA_TEMPLATE_MAP, dnsTaskEnqueued); } private void doSecDnsSuccessfulTest( String xmlFilename, - ImmutableSet originalDsData, - ImmutableSet expectedDsData, - ImmutableMap substitutions) + ImmutableSet originalDsData, + ImmutableSet expectedDsData, + ImmutableMap substitutions, + boolean dnsTaskEnqueued) throws Exception { setEppInput(xmlFilename, substitutions); persistResource( @@ -495,7 +497,11 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase ds.cloneWithDomainRepoId(resource.getRepoId())) .collect(toImmutableSet())); - assertDnsTasksEnqueued("example.tld"); + if (dnsTaskEnqueued) { + assertDnsTasksEnqueued("example.tld"); + } else { + assertNoDnsTasksEnqueued(); + } } @Test @@ -504,7 +510,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase builder = new ImmutableSet.Builder<>(); + ImmutableSet.Builder builder = new ImmutableSet.Builder<>(); for (int i = 0; i < 7; ++i) { builder.add( - DelegationSignerData.create( + DomainDsData.create( i, 2, 2, base16().decode("9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"))); } - ImmutableSet commonDsData = builder.build(); + ImmutableSet commonDsData = builder.build(); doSecDnsSuccessfulTest( "domain_update_dsdata_add.xml", @@ -697,11 +711,12 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase builder = new ImmutableSet.Builder<>(); + ImmutableSet.Builder builder = new ImmutableSet.Builder<>(); for (int i = 0; i < 7; ++i) { builder.add( - DelegationSignerData.create( + DomainDsData.create( i, 2, 2, base16().decode("9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"))); } - ImmutableSet commonDsData = builder.build(); + ImmutableSet commonDsData = builder.build(); doSecDnsSuccessfulTest( "domain_update_dsdata_add_rem.xml", @@ -760,7 +778,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase builder = new ImmutableSet.Builder<>(); + ImmutableSet.Builder builder = new ImmutableSet.Builder<>(); for (int i = 0; i < 8; ++i) { - builder.add(DelegationSignerData.create(i, 2, 2, new byte[] {0, 1, 2})); + builder.add(DomainDsData.create(i, 2, 2, new byte[] {0, 1, 2})); } setEppInput("domain_update_dsdata_add.xml", OTHER_DSDATA_TEMPLATE_MAP); @@ -1724,7 +1747,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase { .setResponseData( ImmutableList.of( new DomainTransferResponse.Builder() - .setFullyQualifiedDomainName("test.example") + .setDomainName("test.example") .setTransferStatus(TransferStatus.SERVER_APPROVED) .setGainingRegistrarId(getRegistrarIdForFlow()) .setTransferRequestTime(clock.nowUtc().minusDays(5)) diff --git a/core/src/test/java/google/registry/model/bulkquery/BulkQueryHelper.java b/core/src/test/java/google/registry/model/bulkquery/BulkQueryHelper.java index c73bac4d4..ad9ff4a4b 100644 --- a/core/src/test/java/google/registry/model/bulkquery/BulkQueryHelper.java +++ b/core/src/test/java/google/registry/model/bulkquery/BulkQueryHelper.java @@ -24,7 +24,7 @@ import google.registry.model.domain.DomainHistory; import google.registry.model.domain.DomainHistory.DomainHistoryId; import google.registry.model.domain.GracePeriod; import google.registry.model.domain.GracePeriod.GracePeriodHistory; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.domain.secdns.DomainDsDataHistory; import google.registry.model.reporting.DomainTransactionRecord; import google.registry.persistence.VKey; @@ -46,7 +46,7 @@ public class BulkQueryHelper { .filter(gracePeriod -> gracePeriod.getDomainRepoId().equals(domainRepoId)) .collect(toImmutableSet()), jpaTm() - .loadAllOfStream(DelegationSignerData.class) + .loadAllOfStream(DomainDsData.class) .filter(dsData -> dsData.getDomainRepoId().equals(domainRepoId)) .collect(toImmutableSet()), jpaTm() diff --git a/core/src/test/java/google/registry/model/bulkquery/TestSetupHelper.java b/core/src/test/java/google/registry/model/bulkquery/TestSetupHelper.java index 2b6ea0c63..e5ad5062a 100644 --- a/core/src/test/java/google/registry/model/bulkquery/TestSetupHelper.java +++ b/core/src/test/java/google/registry/model/bulkquery/TestSetupHelper.java @@ -31,7 +31,7 @@ import google.registry.model.domain.GracePeriod; import google.registry.model.domain.Period; import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.rgp.GracePeriodStatus; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.AuthInfo.PasswordAuth; import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.Trid; @@ -160,7 +160,7 @@ public final class TestSetupHelper { .setPersistedCurrentSponsorRegistrarId(REGISTRAR_ID) .setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1)) .setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password"))) - .setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) + .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2}))) .setLaunchNotice(LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME)) .setSmdId("smdid") .addGracePeriod( diff --git a/core/src/test/java/google/registry/model/domain/DomainSqlTest.java b/core/src/test/java/google/registry/model/domain/DomainSqlTest.java index 6d10c8f01..14f18bcd6 100644 --- a/core/src/test/java/google/registry/model/domain/DomainSqlTest.java +++ b/core/src/test/java/google/registry/model/domain/DomainSqlTest.java @@ -43,7 +43,7 @@ import google.registry.model.contact.Contact; import google.registry.model.domain.DesignatedContact.Type; import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.rgp.GracePeriodStatus; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.domain.token.AllocationToken; import google.registry.model.domain.token.AllocationToken.TokenStatus; import google.registry.model.eppcommon.AuthInfo.PasswordAuth; @@ -122,7 +122,7 @@ public class DomainSqlTest { .setPersistedCurrentSponsorRegistrarId("registrar3") .setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1)) .setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password"))) - .setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) + .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2}))) .setLaunchNotice( LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME)) .setSmdId("smdid") @@ -346,12 +346,11 @@ public class DomainSqlTest { @Test void testModifyDsData_addThenRemoveSuccessfully() { persistDomain(); - DelegationSignerData extraDsData = - DelegationSignerData.create(2, 2, 3, new byte[] {0, 1, 2}, "4-COM"); - ImmutableSet unionDsData = + DomainDsData extraDsData = DomainDsData.create(2, 2, 3, new byte[] {0, 1, 2}, "4-COM"); + ImmutableSet unionDsData = Sets.union(domain.getDsData(), ImmutableSet.of(extraDsData)).immutableCopy(); - // Add an extra DelegationSignerData to dsData set. + // Add an extra DomainDsData to dsData set. jpaTm() .transact( () -> { @@ -361,7 +360,7 @@ public class DomainSqlTest { jpaTm().put(modified); }); - // Verify that the persisted domain entity contains both DelegationSignerData records. + // Verify that the persisted domain entity contains both DomainDsData records. jpaTm() .transact( () -> { @@ -370,7 +369,7 @@ public class DomainSqlTest { assertEqualDomainExcept(persisted, "dsData"); }); - // Remove the extra DelegationSignerData record from dsData set. + // Remove the extra DomainDsData record from dsData set. jpaTm() .transact( () -> { @@ -604,8 +603,7 @@ public class DomainSqlTest { persisted .asBuilder() .setDsData( - ImmutableSet.of( - DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) + ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2}))) .build(); updateInDb(domain); return jpaTm().getTransactionTime(); diff --git a/core/src/test/java/google/registry/model/domain/DomainTest.java b/core/src/test/java/google/registry/model/domain/DomainTest.java index bf702c041..4c3770a70 100644 --- a/core/src/test/java/google/registry/model/domain/DomainTest.java +++ b/core/src/test/java/google/registry/model/domain/DomainTest.java @@ -50,7 +50,7 @@ import google.registry.model.contact.Contact; import google.registry.model.domain.DesignatedContact.Type; import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.rgp.GracePeriodStatus; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.AuthInfo.PasswordAuth; import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.Trid; @@ -189,8 +189,7 @@ public class DomainTest { .setPersistedCurrentSponsorRegistrarId("NewRegistrar") .setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1)) .setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password"))) - .setDsData( - ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) + .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2}))) .setLaunchNotice( LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME)) .setTransferData( @@ -292,7 +291,7 @@ public class DomainTest { assertThat( DatabaseHelper.newDomain("example.com") .asBuilder() - .setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, (byte[]) null))) + .setDsData(ImmutableSet.of(DomainDsData.create(1, 1, 1, (byte[]) null))) .build() .getDsData() .asList() @@ -302,7 +301,7 @@ public class DomainTest { assertThat( DatabaseHelper.newDomain("example.com") .asBuilder() - .setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, new byte[] {}))) + .setDsData(ImmutableSet.of(DomainDsData.create(1, 1, 1, new byte[] {}))) .build() .getDsData() .asList() @@ -312,7 +311,7 @@ public class DomainTest { assertThat( DatabaseHelper.newDomain("example.com") .asBuilder() - .setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, new byte[] {1}))) + .setDsData(ImmutableSet.of(DomainDsData.create(1, 1, 1, new byte[] {1}))) .build() .getDsData() .asList() diff --git a/core/src/test/java/google/registry/model/history/DomainHistoryTest.java b/core/src/test/java/google/registry/model/history/DomainHistoryTest.java index 9ed5f9275..fff084768 100644 --- a/core/src/test/java/google/registry/model/history/DomainHistoryTest.java +++ b/core/src/test/java/google/registry/model/history/DomainHistoryTest.java @@ -34,7 +34,7 @@ import google.registry.model.domain.DomainHistory; import google.registry.model.domain.GracePeriod; import google.registry.model.domain.Period; import google.registry.model.domain.rgp.GracePeriodStatus; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.Trid; import google.registry.model.host.Host; import google.registry.model.reporting.DomainTransactionRecord; @@ -116,7 +116,7 @@ public class DomainHistoryTest extends EntityTestCase { newDomain("example.tld", "domainRepoId", contact) .asBuilder() .setNameservers(host.createVKey()) - .setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) + .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2}))) .setDnsRefreshRequestTime(Optional.of(DateTime.parse("2020-03-09T16:40:00Z"))) .build(); insertInDb(domain); diff --git a/core/src/test/java/google/registry/model/translators/StatusValueAdapterTest.java b/core/src/test/java/google/registry/model/translators/StatusValueAdapterTest.java index d78a4c4a0..9bd3f69cf 100644 --- a/core/src/test/java/google/registry/model/translators/StatusValueAdapterTest.java +++ b/core/src/test/java/google/registry/model/translators/StatusValueAdapterTest.java @@ -44,21 +44,25 @@ public class StatusValueAdapterTest { void testMarshalling() throws Exception { // Mangle the status value through marshalling by stuffing it in a host info response and then // ripping it out of the marshalled xml. Use lenient marshalling so we can omit other fields. - String marshalled = new String( - EppXmlTransformer.marshal( - EppOutput.create(new EppResponse.Builder() - .setResData(HostInfoData.newBuilder() - .setCreationClientId("") - .setCreationTime(START_OF_TIME) - .setCurrentSponsorClientId("") - .setFullyQualifiedHostName("") - .setInetAddresses(ImmutableSet.of()) - .setRepoId("") - .setStatusValues(ImmutableSet.of(StatusValue.CLIENT_UPDATE_PROHIBITED)) - .build()) - .build()), - ValidationMode.LENIENT), - UTF_8); + String marshalled = + new String( + EppXmlTransformer.marshal( + EppOutput.create( + new EppResponse.Builder() + .setResData( + HostInfoData.newBuilder() + .setCreationClientId("") + .setCreationTime(START_OF_TIME) + .setCurrentSponsorClientId("") + .setHostName("") + .setInetAddresses(ImmutableSet.of()) + .setRepoId("") + .setStatusValues( + ImmutableSet.of(StatusValue.CLIENT_UPDATE_PROHIBITED)) + .build()) + .build()), + ValidationMode.LENIENT), + UTF_8); assertThat(marshalled).contains(""); } diff --git a/core/src/test/java/google/registry/rde/DomainToXjcConverterTest.java b/core/src/test/java/google/registry/rde/DomainToXjcConverterTest.java index b4238a069..0f92d98c5 100644 --- a/core/src/test/java/google/registry/rde/DomainToXjcConverterTest.java +++ b/core/src/test/java/google/registry/rde/DomainToXjcConverterTest.java @@ -43,7 +43,7 @@ import google.registry.model.domain.DomainAuthInfo; import google.registry.model.domain.DomainHistory; import google.registry.model.domain.GracePeriod; import google.registry.model.domain.rgp.GracePeriodStatus; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.AuthInfo.PasswordAuth; import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.Trid; @@ -267,8 +267,7 @@ public class DomainToXjcConverterTest { .setCreationTimeForTest(DateTime.parse("1900-01-01T00:00:00Z")) .setPersistedCurrentSponsorRegistrarId("TheRegistrar") .setDsData( - ImmutableSet.of( - DelegationSignerData.create(123, 200, 230, base16().decode("1234567890")))) + ImmutableSet.of(DomainDsData.create(123, 200, 230, base16().decode("1234567890")))) .setDomainName(Idn.toASCII("love.みんな")) .setLastTransferTime(DateTime.parse("1910-01-01T00:00:00Z")) .setLastEppUpdateRegistrarId("TheRegistrar") diff --git a/core/src/test/java/google/registry/rde/RdeFixtures.java b/core/src/test/java/google/registry/rde/RdeFixtures.java index 70a1d0268..f4d78ef97 100644 --- a/core/src/test/java/google/registry/rde/RdeFixtures.java +++ b/core/src/test/java/google/registry/rde/RdeFixtures.java @@ -38,7 +38,7 @@ import google.registry.model.domain.DomainAuthInfo; import google.registry.model.domain.DomainHistory; import google.registry.model.domain.GracePeriod; import google.registry.model.domain.rgp.GracePeriodStatus; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.AuthInfo.PasswordAuth; import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.Trid; @@ -112,8 +112,7 @@ final class RdeFixtures { .setPersistedCurrentSponsorRegistrarId("TheRegistrar") .setCreationTimeForTest(clock.nowUtc()) .setDsData( - ImmutableSet.of( - DelegationSignerData.create(123, 200, 230, base16().decode("1234567890")))) + ImmutableSet.of(DomainDsData.create(123, 200, 230, base16().decode("1234567890")))) .setDomainName(Idn.toASCII("love." + tld)) .setLastTransferTime(DateTime.parse("1990-01-01T00:00:00Z")) .setLastEppUpdateRegistrarId("IntoTheTempest") diff --git a/core/src/test/java/google/registry/reporting/spec11/Spec11RegistrarThreatMatchesParserTest.java b/core/src/test/java/google/registry/reporting/spec11/Spec11RegistrarThreatMatchesParserTest.java index c0702d0e7..80bf1b50c 100644 --- a/core/src/test/java/google/registry/reporting/spec11/Spec11RegistrarThreatMatchesParserTest.java +++ b/core/src/test/java/google/registry/reporting/spec11/Spec11RegistrarThreatMatchesParserTest.java @@ -89,13 +89,13 @@ public class Spec11RegistrarThreatMatchesParserTest { "threatType", "MALWARE", "platformType", "ANY_PLATFORM", "threatEntryMetaData", "NONE", - "fullyQualifiedDomainName", "c.com"))); + "domainName", "c.com"))); ThreatMatch objectWithoutExtraFields = ThreatMatch.fromJSON( new JSONObject( ImmutableMap.of( "threatType", "MALWARE", - "fullyQualifiedDomainName", "c.com"))); + "domainName", "c.com"))); assertThat(objectWithExtraFields).isEqualTo(objectWithoutExtraFields); } @@ -113,7 +113,7 @@ public class Spec11RegistrarThreatMatchesParserTest { new JSONObject( ImmutableMap.of( "threatType", "MALWARE", - "fullyQualifiedDomainName", "a.com"))))); + "domainName", "a.com"))))); } static RegistrarThreatMatches getMatchB() throws Exception { @@ -124,12 +124,12 @@ public class Spec11RegistrarThreatMatchesParserTest { new JSONObject( ImmutableMap.of( "threatType", "MALWARE", - "fullyQualifiedDomainName", "b.com"))), + "domainName", "b.com"))), ThreatMatch.fromJSON( new JSONObject( ImmutableMap.of( "threatType", "MALWARE", - "fullyQualifiedDomainName", "c.com"))))); + "domainName", "c.com"))))); } private void setupFile(String fileWithContent, String fileDate) { diff --git a/core/src/test/java/google/registry/testing/DatabaseHelper.java b/core/src/test/java/google/registry/testing/DatabaseHelper.java index e6e08beb1..7234ec313 100644 --- a/core/src/test/java/google/registry/testing/DatabaseHelper.java +++ b/core/src/test/java/google/registry/testing/DatabaseHelper.java @@ -113,7 +113,6 @@ import java.util.Map; import java.util.NoSuchElementException; import java.util.Optional; import java.util.Set; -import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; import javax.annotation.Nullable; @@ -984,32 +983,12 @@ public final class DatabaseHelper { return createRepoId(allocateId(), getContactAndHostRoidSuffix()); } - private static void saveResource(R resource) { - if (tm().isOfy()) { - Consumer saver = tm()::put; - saver.accept(resource); - if (resource instanceof EppResource) { - EppResource eppResource = (EppResource) resource; - persistEppResourceExtras(eppResource, saver); - } - } else { - tm().put(resource); - } - } - - private static void persistEppResourceExtras( - R resource, Consumer saver) { - assertWithMessage("Cannot persist an EppResource with a missing repoId in tests") - .that(resource.getRepoId()) - .isNotEmpty(); - } - /** Persists an object in the DB for tests. */ public static R persistResource(final R resource) { assertWithMessage("Attempting to persist a Builder is almost certainly an error in test code") .that(resource) .isNotInstanceOf(Buildable.Builder.class); - tm().transact(() -> saveResource(resource)); + tm().transact(() -> tm().put(resource)); maybeAdvanceClock(); // Force the session cache to be cleared so that when we read the resource back, we read from // Datastore and not from the session cache. This is needed to trigger Objectify's load process @@ -1026,11 +1005,8 @@ public final class DatabaseHelper { .that(resource) .isNotInstanceOf(Buildable.Builder.class); } - // Persist domains ten at a time, to avoid exceeding the entity group limit. - for (final List chunk : Iterables.partition(resources, 10)) { - tm().transact(() -> chunk.forEach(DatabaseHelper::saveResource)); - maybeAdvanceClock(); - } + tm().transact(() -> resources.forEach(e -> tm().put(e))); + maybeAdvanceClock(); // Force the session to be cleared so that when we read it back, we read from Datastore // and not from the transaction's session cache. tm().clearSessionCache(); diff --git a/core/src/test/java/google/registry/testing/DomainSubject.java b/core/src/test/java/google/registry/testing/DomainSubject.java index ef51ea1f8..bc8451789 100644 --- a/core/src/test/java/google/registry/testing/DomainSubject.java +++ b/core/src/test/java/google/registry/testing/DomainSubject.java @@ -24,7 +24,7 @@ import com.google.common.truth.FailureMetadata; import com.google.common.truth.SimpleSubjectBuilder; import google.registry.model.domain.Domain; import google.registry.model.domain.launch.LaunchNotice; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.AuthInfo; import google.registry.testing.TruthChainer.And; import java.util.Set; @@ -40,16 +40,15 @@ public final class DomainSubject extends AbstractEppResourceSubject hasFullyQualifiedDomainName(String fullyQualifiedDomainName) { - return hasValue( - fullyQualifiedDomainName, actual.getDomainName(), "has fullyQualifiedDomainName"); + public And hasDomainName(String domainName) { + return hasValue(domainName, actual.getDomainName(), "has domainName"); } - public And hasExactlyDsData(DelegationSignerData... dsData) { + public And hasExactlyDsData(DomainDsData... dsData) { return hasExactlyDsData(ImmutableSet.copyOf(dsData)); } - public And hasExactlyDsData(Set dsData) { + public And hasExactlyDsData(Set dsData) { return hasValue(dsData, actual.getDsData(), "has dsData"); } diff --git a/core/src/test/java/google/registry/testing/FullFieldsTestEntityHelper.java b/core/src/test/java/google/registry/testing/FullFieldsTestEntityHelper.java index ea4e458a5..b0d89c465 100644 --- a/core/src/test/java/google/registry/testing/FullFieldsTestEntityHelper.java +++ b/core/src/test/java/google/registry/testing/FullFieldsTestEntityHelper.java @@ -31,7 +31,7 @@ import google.registry.model.contact.PostalInfo; import google.registry.model.domain.DesignatedContact; import google.registry.model.domain.Domain; import google.registry.model.domain.Period; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.Trid; import google.registry.model.host.Host; @@ -346,7 +346,7 @@ public final class FullFieldsTestEntityHelper { StatusValue.CLIENT_RENEW_PROHIBITED, StatusValue.CLIENT_TRANSFER_PROHIBITED, StatusValue.SERVER_UPDATE_PROHIBITED)) - .setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, "deadface"))); + .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, "deadface"))); if (registrant != null) { builder.setRegistrant(registrant.createVKey()); } diff --git a/core/src/test/java/google/registry/tools/GenerateDnsReportCommandTest.java b/core/src/test/java/google/registry/tools/GenerateDnsReportCommandTest.java index 3106d0c8f..cc0b6bf5b 100644 --- a/core/src/test/java/google/registry/tools/GenerateDnsReportCommandTest.java +++ b/core/src/test/java/google/registry/tools/GenerateDnsReportCommandTest.java @@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.common.net.InetAddresses; import google.registry.model.domain.Domain; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.StatusValue; import google.registry.model.host.Host; import google.registry.testing.DatabaseHelper; @@ -148,10 +148,8 @@ class GenerateDnsReportCommandTest extends CommandTestCase { void testSuccess() throws Exception { persistActiveDomain("example.tld"); runCommand("example.tld"); - assertInStdout("fullyQualifiedDomainName=example.tld"); + assertInStdout("domainName=example.tld"); assertInStdout("Contact=VKey(sql:3-ROID"); assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTItVExE"); } @@ -46,7 +46,7 @@ class GetDomainCommandTest extends CommandTestCase { void testSuccess_expand() throws Exception { persistActiveDomain("example.tld"); runCommand("example.tld", "--expand"); - assertInStdout("fullyQualifiedDomainName=example.tld"); + assertInStdout("domainName=example.tld"); assertInStdout("sqlKey=3-ROID"); assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTItVExE"); assertNotInStdout("LiveRef"); @@ -57,7 +57,7 @@ class GetDomainCommandTest extends CommandTestCase { createTld("xn--q9jyb4c"); persistActiveDomain("xn--aualito-txac.xn--q9jyb4c"); runCommand("çauçalito.みんな", "--expand"); - assertInStdout("fullyQualifiedDomainName=xn--aualito-txac.xn--q9jyb4c"); + assertInStdout("domainName=xn--aualito-txac.xn--q9jyb4c"); assertInStdout("sqlKey=4-ROID"); } @@ -66,10 +66,10 @@ class GetDomainCommandTest extends CommandTestCase { persistActiveDomain("example.tld"); persistActiveDomain("example2.tld"); runCommand("example.tld", "example2.tld"); - assertInStdout("fullyQualifiedDomainName=example.tld"); - assertInStdout("fullyQualifiedDomainName=example2.tld"); - assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTItVExE"); - assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTQtVExE"); + assertInStdout("domainName=example.tld"); + assertInStdout("domainName=example2.tld"); + assertInStdout("Websafe key: kind:Domain@sql:rO0ABXQABTItVExE"); + assertInStdout("Websafe key: kind:Domain@sql:rO0ABXQABTQtVExE"); } @Test @@ -112,7 +112,7 @@ class GetDomainCommandTest extends CommandTestCase { persistActiveDomain("example.tld"); createTld("com"); runCommand("example.com", "example.tld"); - assertInStdout("fullyQualifiedDomainName=example.tld"); + assertInStdout("domainName=example.tld"); assertInStdout("Domain 'example.com' does not exist or is deleted"); } } diff --git a/core/src/test/java/google/registry/tools/GetHostCommandTest.java b/core/src/test/java/google/registry/tools/GetHostCommandTest.java index 55366907b..11bd8a460 100644 --- a/core/src/test/java/google/registry/tools/GetHostCommandTest.java +++ b/core/src/test/java/google/registry/tools/GetHostCommandTest.java @@ -41,16 +41,16 @@ class GetHostCommandTest extends CommandTestCase { void testSuccess() throws Exception { persistActiveHost("ns1.example.tld"); runCommand("ns1.example.tld"); - assertInStdout("fullyQualifiedHostName=ns1.example.tld"); - assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjItUk9JRA"); + assertInStdout("hostName=ns1.example.tld"); + assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjItUk9JRA"); } @Test void testSuccess_expand() throws Exception { persistActiveHost("ns1.example.tld"); runCommand("ns1.example.tld", "--expand"); - assertInStdout("fullyQualifiedHostName=ns1.example.tld"); - assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjItUk9JRA"); + assertInStdout("hostName=ns1.example.tld"); + assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjItUk9JRA"); assertNotInStdout("LiveRef"); } @@ -59,10 +59,10 @@ class GetHostCommandTest extends CommandTestCase { persistActiveHost("ns1.example.tld"); persistActiveHost("ns2.example.tld"); runCommand("ns1.example.tld", "ns2.example.tld"); - assertInStdout("fullyQualifiedHostName=ns1.example.tld"); - assertInStdout("fullyQualifiedHostName=ns2.example.tld"); - assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjItUk9JRA"); - assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjMtUk9JRA"); + assertInStdout("hostName=ns1.example.tld"); + assertInStdout("hostName=ns2.example.tld"); + assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjItUk9JRA"); + assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjMtUk9JRA"); } @Test @@ -71,8 +71,8 @@ class GetHostCommandTest extends CommandTestCase { createTld("tld2"); persistActiveHost("ns1.example.tld2"); runCommand("ns1.example.tld", "ns1.example.tld2"); - assertInStdout("fullyQualifiedHostName=ns1.example.tld"); - assertInStdout("fullyQualifiedHostName=ns1.example.tld2"); + assertInStdout("hostName=ns1.example.tld"); + assertInStdout("hostName=ns1.example.tld2"); } @Test @@ -100,7 +100,7 @@ class GetHostCommandTest extends CommandTestCase { void testSuccess_externalHost() throws Exception { persistActiveHost("ns1.example.foo"); runCommand("ns1.example.foo"); - assertInStdout("fullyQualifiedHostName=ns1.example.foo"); + assertInStdout("hostName=ns1.example.foo"); } @Test diff --git a/core/src/test/java/google/registry/tools/UniformRapidSuspensionCommandTest.java b/core/src/test/java/google/registry/tools/UniformRapidSuspensionCommandTest.java index 2d232519a..6ab3e5beb 100644 --- a/core/src/test/java/google/registry/tools/UniformRapidSuspensionCommandTest.java +++ b/core/src/test/java/google/registry/tools/UniformRapidSuspensionCommandTest.java @@ -25,7 +25,7 @@ import com.beust.jcommander.ParameterException; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import google.registry.model.domain.Domain; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.StatusValue; import google.registry.model.host.Host; import google.registry.persistence.VKey; @@ -44,7 +44,7 @@ class UniformRapidSuspensionCommandTest private Host urs1; private Host urs2; private Domain defaultDomain; - private ImmutableSet defaultDsData; + private ImmutableSet defaultDsData; @BeforeEach void beforeEach() { @@ -58,12 +58,12 @@ class UniformRapidSuspensionCommandTest defaultDomain = DatabaseHelper.newDomain("evil.tld"); defaultDsData = ImmutableSet.of( - DelegationSignerData.create(1, 2, 3, new HexBinaryAdapter().unmarshal("dead")), - DelegationSignerData.create(4, 5, 6, new HexBinaryAdapter().unmarshal("beef"))); + DomainDsData.create(1, 2, 3, new HexBinaryAdapter().unmarshal("dead")), + DomainDsData.create(4, 5, 6, new HexBinaryAdapter().unmarshal("beef"))); } private void persistDomainWithHosts( - Domain domain, ImmutableSet dsData, Host... hosts) { + Domain domain, ImmutableSet dsData, Host... hosts) { ImmutableSet.Builder> hostRefs = new ImmutableSet.Builder<>(); for (Host host : hosts) { hostRefs.add(host.createVKey()); diff --git a/core/src/test/java/google/registry/tools/UpdateTldCommandTest.java b/core/src/test/java/google/registry/tools/UpdateTldCommandTest.java index 5b552455e..45523d5f9 100644 --- a/core/src/test/java/google/registry/tools/UpdateTldCommandTest.java +++ b/core/src/test/java/google/registry/tools/UpdateTldCommandTest.java @@ -354,7 +354,8 @@ class UpdateTldCommandTest extends CommandTestCase { @Test void testSuccess_setAllowedNameserversOverwrites() throws Exception { persistResource( - Registry.get("xn--q9jyb4c").asBuilder() + Registry.get("xn--q9jyb4c") + .asBuilder() .setAllowedFullyQualifiedHostNames( ImmutableSet.of("ns1.example.tld", "ns2.example.tld")) .build()); @@ -366,7 +367,8 @@ class UpdateTldCommandTest extends CommandTestCase { @Test void testSuccess_addAllowedNameservers() throws Exception { persistResource( - Registry.get("xn--q9jyb4c").asBuilder() + Registry.get("xn--q9jyb4c") + .asBuilder() .setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns1.example.com")) .build()); runCommandForced("--add_allowed_nameservers=ns2.example.com", "xn--q9jyb4c"); @@ -377,7 +379,8 @@ class UpdateTldCommandTest extends CommandTestCase { @Test void testSuccess_removeAllAllowedNameservers() throws Exception { persistResource( - Registry.get("xn--q9jyb4c").asBuilder() + Registry.get("xn--q9jyb4c") + .asBuilder() .setAllowedFullyQualifiedHostNames( ImmutableSet.of("ns1.example.com", "ns2.example.com")) .build()); @@ -388,7 +391,8 @@ class UpdateTldCommandTest extends CommandTestCase { @Test void testSuccess_removeSomeAllowedNameservers() throws Exception { persistResource( - Registry.get("xn--q9jyb4c").asBuilder() + Registry.get("xn--q9jyb4c") + .asBuilder() .setAllowedFullyQualifiedHostNames( ImmutableSet.of("ns1.example.com", "ns2.example.com")) .build()); @@ -782,7 +786,8 @@ class UpdateTldCommandTest extends CommandTestCase { @Test void testFailure_cantAddDuplicateAllowedNameservers() { persistResource( - Registry.get("xn--q9jyb4c").asBuilder() + Registry.get("xn--q9jyb4c") + .asBuilder() .setAllowedFullyQualifiedHostNames( ImmutableSet.of("ns1.example.com", "ns2.example.com")) .build()); @@ -796,9 +801,9 @@ class UpdateTldCommandTest extends CommandTestCase { @Test void testFailure_cantRemoveAllowedNameserverThatIsntPresent() { persistResource( - Registry.get("xn--q9jyb4c").asBuilder() - .setAllowedFullyQualifiedHostNames( - ImmutableSet.of("ns1.example.com")) + Registry.get("xn--q9jyb4c") + .asBuilder() + .setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns1.example.com")) .build()); IllegalArgumentException thrown = assertThrows( diff --git a/core/src/test/java/google/registry/tools/server/GenerateZoneFilesActionTest.java b/core/src/test/java/google/registry/tools/server/GenerateZoneFilesActionTest.java index 7d8edb8e9..aff3fd252 100644 --- a/core/src/test/java/google/registry/tools/server/GenerateZoneFilesActionTest.java +++ b/core/src/test/java/google/registry/tools/server/GenerateZoneFilesActionTest.java @@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import google.registry.gcs.GcsUtils; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.StatusValue; import google.registry.model.host.Host; import google.registry.persistence.VKey; @@ -82,7 +82,7 @@ class GenerateZoneFilesActionTest { DatabaseHelper.newDomain("ns-and-ds.tld") .asBuilder() .addNameservers(nameservers) - .setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) + .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2}))) .build()); persistResource( DatabaseHelper.newDomain("ns-only.tld").asBuilder().addNameservers(nameservers).build()); @@ -110,7 +110,7 @@ class GenerateZoneFilesActionTest { persistResource( DatabaseHelper.newDomain("ds-only.tld") .asBuilder() - .setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) + .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2}))) .build()); persistActiveContact("ignored_contact"); persistActiveHost("ignored.host.tld"); // No ips. @@ -120,7 +120,7 @@ class GenerateZoneFilesActionTest { DatabaseHelper.newDomain("ignored.com") .asBuilder() .addNameservers(nameservers) - .setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}))) + .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2}))) .build()); GenerateZoneFilesAction action = new GenerateZoneFilesAction(); diff --git a/core/src/test/java/google/registry/tools/server/ListDomainsActionTest.java b/core/src/test/java/google/registry/tools/server/ListDomainsActionTest.java index 79e628038..d484cea6b 100644 --- a/core/src/test/java/google/registry/tools/server/ListDomainsActionTest.java +++ b/core/src/test/java/google/registry/tools/server/ListDomainsActionTest.java @@ -142,17 +142,17 @@ class ListDomainsActionTest extends ListActionTestCase { @Test void testRun_twoLinesWithIdOnlyExplicitHeader() { action.tlds = ImmutableSet.of("foo"); - persistActiveDomain("example1.foo", DateTime.parse("2010-03-04T16:00:00Z")); - persistActiveDomain("example2.foo", DateTime.parse("2011-03-04T16:00:00Z")); + persistActiveDomain("test1.foo", DateTime.parse("2010-03-04T16:00:00Z")); + persistActiveDomain("test2.foo", DateTime.parse("2011-03-04T16:00:00Z")); testRunSuccess( action, Optional.empty(), Optional.of(true), Optional.empty(), - "^fullyQualifiedDomainName$", + "^domainName$", "^-+\\s*$", - "^example1.foo\\s*$", - "^example2.foo\\s*$"); + "^test1.foo\\s*$", + "^test2.foo\\s*$"); } @Test @@ -165,7 +165,7 @@ class ListDomainsActionTest extends ListActionTestCase { Optional.of("repoId"), Optional.empty(), Optional.empty(), - "^fullyQualifiedDomainName\\s+repoId\\s*$", + "^domainName\\s+repoId\\s*$", "^-+\\s+-+\\s*$", "^example1.foo\\s+2-FOO\\s*$", "^example3.foo\\s+4-FOO\\s*$"); @@ -195,7 +195,7 @@ class ListDomainsActionTest extends ListActionTestCase { Optional.of("repoId"), Optional.of(true), Optional.empty(), - "^fullyQualifiedDomainName\\s+repoId\\s*$", + "^domainName\\s+repoId\\s*$", "^-+\\s+-+\\s*$", "^example1.foo\\s+2-FOO\\s*$", "^example3.foo\\s+4-FOO\\s*$"); @@ -211,7 +211,7 @@ class ListDomainsActionTest extends ListActionTestCase { Optional.of("*"), Optional.empty(), Optional.empty(), - "^fullyQualifiedDomainName\\s+.*repoId", + "^domainName\\s+.*repoId", "^-+\\s+-+", "^example1.foo\\s+.*2-FOO", "^example3.foo\\s+.*4-FOO"); @@ -227,7 +227,7 @@ class ListDomainsActionTest extends ListActionTestCase { Optional.of("*,repoId"), Optional.empty(), Optional.empty(), - "^fullyQualifiedDomainName\\s+.*repoId", + "^domainName\\s+.*repoId", "^-+\\s+-+", "^example1.foo\\s+.*2-FOO", "^example3.foo\\s+.*4-FOO"); diff --git a/core/src/test/java/google/registry/tools/server/ListHostsActionTest.java b/core/src/test/java/google/registry/tools/server/ListHostsActionTest.java index 29c9c7b49..c584c1ab9 100644 --- a/core/src/test/java/google/registry/tools/server/ListHostsActionTest.java +++ b/core/src/test/java/google/registry/tools/server/ListHostsActionTest.java @@ -53,7 +53,7 @@ class ListHostsActionTest extends ListActionTestCase { Optional.of("repoId"), Optional.empty(), Optional.empty(), - "^fullyQualifiedHostName\\s+repoId\\s*$", + "^hostName\\s+repoId\\s*$", "^-+\\s+-+\\s*$", "^example1.foo\\s+3-ROID\\s*$", "^example2.foo\\s+2-ROID\\s*$"); @@ -68,7 +68,7 @@ class ListHostsActionTest extends ListActionTestCase { Optional.of("*"), Optional.empty(), Optional.empty(), - "^fullyQualifiedHostName\\s+.*repoId", + "^hostName\\s+.*repoId", "^-+\\s+-+", "^example1.foo\\s+.*2", "^example2.foo\\s+.*1"); @@ -83,7 +83,7 @@ class ListHostsActionTest extends ListActionTestCase { Optional.of("*,repoId"), Optional.empty(), Optional.empty(), - "^fullyQualifiedHostName\\s+.*repoId", + "^hostName\\s+.*repoId", "^-+\\s+-+", "^example1.foo\\s+.*2", "^example2.foo\\s+.*1"); diff --git a/core/src/test/java/google/registry/webdriver/RegistrarConsoleWebTest.java b/core/src/test/java/google/registry/webdriver/RegistrarConsoleWebTest.java index 8da608b6c..63de210c3 100644 --- a/core/src/test/java/google/registry/webdriver/RegistrarConsoleWebTest.java +++ b/core/src/test/java/google/registry/webdriver/RegistrarConsoleWebTest.java @@ -145,7 +145,7 @@ public class RegistrarConsoleWebTest extends WebDriverTestCase { driver.setFormFieldsById( new ImmutableMap.Builder() .put("emailAddress", "test1@example.com") - .put("clientIdentifier", "ignored") + .put("registrarId", "ignored") .put("whoisServer", "foo.bar.baz") .put("url", "blah.blar") .put("phoneNumber", "+1.2125650000") diff --git a/core/src/test/java/google/registry/whois/DomainWhoisResponseTest.java b/core/src/test/java/google/registry/whois/DomainWhoisResponseTest.java index 1d6c79578..2e68a3ee2 100644 --- a/core/src/test/java/google/registry/whois/DomainWhoisResponseTest.java +++ b/core/src/test/java/google/registry/whois/DomainWhoisResponseTest.java @@ -31,7 +31,7 @@ import google.registry.model.domain.DesignatedContact; import google.registry.model.domain.Domain; import google.registry.model.domain.GracePeriod; import google.registry.model.domain.rgp.GracePeriodStatus; -import google.registry.model.domain.secdns.DelegationSignerData; +import google.registry.model.domain.secdns.DomainDsData; import google.registry.model.eppcommon.StatusValue; import google.registry.model.host.Host; import google.registry.model.registrar.Registrar; @@ -268,7 +268,7 @@ class DomainWhoisResponseTest { DesignatedContact.create(DesignatedContact.Type.ADMIN, adminResourceKey), DesignatedContact.create(DesignatedContact.Type.TECH, techResourceKey))) .setNameservers(ImmutableSet.of(host1VKey, host2VKey)) - .setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, "deadface"))) + .setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, "deadface"))) .setGracePeriods( ImmutableSet.of( GracePeriod.create( diff --git a/core/src/test/resources/google/registry/beam/spec11/test_output.txt b/core/src/test/resources/google/registry/beam/spec11/test_output.txt index abc5a11cb..b89b6a31e 100644 --- a/core/src/test/resources/google/registry/beam/spec11/test_output.txt +++ b/core/src/test/resources/google/registry/beam/spec11/test_output.txt @@ -1,4 +1,4 @@ Map from registrar email / name to detected domain name threats: -{"threatMatches":[{"threatType":"UNWANTED_SOFTWARE","fullyQualifiedDomainName":"anti-anti-anti-virus.dev"}],"registrarClientId":"cool-registrar","registrarEmailAddress":"cool@aid.net"} -{"threatMatches":[{"threatType":"MALWARE","fullyQualifiedDomainName":"111.com"},{"threatType":"POTENTIALLY_HARMFUL_APPLICATION","fullyQualifiedDomainName":"bitcoin.bank"}],"registrarClientId":"hello-registrar","registrarEmailAddress":"email@hello.net"} -{"threatMatches":[{"threatType":"THREAT_TYPE_UNSPECIFIED","fullyQualifiedDomainName":"no-eamil.com"},{"threatType":"SOCIAL_ENGINEERING","fullyQualifiedDomainName":"party-night.net"}],"registrarClientId":"kitty-registrar","registrarEmailAddress":"contact@kit.ty"} \ No newline at end of file +{"threatMatches":[{"threatType":"UNWANTED_SOFTWARE","domainName":"anti-anti-anti-virus.dev"}],"registrarClientId":"cool-registrar","registrarEmailAddress":"cool@aid.net"} +{"threatMatches":[{"threatType":"MALWARE","domainName":"111.com"},{"threatType":"POTENTIALLY_HARMFUL_APPLICATION","domainName":"bitcoin.bank"}],"registrarClientId":"hello-registrar","registrarEmailAddress":"email@hello.net"} +{"threatMatches":[{"threatType":"THREAT_TYPE_UNSPECIFIED","domainName":"no-eamil.com"},{"threatType":"SOCIAL_ENGINEERING","domainName":"party-night.net"}],"registrarClientId":"kitty-registrar","registrarEmailAddress":"contact@kit.ty"} \ No newline at end of file diff --git a/core/src/test/resources/google/registry/model/schema.txt b/core/src/test/resources/google/registry/model/schema.txt index 9543397ca..502d900c8 100644 --- a/core/src/test/resources/google/registry/model/schema.txt +++ b/core/src/test/resources/google/registry/model/schema.txt @@ -49,7 +49,7 @@ class google.registry.model.domain.Domain { google.registry.persistence.VKey deletePollMessage; java.lang.String creationClientId; java.lang.String currentSponsorClientId; - java.lang.String fullyQualifiedDomainName; + java.lang.String domainName; java.lang.String idnTableName; java.lang.String lastEppUpdateClientId; java.lang.String smdId; @@ -72,7 +72,7 @@ class google.registry.model.domain.DomainBase { google.registry.persistence.VKey deletePollMessage; java.lang.String creationClientId; java.lang.String currentSponsorClientId; - java.lang.String fullyQualifiedDomainName; + java.lang.String domainName; java.lang.String idnTableName; java.lang.String lastEppUpdateClientId; java.lang.String smdId; @@ -104,7 +104,7 @@ class google.registry.model.host.Host { google.registry.persistence.VKey superordinateDomain; java.lang.String creationClientId; java.lang.String currentSponsorClientId; - java.lang.String fullyQualifiedHostName; + java.lang.String hostName; java.lang.String lastEppUpdateClientId; java.util.Set inetAddresses; org.joda.time.DateTime deletionTime; @@ -117,7 +117,7 @@ class google.registry.model.host.HostBase { google.registry.persistence.VKey superordinateDomain; java.lang.String creationClientId; java.lang.String currentSponsorClientId; - java.lang.String fullyQualifiedHostName; + java.lang.String hostName; java.lang.String lastEppUpdateClientId; java.util.Set inetAddresses; org.joda.time.DateTime deletionTime; diff --git a/core/src/test/resources/google/registry/reporting/icann/total_domains_test_cloud_sql.sql b/core/src/test/resources/google/registry/reporting/icann/total_domains_test_cloud_sql.sql index 4f345c365..9dda3b992 100644 --- a/core/src/test/resources/google/registry/reporting/icann/total_domains_test_cloud_sql.sql +++ b/core/src/test/resources/google/registry/reporting/icann/total_domains_test_cloud_sql.sql @@ -15,7 +15,7 @@ -- Determine the number of domains each registrar sponsors per tld. - -- This is just the number of fullyQualifiedDomainNames under each + -- This is just the number of domainNames under each -- tld-registrar pair. SELECT diff --git a/core/src/test/resources/google/registry/reporting/spec11/spec11_fake_report b/core/src/test/resources/google/registry/reporting/spec11/spec11_fake_report index 155b7bbc9..161ad42b9 100644 --- a/core/src/test/resources/google/registry/reporting/spec11/spec11_fake_report +++ b/core/src/test/resources/google/registry/reporting/spec11/spec11_fake_report @@ -1,3 +1,3 @@ Map from registrar email / name to detected subdomain threats: -{"threatMatches":[{"threatType":"MALWARE","fullyQualifiedDomainName":"a.com"}],"registrarClientId":"TheRegistrar","registrarEmailAddress":"the.registrar@example.com"} -{"threatMatches":[{"threatType":"MALWARE","fullyQualifiedDomainName":"b.com"},{"threatType":"MALWARE","fullyQualifiedDomainName":"c.com"}],"registrarClientId":"NewRegistrar","registrarEmailAddress":"new.registrar@example.com"} +{"threatMatches":[{"threatType":"MALWARE","domainName":"a.com"}],"registrarClientId":"TheRegistrar","registrarEmailAddress":"the.registrar@example.com"} +{"threatMatches":[{"threatType":"MALWARE","domainName":"b.com"},{"threatType":"MALWARE","domainName":"c.com"}],"registrarClientId":"NewRegistrar","registrarEmailAddress":"new.registrar@example.com"} diff --git a/core/src/test/resources/google/registry/reporting/spec11/spec11_fake_report_previous_day b/core/src/test/resources/google/registry/reporting/spec11/spec11_fake_report_previous_day index 2dec89ae7..682343306 100644 --- a/core/src/test/resources/google/registry/reporting/spec11/spec11_fake_report_previous_day +++ b/core/src/test/resources/google/registry/reporting/spec11/spec11_fake_report_previous_day @@ -1,3 +1,3 @@ Map from registrar email to detected subdomain threats: -{"threatMatches":[{"threatEntryMetadata":"NONE","threatType":"MALWARE","fullyQualifiedDomainName":"a.dev","platformType":"ANY_PLATFORM"}],"registrarEmailAddress":"a@fake.com"} -{"threatMatches":[{"threatEntryMetadata":"NONE","threatType":"MALWARE","fullyQualifiedDomainName":"b.com","platformType":"ANY_PLATFORM"},{"threatEntryMetadata":"NONE","threatType":"MALWARE","fullyQualifiedDomainName":"c.com","platformType":"ANY_PLATFORM"}],"registrarEmailAddress":"b@fake.com"} +{"threatMatches":[{"threatEntryMetadata":"NONE","threatType":"MALWARE","domainName":"a.dev","platformType":"ANY_PLATFORM"}],"registrarEmailAddress":"a@fake.com"} +{"threatMatches":[{"threatEntryMetadata":"NONE","threatType":"MALWARE","domainName":"b.com","platformType":"ANY_PLATFORM"},{"threatEntryMetadata":"NONE","threatType":"MALWARE","domainName":"c.com","platformType":"ANY_PLATFORM"}],"registrarEmailAddress":"b@fake.com"} diff --git a/core/src/test/resources/google/registry/ui/server/registrar/update_registrar.json b/core/src/test/resources/google/registry/ui/server/registrar/update_registrar.json index 283345f1e..9ed6abed1 100644 --- a/core/src/test/resources/google/registry/ui/server/registrar/update_registrar.json +++ b/core/src/test/resources/google/registry/ui/server/registrar/update_registrar.json @@ -2,7 +2,7 @@ "op": "update", "id": "TheRegistrar", "args": { - "clientIdentifier": "theregistrar", + "registrarId": "theregistrar", "driveFolderId": null, "registrarName": "The Registrar", "lastUpdateTime": "%LAST_UPDATE_TIME%", diff --git a/core/src/test/resources/google/registry/ui/server/registrar/update_registrar_duplicate_contacts.json b/core/src/test/resources/google/registry/ui/server/registrar/update_registrar_duplicate_contacts.json index f4f474bc7..f245cfa46 100644 --- a/core/src/test/resources/google/registry/ui/server/registrar/update_registrar_duplicate_contacts.json +++ b/core/src/test/resources/google/registry/ui/server/registrar/update_registrar_duplicate_contacts.json @@ -2,7 +2,7 @@ "op": "update", "id": "TheRegistrar", "args": { - "clientIdentifier": "theregistrar", + "registrarId": "theregistrar", "driveFolderId": null, "registrarName": "The Registrar", "lastUpdateTime": "%LAST_UPDATE_TIME%", diff --git a/core/src/test/resources/google/registry/ui/server/registrar/update_registrar_email.txt b/core/src/test/resources/google/registry/ui/server/registrar/update_registrar_email.txt index 19a195aa2..06786d295 100644 --- a/core/src/test/resources/google/registry/ui/server/registrar/update_registrar_email.txt +++ b/core/src/test/resources/google/registry/ui/server/registrar/update_registrar_email.txt @@ -1,7 +1,7 @@ The following changes were made in registry unittest environment to the registrar TheRegistrar by user user@email.com: whoisServer: null -> foo.bar.baz -ipAddressWhitelist: null -> [1.1.1.1/32, 2.2.2.2/32, 4.4.4.4/32] +ipAddressAllowList: null -> [1.1.1.1/32, 2.2.2.2/32, 4.4.4.4/32] localizedAddress.street.0: 123 Example Bőulevard -> 123 Street Rd localizedAddress.street.1: null -> Ste 156 localizedAddress.city: Williamsburg -> New York diff --git a/db/src/main/resources/sql/schema/db-schema.sql.generated b/db/src/main/resources/sql/schema/db-schema.sql.generated index 7165e65b9..b48a6f75a 100644 --- a/db/src/main/resources/sql/schema/db-schema.sql.generated +++ b/db/src/main/resources/sql/schema/db-schema.sql.generated @@ -92,8 +92,8 @@ create table "ClaimsList" ( revision_id bigserial not null, - tmdb_generation_time timestamptz not null, creation_timestamp timestamptz not null, + tmdb_generation_time timestamptz not null, primary key (revision_id) ); @@ -516,8 +516,8 @@ host_repo_id text, message text, transfer_response_contact_id text, - transfer_response_domain_expiration_time timestamptz, transfer_response_domain_name text, + transfer_response_domain_expiration_time timestamptz, transfer_response_host_id text, pending_action_response_action_result boolean, pending_action_response_name_or_id text, diff --git a/util/src/main/java/google/registry/util/DomainNameUtils.java b/util/src/main/java/google/registry/util/DomainNameUtils.java index 1c2fffdbe..d9b0538fa 100644 --- a/util/src/main/java/google/registry/util/DomainNameUtils.java +++ b/util/src/main/java/google/registry/util/DomainNameUtils.java @@ -61,14 +61,12 @@ public final class DomainNameUtils { * google.registry.model.tld.Registries#findTldForName(InternetDomainName) * Registries#findTldForName}, which will work on hostnames in addition to domains. * - * @param fullyQualifiedDomainName must be a punycode SLD (not a host or unicode) + * @param domainName must be a punycode SLD (not a host or unicode) * @throws IllegalArgumentException if there is no TLD */ - public static String getTldFromDomainName(String fullyQualifiedDomainName) { - checkArgument( - !Strings.isNullOrEmpty(fullyQualifiedDomainName), - "fullyQualifiedDomainName cannot be null or empty"); - return getTldFromDomainName(InternetDomainName.from(fullyQualifiedDomainName)); + public static String getTldFromDomainName(String domainName) { + checkArgument(!Strings.isNullOrEmpty(domainName), "domainName cannot be null or empty"); + return getTldFromDomainName(InternetDomainName.from(domainName)); } /**