Rename RemoteApiCommand to CommandWithRemoteApi

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211521742
This commit is contained in:
mmuller 2018-09-04 14:10:04 -07:00 committed by jianglai
parent e43349592d
commit 8a2388f5b6
38 changed files with 40 additions and 39 deletions

View file

@ -26,7 +26,7 @@ import javax.inject.Inject;
* Command to check the status of a Datastore backup, or "snapshot".
*/
@Parameters(separators = " =", commandDescription = "Check the status of a Datastore snapshot")
public class CheckSnapshotCommand implements RemoteApiCommand {
public class CheckSnapshotCommand implements CommandWithRemoteApi {
@Parameter(
names = {"-s", "--snapshot"},

View file

@ -20,4 +20,4 @@
*/
package google.registry.tools;
interface RemoteApiCommand extends Command {}
interface CommandWithRemoteApi extends Command {}

View file

@ -28,7 +28,7 @@ import org.joda.time.DateTime;
/** Command to show the count of active domains on a given TLD. */
@Parameters(separators = " =", commandDescription = "Show count of domains on TLD")
final class CountDomainsCommand implements RemoteApiCommand {
final class CountDomainsCommand implements CommandWithRemoteApi {
@Parameter(description = "TLD(s) to count domains on", required = true)
private List<String> mainParameters;

View file

@ -32,7 +32,8 @@ import org.joda.time.DateTime;
/** A command to create a new domain via EPP. */
@Parameters(separators = " =", commandDescription = "Create a new domain via EPP.")
final class CreateDomainCommand extends CreateOrUpdateDomainCommand implements RemoteApiCommand {
final class CreateDomainCommand extends CreateOrUpdateDomainCommand
implements CommandWithRemoteApi {
@Parameter(
names = "--period",

View file

@ -30,7 +30,7 @@ import javax.annotation.Nullable;
* list is currently in use on a tld.
*/
@Parameters(separators = " =", commandDescription = "Delete a PremiumList from Datastore.")
final class DeletePremiumListCommand extends ConfirmingCommand implements RemoteApiCommand {
final class DeletePremiumListCommand extends ConfirmingCommand implements CommandWithRemoteApi {
@Nullable
PremiumList premiumList;

View file

@ -30,7 +30,7 @@ import google.registry.model.registry.Registry.TldType;
* <p>This command will fail if any domains are currently registered on the TLD.
*/
@Parameters(separators = " =", commandDescription = "Delete a TLD from Datastore.")
final class DeleteTldCommand extends ConfirmingCommand implements RemoteApiCommand {
final class DeleteTldCommand extends ConfirmingCommand implements CommandWithRemoteApi {
private Registry registry;

View file

@ -25,7 +25,7 @@ import javax.inject.Inject;
/** Command to encrypt an escrow deposit. */
@Parameters(separators = " =", commandDescription = "Encrypt an escrow deposit")
class EncryptEscrowDepositCommand implements RemoteApiCommand {
class EncryptEscrowDepositCommand implements CommandWithRemoteApi {
@Parameter(
names = {"-t", "--tld"},

View file

@ -49,7 +49,7 @@ import javax.inject.Named;
commandDescription =
"Generates and persists the given number of AllocationTokens, printing each token to stdout."
)
public class GenerateAllocationTokensCommand implements RemoteApiCommand {
public class GenerateAllocationTokensCommand implements CommandWithRemoteApi {
@Parameter(
names = {"-p", "--prefix"},

View file

@ -51,7 +51,7 @@ import org.joda.time.DateTime;
/** Command to generate a report of all domain applications. */
@Parameters(separators = " =", commandDescription = "Generate report of all domain applications.")
final class GenerateApplicationsReportCommand implements RemoteApiCommand {
final class GenerateApplicationsReportCommand implements CommandWithRemoteApi {
@Parameter(
names = {"-t", "--tld"},

View file

@ -66,7 +66,7 @@ import org.joda.time.format.DateTimeFormatter;
/** Command to generate the auction data for a TLD. */
@Parameters(separators = " =", commandDescription = "Generate auction data")
final class GenerateAuctionDataCommand implements RemoteApiCommand {
final class GenerateAuctionDataCommand implements CommandWithRemoteApi {
@Parameter(
description = "TLD(s) to generate auction data for",

View file

@ -40,7 +40,7 @@ import org.json.simple.JSONValue;
/** Command to generate a report of all DNS data. */
@Parameters(separators = " =", commandDescription = "Generate report of all DNS data in a TLD.")
final class GenerateDnsReportCommand implements RemoteApiCommand {
final class GenerateDnsReportCommand implements CommandWithRemoteApi {
@Parameter(
names = {"-t", "--tld"},

View file

@ -43,7 +43,7 @@ import org.joda.time.DateTime;
* be stored in the specified manual subdirectory of the GCS RDE bucket.
*/
@Parameters(separators = " =", commandDescription = "Generate an XML escrow deposit.")
final class GenerateEscrowDepositCommand implements RemoteApiCommand {
final class GenerateEscrowDepositCommand implements CommandWithRemoteApi {
@Parameter(
names = {"-t", "--tld"},

View file

@ -31,7 +31,7 @@ import org.joda.time.DateTime;
/** Command to generate a LORDN CSV file for an entire TLD. */
@Parameters(separators = " =", commandDescription = "Generate LORDN CSV file")
final class GenerateLordnCommand implements RemoteApiCommand {
final class GenerateLordnCommand implements CommandWithRemoteApi {
@Parameter(
names = {"-t", "--tld"},

View file

@ -30,7 +30,7 @@ import org.joda.time.DateTime;
/** Command to generate a list of all applications for a given domain name(s). */
@Parameters(separators = " =",
commandDescription = "Generate list of application IDs and sponsors for given domain name(s)")
final class GetApplicationIdsCommand implements RemoteApiCommand {
final class GetApplicationIdsCommand implements CommandWithRemoteApi {
@Parameter(
description = "Fully qualified domain name(s)",

View file

@ -38,7 +38,7 @@ import org.joda.time.DateTime;
/** Command to generate a list of all slds in a tld that have open applications. */
@Parameters(separators = " =", commandDescription = "Generate applied-for domains list")
final class GetAppliedLabelsCommand implements RemoteApiCommand {
final class GetAppliedLabelsCommand implements CommandWithRemoteApi {
@Parameter(
names = {"-t", "--tld"},

View file

@ -33,7 +33,7 @@ import java.nio.file.Paths;
* are currently storing in Datastore.
*/
@Parameters(separators = " =", commandDescription = "Download the current claims list")
final class GetClaimsListCommand implements RemoteApiCommand {
final class GetClaimsListCommand implements CommandWithRemoteApi {
@Parameter(
names = {"-o", "--output"},

View file

@ -26,7 +26,7 @@ import org.joda.time.DateTime;
/** Abstract command to print one or more resources to stdout. */
@Parameters(separators = " =")
abstract class GetEppResourceCommand implements RemoteApiCommand {
abstract class GetEppResourceCommand implements CommandWithRemoteApi {
private final DateTime now = DateTime.now(UTC);

View file

@ -33,7 +33,7 @@ import org.joda.time.DateTime;
/** Command to show history entries. */
@Parameters(separators = " =",
commandDescription = "Show history entries that occurred in a given time range")
final class GetHistoryEntriesCommand implements RemoteApiCommand {
final class GetHistoryEntriesCommand implements CommandWithRemoteApi {
@Parameter(
names = {"-a", "--after"},

View file

@ -33,7 +33,7 @@ import org.bouncycastle.openpgp.PGPKeyPair;
separators = " =",
commandDescription = "Retrieves the value of a secret from the keyring."
)
final class GetKeyringSecretCommand implements RemoteApiCommand {
final class GetKeyringSecretCommand implements CommandWithRemoteApi {
@Inject Keyring keyring;

View file

@ -23,7 +23,7 @@ import java.util.List;
/** Command to show a registrar record. */
@Parameters(separators = " =", commandDescription = "Show registrar record(s)")
final class GetRegistrarCommand implements RemoteApiCommand {
final class GetRegistrarCommand implements CommandWithRemoteApi {
@Parameter(
description = "Client identifier of the registrar account(s)",

View file

@ -27,7 +27,7 @@ import java.util.List;
* Command to get info on a Datastore resource by websafe key.
*/
@Parameters(separators = " =", commandDescription = "Fetch a Datastore resource by websafe key")
final class GetResourceByKeyCommand implements RemoteApiCommand {
final class GetResourceByKeyCommand implements CommandWithRemoteApi {
@Parameter(
description = "Websafe key string(s)",

View file

@ -23,7 +23,7 @@ import java.util.List;
/** Command to show a TLD record. */
@Parameters(separators = " =", commandDescription = "Show TLD record(s)")
final class GetTldCommand implements RemoteApiCommand {
final class GetTldCommand implements CommandWithRemoteApi {
@Parameter(
description = "TLD(s) to show",

View file

@ -37,7 +37,7 @@ import org.bouncycastle.openpgp.PGPPublicKey;
/** Command to encrypt/decrypt {@code .ghostryde} files. */
@Parameters(separators = " =", commandDescription = "Encrypt/decrypt a ghostryde file.")
final class GhostrydeCommand implements RemoteApiCommand {
final class GhostrydeCommand implements CommandWithRemoteApi {
@Parameter(
names = {"-e", "--encrypt"},

View file

@ -31,7 +31,7 @@ import java.util.Optional;
/** Lists {@link Cursor} timestamps used by locking rolling cursor tasks, like in RDE. */
@Parameters(separators = " =", commandDescription = "Lists cursor timestamps used by LRC tasks")
final class ListCursorsCommand implements RemoteApiCommand {
final class ListCursorsCommand implements CommandWithRemoteApi {
@Parameter(names = "--type", description = "Which cursor to list.", required = true)
private CursorType cursorType;

View file

@ -33,7 +33,7 @@ import org.json.simple.JSONValue;
*
* <p>The formatting is done on the server side; this class just dumps the results to the screen.
*/
abstract class ListObjectsCommand implements RemoteApiCommand, ServerSideCommand {
abstract class ListObjectsCommand implements ServerSideCommand {
@Nullable
@Parameter(

View file

@ -41,7 +41,7 @@ import java.util.Set;
import javax.annotation.Nullable;
/** A {@link ConfirmingCommand} that changes objects in Datastore. */
public abstract class MutatingCommand extends ConfirmingCommand implements RemoteApiCommand {
public abstract class MutatingCommand extends ConfirmingCommand implements CommandWithRemoteApi {
/**
* A mutation of a specific entity, represented by an old and a new version of the entity.

View file

@ -25,7 +25,7 @@ import javax.inject.Inject;
/** Command to show what escrow deposits are pending generation on the server. */
@Parameters(separators = " =", commandDescription = "List pending RDE/BRDA deposits.")
final class PendingEscrowCommand implements RemoteApiCommand {
final class PendingEscrowCommand implements CommandWithRemoteApi {
private static final Ordering<PendingDeposit> SORTER =
new Ordering<PendingDeposit>() {

View file

@ -185,8 +185,8 @@ final class RegistryCli implements AutoCloseable, CommandRunner {
((CommandWithConnection) command).setConnection(getConnection());
}
// RemoteApiCommands need to have the remote api installed to work.
if (command instanceof RemoteApiCommand) {
// CommandWithRemoteApis need to have the remote api installed to work.
if (command instanceof CommandWithRemoteApi) {
if (installer == null) {
installer = new RemoteApiInstaller();
RemoteApiOptions options = new RemoteApiOptions();

View file

@ -31,7 +31,7 @@ import google.registry.model.registry.Registry;
* {@link RegistrarContact}.
*/
@Parameters(commandDescription = "Re-save all environment entities.")
final class ResaveEnvironmentEntitiesCommand implements RemoteApiCommand {
final class ResaveEnvironmentEntitiesCommand implements CommandWithRemoteApi {
private static final int BATCH_SIZE = 10;

View file

@ -25,7 +25,7 @@ import javax.inject.Inject;
/** Command to send ICANN notification that an escrow deposit was uploaded. */
@Parameters(separators = " =", commandDescription = "Send an ICANN report of an uploaded deposit.")
final class SendEscrowReportToIcannCommand implements RemoteApiCommand {
final class SendEscrowReportToIcannCommand implements CommandWithRemoteApi {
@Parameter(
description = "One or more foo-report.xml files.",

View file

@ -15,5 +15,5 @@
package google.registry.tools;
/** A command that executes on the server. */
interface ServerSideCommand extends CommandWithConnection, RemoteApiCommand {
interface ServerSideCommand extends CommandWithConnection, CommandWithRemoteApi {
}

View file

@ -42,7 +42,7 @@ import org.joda.time.Duration;
/** Composite command to set up OT&E TLDs and accounts. */
@Parameters(separators = " =", commandDescription = "Set up OT&E TLDs and registrars")
final class SetupOteCommand extends ConfirmingCommand implements RemoteApiCommand {
final class SetupOteCommand extends ConfirmingCommand implements CommandWithRemoteApi {
// Regex: 3-14 alphanumeric characters or hyphens, the first of which must be a letter.
private static final Pattern REGISTRAR_PATTERN = Pattern.compile("^[a-z][-a-z0-9]{2,13}$");

View file

@ -29,7 +29,7 @@ import org.joda.time.DateTime;
/** Command to update the claims notice on a domain application. */
@Parameters(separators = " =", commandDescription = "Update the claims notice on an application.")
final class UpdateClaimsNoticeCommand implements RemoteApiCommand {
final class UpdateClaimsNoticeCommand implements CommandWithRemoteApi {
@Parameter(
names = "--id",

View file

@ -32,7 +32,7 @@ import javax.inject.Inject;
separators = " =",
commandDescription = "Update values of secrets in KmsKeyring."
)
final class UpdateKmsKeyringCommand implements RemoteApiCommand {
final class UpdateKmsKeyringCommand implements CommandWithRemoteApi {
@Inject KmsUpdater kmsUpdater;

View file

@ -38,7 +38,7 @@ import org.joda.time.DateTime;
/** Command to update the SMD on a domain application. */
@Parameters(separators = " =", commandDescription = "Update the SMD on an application.")
final class UpdateSmdCommand implements RemoteApiCommand {
final class UpdateSmdCommand implements CommandWithRemoteApi {
@Inject DomainFlowTmchUtils tmchUtils;
@Inject UpdateSmdCommand() {}

View file

@ -30,7 +30,7 @@ import java.util.List;
/** A command to upload a {@link ClaimsListShard}. */
@Parameters(separators = " =", commandDescription = "Manually upload a new claims list file")
final class UploadClaimsListCommand extends ConfirmingCommand implements RemoteApiCommand {
final class UploadClaimsListCommand extends ConfirmingCommand implements CommandWithRemoteApi {
@Parameter(description = "Claims list filename")
private List<String> mainParameters = new ArrayList<>();

View file

@ -34,7 +34,7 @@ import javax.annotation.Nullable;
/** A command to test registrar login credentials. */
@Parameters(separators = " =", commandDescription = "Test registrar login credentials")
final class ValidateLoginCredentialsCommand implements RemoteApiCommand {
final class ValidateLoginCredentialsCommand implements CommandWithRemoteApi {
@Parameter(
names = {"-c", "--client"},

View file

@ -23,7 +23,7 @@ import javax.inject.Inject;
/** Command to execute a WHOIS query. */
@Parameters(separators = " =", commandDescription = "Manually perform a WHOIS query")
final class WhoisQueryCommand implements RemoteApiCommand {
final class WhoisQueryCommand implements CommandWithRemoteApi {
@Parameter(
description = "WHOIS query string",