mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02: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:
parent
d3fe6be385
commit
bb3a0c78c5
15 changed files with 155 additions and 47 deletions
|
@ -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.domain.DomainResource;
|
||||
import javax.annotation.Nullable;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/** Represents a WHOIS lookup on a domain name (i.e. SLD). */
|
||||
class DomainLookupCommand extends DomainOrHostLookupCommand<DomainResource> {
|
||||
public class DomainLookupCommand extends DomainOrHostLookupCommand {
|
||||
|
||||
DomainLookupCommand(InternetDomainName domainName) {
|
||||
this(domainName, null);
|
||||
|
@ -31,7 +34,10 @@ class DomainLookupCommand extends DomainOrHostLookupCommand<DomainResource> {
|
|||
}
|
||||
|
||||
@Override
|
||||
WhoisResponse getSuccessResponse(DomainResource domain, DateTime now) {
|
||||
return new DomainWhoisResponse(domain, now);
|
||||
protected Optional<WhoisResponse> getResponse(InternetDomainName domainName, DateTime now) {
|
||||
final DomainResource domainResource =
|
||||
loadByForeignKey(DomainResource.class, domainName.toString(), now);
|
||||
return Optional.fromNullable(
|
||||
domainResource == null ? null : new DomainWhoisResponse(domainResource, now));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue