Always display the registrar abuse contact fields in WHOIS

ICANN's Consistent Labeling & Display policy requires that these fields be
present for all domains. We're currently tracking down the last of the data on
our registrars so that we can display these, but if we don't have the data we
should still at least be displaying the field names to make it more clear that
we do support the field, we just don't have the data for this domain yet.

The two fields in question are:

Registrar Abuse Contact Email:
Registrar Abuse Contact Phone:

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201730290
This commit is contained in:
mcilwain 2018-06-22 13:11:22 -07:00 committed by Ben McIlwain
parent 8245d2f1c4
commit 481790bc91
3 changed files with 82 additions and 6 deletions

View file

@ -97,12 +97,12 @@ final class DomainWhoisResponse extends WhoisResponseImpl {
.emitField("Registrar IANA ID", Objects.toString(registrar.getIanaIdentifier(), ""))
// Email address is a required field for registrar contacts. Therefore as long as there
// is an abuse contact, we can get an email address from it.
.emitFieldIfDefined(
.emitField(
"Registrar Abuse Contact Email",
abuseContact.map(RegistrarContact::getEmailAddress).orElse(null))
.emitFieldIfDefined(
abuseContact.map(RegistrarContact::getEmailAddress).orElse(""))
.emitField(
"Registrar Abuse Contact Phone",
abuseContact.map(RegistrarContact::getPhoneNumber).orElse(null))
abuseContact.map(RegistrarContact::getPhoneNumber).orElse(""))
.emitStatusValues(domain.getStatusValues(), domain.getGracePeriods())
.emitContact("Registrant", Optional.of(domain.getRegistrant()), preferUnicode)
.emitContact("Admin", getContactReference(Type.ADMIN), preferUnicode)