Simplify some of the RDAP Action classes

Overriding getter methods to change values is a bit overkill when these values
are static (don't change based on internal state).

Just setting them in the base class' constructor is simpler.

Also, we can read the PATH of an Action based on the Annotation instead
returning it manually for each Action.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246135754
This commit is contained in:
guyben 2019-05-01 08:32:29 -07:00 committed by jianglai
parent 99aeedc598
commit 90c53152bf
21 changed files with 81 additions and 204 deletions

View file

@ -36,29 +36,14 @@ import org.joda.time.DateTime;
/** RDAP (new WHOIS) action for domain requests. */
@Action(
service = Action.Service.PUBAPI,
path = RdapDomainAction.PATH,
path = "/rdap/domain/",
method = {GET, HEAD},
isPrefix = true,
auth = Auth.AUTH_PUBLIC)
public class RdapDomainAction extends RdapActionBase {
public static final String PATH = "/rdap/domain/";
@Inject public RdapDomainAction() {}
@Override
public String getHumanReadableObjectTypeName() {
return "domain name";
}
@Override
public String getActionPath() {
return PATH;
}
@Override
public EndpointType getEndpointType() {
return EndpointType.DOMAIN;
@Inject public RdapDomainAction() {
super("domain name", EndpointType.DOMAIN);
}
@Override