mirror of
https://github.com/google/nomulus
synced 2026-05-23 16:21:55 +00:00
Add framework for customizable WHOIS commands
With some additional changes by Ben McIlwain. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=145447136
This commit is contained in:
committed by
Ben McIlwain
parent
d3fe6be385
commit
bb3a0c78c5
@@ -14,13 +14,16 @@
|
||||
|
||||
package google.registry.whois;
|
||||
|
||||
import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.net.InternetDomainName;
|
||||
import google.registry.model.host.HostResource;
|
||||
import javax.annotation.Nullable;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/** Represents a WHOIS lookup on a nameserver based on its hostname. */
|
||||
final class NameserverLookupByHostCommand extends DomainOrHostLookupCommand<HostResource> {
|
||||
public class NameserverLookupByHostCommand extends DomainOrHostLookupCommand {
|
||||
|
||||
NameserverLookupByHostCommand(InternetDomainName hostName) {
|
||||
this(hostName, null);
|
||||
@@ -31,7 +34,10 @@ final class NameserverLookupByHostCommand extends DomainOrHostLookupCommand<Host
|
||||
}
|
||||
|
||||
@Override
|
||||
WhoisResponse getSuccessResponse(HostResource host, DateTime now) {
|
||||
return new NameserverWhoisResponse(host, now);
|
||||
protected Optional<WhoisResponse> getResponse(InternetDomainName hostName, DateTime now) {
|
||||
final HostResource hostResource =
|
||||
loadByForeignKey(HostResource.class, hostName.toString(), now);
|
||||
return Optional.fromNullable(
|
||||
hostResource == null ? null : new NameserverWhoisResponse(hostResource, now));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user