Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions core/src/main/java/google/registry/rdap/RdapJsonFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import google.registry.model.registrar.RegistrarPoc;
import google.registry.model.reporting.HistoryEntry;
import google.registry.model.reporting.HistoryEntryDao;
import google.registry.persistence.VKey;
import google.registry.rdap.RdapDataStructures.Event;
import google.registry.rdap.RdapDataStructures.EventAction;
import google.registry.rdap.RdapDataStructures.Link;
Expand Down Expand Up @@ -352,6 +353,8 @@ RdapDomain createRdapDomain(Domain domain, OutputDataType outputDataType) {
}
// RDAP Response Profile 2.6.1: must have at least one status member
// makeStatusValueList should in theory always contain one of either "active" or "inactive".
// RDAP Response Profile 2.6.3, must have a notice about statuses. That is in {@link
// RdapIcannStandardInformation#domainBoilerplateNotices}, not here.
Set<EppEnum> allStatusValues =
Sets.union(domain.getStatusValues(), domain.getGracePeriodStatuses());
ImmutableSet<RdapStatus> status =
Expand All @@ -365,14 +368,21 @@ RdapDomain createRdapDomain(Domain domain, OutputDataType outputDataType) {
"Domain %s (ROID %s) doesn't have any status.",
domain.getDomainName(), domain.getRepoId());
}
// RDAP Response Profile 2.6.3, must have a notice about statuses. That is in {@link
// RdapIcannStandardInformation#domainBoilerplateNotices}

// We're just trying to load the hosts by cache here, but the generics and casting require
// a lot of boilerplate to make the compiler happy
Iterable<VKey<? extends EppResource>> nameservers =
ImmutableSet.copyOf(domain.getNameservers());
ImmutableSet<Host> loadedHosts =
replicaTm()
.transact(
() ->
ImmutableSet.copyOf(replicaTm().loadByKeys(domain.getNameservers()).values()));
() -> {
ImmutableSet.Builder<Host> hostBuilder = new ImmutableSet.Builder<>();
for (EppResource host : EppResource.loadByCacheIfEnabled(nameservers).values()) {
hostBuilder.add((Host) host);
}
return hostBuilder.build();
});

// Add the nameservers to the data; the load was kicked off above for efficiency.
// RDAP Response Profile 2.8: we MUST have the nameservers
Expand Down Expand Up @@ -425,8 +435,7 @@ RdapNameserver createRdapNameserver(Host host, OutputDataType outputDataType) {
&& replicaTm()
.transact(
() ->
replicaTm()
.loadByKey(host.getSuperordinateDomain())
EppResource.loadByCache(host.getSuperordinateDomain())
.cloneProjectedAtTime(getRequestTime())
.getStatusValues()
.contains(StatusValue.PENDING_TRANSFER))) {
Expand Down
Loading