mirror of
https://github.com/google/nomulus.git
synced 2025-06-08 13:34:44 +02:00
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:
parent
8a4407a9a1
commit
9f017edc2e
21 changed files with 81 additions and 204 deletions
|
@ -76,17 +76,17 @@ import org.joda.time.DateTime;
|
|||
*/
|
||||
@Action(
|
||||
service = Action.Service.PUBAPI,
|
||||
path = RdapEntitySearchAction.PATH,
|
||||
path = "/rdap/entities",
|
||||
method = {GET, HEAD},
|
||||
auth = Auth.AUTH_PUBLIC)
|
||||
public class RdapEntitySearchAction extends RdapSearchActionBase {
|
||||
|
||||
public static final String PATH = "/rdap/entities";
|
||||
|
||||
@Inject @Parameter("fn") Optional<String> fnParam;
|
||||
@Inject @Parameter("handle") Optional<String> handleParam;
|
||||
@Inject @Parameter("subtype") Optional<String> subtypeParam;
|
||||
@Inject public RdapEntitySearchAction() {}
|
||||
@Inject public RdapEntitySearchAction() {
|
||||
super("entity search", EndpointType.ENTITIES);
|
||||
}
|
||||
|
||||
private enum QueryType {
|
||||
FULL_NAME,
|
||||
|
@ -108,21 +108,6 @@ public class RdapEntitySearchAction extends RdapSearchActionBase {
|
|||
private static final String CONTACT_CURSOR_PREFIX = "c:";
|
||||
private static final String REGISTRAR_CURSOR_PREFIX = "r:";
|
||||
|
||||
@Override
|
||||
public String getHumanReadableObjectTypeName() {
|
||||
return "entity search";
|
||||
}
|
||||
|
||||
@Override
|
||||
public EndpointType getEndpointType() {
|
||||
return EndpointType.ENTITIES;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getActionPath() {
|
||||
return PATH;
|
||||
}
|
||||
|
||||
/** Parses the parameters and calls the appropriate search function. */
|
||||
@Override
|
||||
public ImmutableMap<String, Object> getJsonObjectForResource(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue