Rename WhoisServer and WhoisHttpServer to actions

These servlets are converted to actions during daggerization. Calling them servers are misleading.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190942237
This commit is contained in:
jianglai 2018-03-29 09:40:44 -07:00
parent 038a2679c7
commit c40eda3235
21 changed files with 170 additions and 185 deletions

View file

@ -852,7 +852,7 @@ public final class RegistryConfig {
/**
* Amount of time public HTTP proxies are permitted to cache our WHOIS responses.
*
* @see google.registry.whois.WhoisHttpServer
* @see google.registry.whois.WhoisHttpAction
*/
@Provides
@Config("whoisHttpExpires")

View file

@ -42,9 +42,9 @@ import google.registry.ui.server.registrar.RegistrarPaymentAction;
import google.registry.ui.server.registrar.RegistrarPaymentSetupAction;
import google.registry.ui.server.registrar.RegistrarPremiumPriceAckAction;
import google.registry.ui.server.registrar.RegistrarSettingsAction;
import google.registry.whois.WhoisHttpServer;
import google.registry.whois.WhoisAction;
import google.registry.whois.WhoisHttpAction;
import google.registry.whois.WhoisModule;
import google.registry.whois.WhoisServer;
/** Dagger component with per-request lifetime for "default" App Engine module. */
@RequestScope
@ -77,8 +77,10 @@ interface FrontendRequestComponent {
RdapIpAction rdapDefaultAction();
RdapNameserverAction rdapNameserverAction();
RdapNameserverSearchAction rdapNameserverSearchAction();
WhoisHttpServer whoisHttpServer();
WhoisServer whoisServer();
WhoisHttpAction whoisHttpAction();
WhoisAction whoisAction();
@Subcomponent.Builder
abstract class Builder implements RequestComponentBuilder<FrontendRequestComponent> {

View file

@ -41,20 +41,16 @@ import org.joda.time.DateTime;
* <p>All commands and responses conform to the WHOIS spec as defined in RFC 3912. Commands must be
* sent via an HTTP POST in the request body.
*
* <p>This servlet is meant to serve as a low level interface for the proxy app which forwards us
* <p>This action is meant to serve as a low level interface for the proxy app which forwards us
* requests received on port 43. However this interface is technically higher level because it sends
* back proper HTTP error codes such as 200, 400, 500, etc. These are discarded by the proxy because
* WHOIS specifies no manner for differentiating successful and erroneous requests.
*
* @see WhoisHttpServer
* @see WhoisHttpAction
* @see <a href="http://www.ietf.org/rfc/rfc3912.txt">RFC 3912: WHOIS Protocol Specification</a>
*/
@Action(
path = "/_dr/whois",
method = POST,
auth = Auth.AUTH_INTERNAL_OR_ADMIN
)
public class WhoisServer implements Runnable {
@Action(path = "/_dr/whois", method = POST, auth = Auth.AUTH_INTERNAL_OR_ADMIN)
public class WhoisAction implements Runnable {
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
@ -75,7 +71,9 @@ public class WhoisServer implements Runnable {
@Inject @Config("whoisDisclaimer") String disclaimer;
@Inject WhoisMetric.Builder metricBuilder;
@Inject WhoisMetrics whoisMetrics;
@Inject WhoisServer() {}
@Inject
WhoisAction() {}
@Override
public void run() {

View file

@ -48,12 +48,12 @@ import org.joda.time.Duration;
/**
* Human-Friendly HTTP WHOIS API
*
* <p>This API uses easy to understand paths rather than {@link WhoisServer} which requires a POST
* <p>This API uses easy to understand paths rather than {@link WhoisAction} which requires a POST
* request containing a WHOIS command. Because the typical WHOIS command is along the lines of
* {@code "domain google.lol"} or the equivalent {@code "google.lol}, this servlet is just going to
* {@code "domain google.lol"} or the equivalent {@code "google.lol}, this action is just going to
* replace the slashes with spaces and let {@link WhoisReader} figure out what to do.
*
* <p>This servlet accepts requests from any origin.
* <p>This action accepts requests from any origin.
*
* <p>You can send AJAX requests to our WHOIS API from your <em>very own</em> website using the
* following embed code:
@ -93,14 +93,10 @@ import org.joda.time.Duration;
* </script>
* </pre>
*
* @see WhoisServer
* @see WhoisAction
*/
@Action(
path = WhoisHttpServer.PATH,
isPrefix = true,
auth = Auth.AUTH_PUBLIC_ANONYMOUS
)
public final class WhoisHttpServer implements Runnable {
@Action(path = WhoisHttpAction.PATH, isPrefix = true, auth = Auth.AUTH_PUBLIC_ANONYMOUS)
public final class WhoisHttpAction implements Runnable {
public static final String PATH = "/whois/";
@ -142,7 +138,9 @@ public final class WhoisHttpServer implements Runnable {
@Inject @RequestPath String requestPath;
@Inject WhoisMetric.Builder metricBuilder;
@Inject WhoisMetrics whoisMetrics;
@Inject WhoisHttpServer() {}
@Inject
WhoisHttpAction() {}
@Override
public void run() {

View file

@ -31,7 +31,7 @@ import org.joda.time.DateTime;
/**
* Instrumentation for WHOIS requests.
*
* @see WhoisServer
* @see WhoisAction
*/
public class WhoisMetrics {