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