Rename Runnable classes from Tasks to Actions

This is cleanup relating to a naming decision that we made awhile ago
but never got around to.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117244827
This commit is contained in:
mcilwain 2016-03-15 09:14:24 -07:00 committed by Justine Tunney
parent 5f7bf57cf9
commit 57fa57968d
48 changed files with 320 additions and 318 deletions

View file

@ -23,7 +23,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.net.MediaType;
import com.google.domain.registry.model.registrar.Registrar;
import com.google.domain.registry.tools.Command.GtechCommand;
import com.google.domain.registry.tools.server.CreateGroupsTask;
import com.google.domain.registry.tools.server.CreateGroupsAction;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
@ -77,8 +77,8 @@ public class CreateRegistrarGroupsCommand extends ConfirmingCommand
protected String execute() throws IOException {
for (Registrar registrar : registrars) {
connection.send(
CreateGroupsTask.PATH,
ImmutableMap.of(CreateGroupsTask.CLIENT_ID_PARAM, registrar.getClientIdentifier()),
CreateGroupsAction.PATH,
ImmutableMap.of(CreateGroupsAction.CLIENT_ID_PARAM, registrar.getClientIdentifier()),
MediaType.PLAIN_TEXT_UTF_8,
new byte[0]);
}

View file

@ -14,7 +14,7 @@
package com.google.domain.registry.tools.server;
import static com.google.domain.registry.export.SyncGroupMembersTask.getGroupEmailAddressForContactType;
import static com.google.domain.registry.export.SyncGroupMembersAction.getGroupEmailAddressForContactType;
import static com.google.domain.registry.request.Action.Method.POST;
import static java.util.Arrays.asList;
import static javax.servlet.http.HttpServletResponse.SC_OK;
@ -42,9 +42,9 @@ import java.util.List;
import javax.annotation.Nullable;
import javax.inject.Inject;
/** A task that creates Google Groups for a registrar's mailing lists. */
@Action(path = CreateGroupsTask.PATH, method = POST)
public class CreateGroupsTask implements Runnable {
/** Action that creates Google Groups for a registrar's mailing lists. */
@Action(path = CreateGroupsAction.PATH, method = POST)
public class CreateGroupsAction implements Runnable {
public static final String PATH = "/_dr/admin/createGroups";
public static final String CLIENT_ID_PARAM = "clientId";
@ -55,7 +55,7 @@ public class CreateGroupsTask implements Runnable {
@Inject Response response;
@Inject @Config("publicDomainName") String publicDomainName;
@Inject @Parameter("clientId") Optional<String> clientId;
@Inject CreateGroupsTask() {}
@Inject CreateGroupsAction() {}
@Override
public void run() {

View file

@ -36,7 +36,7 @@ public class ToolsServerModule {
@Provides
@Parameter("clientId")
static Optional<String> provideClientId(HttpServletRequest req) {
return Optional.fromNullable(emptyToNull(req.getParameter(CreateGroupsTask.CLIENT_ID_PARAM)));
return Optional.fromNullable(emptyToNull(req.getParameter(CreateGroupsAction.CLIENT_ID_PARAM)));
}
@Provides