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

@ -34,9 +34,9 @@ import com.google.domain.registry.util.FormattingLogger;
import javax.inject.Inject;
/** Exports the publicly viewable reserved terms list for a TLD to Google Drive. */
/** Action that exports the publicly viewable reserved terms list for a TLD to Google Drive. */
@Action(path = "/_dr/task/exportReservedTerms", method = POST)
public class ExportReservedTermsTask implements Runnable {
public class ExportReservedTermsAction implements Runnable {
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
static final MediaType EXPORT_MIME_TYPE = MediaType.PLAIN_TEXT_UTF_8;
@ -45,7 +45,7 @@ public class ExportReservedTermsTask implements Runnable {
@Inject DriveConnection driveConnection;
@Inject @Parameter(RequestParameters.PARAM_TLD) String tld;
@Inject Response response;
@Inject ExportReservedTermsTask() {}
@Inject ExportReservedTermsAction() {}
/**
* Exports the reserved terms for the TLD specified via the "tld" param to a newline-delimited

View file

@ -48,10 +48,12 @@ import javax.annotation.Nullable;
import javax.inject.Inject;
/**
* Syncs changes to {@link RegistrarContact} entities with Google Groups using the Directory API.
* Action that syncs changes to {@link RegistrarContact} entities with Google Groups.
*
* <p>This uses the <a href="https://developers.google.com/admin-sdk/directory/">Directory API</a>.
*/
@Action(path = "/_dr/task/syncGroupMembers", method = POST)
public final class SyncGroupMembersTask implements Runnable {
public final class SyncGroupMembersAction implements Runnable {
/**
* The number of threads to run simultaneously (one per registrar) while processing group syncs.
@ -90,7 +92,7 @@ public final class SyncGroupMembersTask implements Runnable {
@Inject GroupsConnection groupsConnection;
@Inject Response response;
@Inject @Config("publicDomainName") String publicDomainName;
@Inject SyncGroupMembersTask() {}
@Inject SyncGroupMembersAction() {}
private void sendResponse(Result result, @Nullable List<Throwable> causes) {
for (Throwable cause : nullToEmpty(causes)) {

View file

@ -49,7 +49,7 @@ import javax.inject.Inject;
/**
* Class for synchronizing all {@link Registrar} datastore objects to a Google Spreadsheet.
*
* @see SyncRegistrarsSheetTask
* @see SyncRegistrarsSheetAction
*/
class SyncRegistrarsSheet {

View file

@ -46,14 +46,14 @@ import javax.annotation.Nullable;
import javax.inject.Inject;
/**
* Task for synchronizing the registrars spreadsheet.
* Action for synchronizing the registrars spreadsheet.
*
* <p>You can specify the spreadsheet ID by passing the "id" parameter. If this parameter is not
* specified, then the spreadsheet ID will be obtained from the registry configuration.
*
* <p>Cron will run this task hourly. So in order to minimize Google Spreadsheets I/O, this task
* <p>Cron will run this action hourly. So in order to minimize Google Spreadsheets I/O, this action
* will iterate through all registrars and check if any entries were modified in the past hour. If
* no modifications were made, the task will exit without performing any syncing.
* no modifications were made, the action will exit without performing any syncing.
*
* <p><b>Note:</b> Setting the "id" parameter will disable the registrar update check.
*
@ -63,8 +63,8 @@ import javax.inject.Inject;
*
* @see SyncRegistrarsSheet
*/
@Action(path = SyncRegistrarsSheetTask.PATH, method = POST)
public class SyncRegistrarsSheetTask implements Runnable {
@Action(path = SyncRegistrarsSheetAction.PATH, method = POST)
public class SyncRegistrarsSheetAction implements Runnable {
private enum Result {
OK(SC_OK, "Sheet successfully updated."),
@ -116,7 +116,7 @@ public class SyncRegistrarsSheetTask implements Runnable {
@Inject @Config("sheetRegistrarId") Optional<String> idConfig;
@Inject @Config("sheetRegistrarInterval") Duration interval;
@Inject @Parameter("id") Optional<String> idParam;
@Inject SyncRegistrarsSheetTask() {}
@Inject SyncRegistrarsSheetAction() {}
@Override
public void run() {