Remove ServerSideCommand

ServerSideCommand now just aggregates CommandWithConnection and
CommandWithRemoteApi, so it's arguably clearer for commands to just implement
both of these.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211670031
This commit is contained in:
mmuller 2018-09-05 11:44:21 -07:00 committed by jianglai
parent 8a2388f5b6
commit 4c3207647f
9 changed files with 10 additions and 27 deletions

View file

@ -41,7 +41,7 @@ import org.json.simple.JSONValue;
* lists.
*/
abstract class CreateOrUpdatePremiumListCommand extends ConfirmingCommand
implements ServerSideCommand {
implements CommandWithConnection, CommandWithRemoteApi {
@Nullable
@Parameter(

View file

@ -39,7 +39,7 @@ import javax.annotation.Nullable;
/** Command to create a Registrar. */
@Parameters(separators = " =", commandDescription = "Create new registrar account(s)")
final class CreateRegistrarCommand extends CreateOrUpdateRegistrarCommand
implements ServerSideCommand {
implements CommandWithConnection, CommandWithRemoteApi {
private static final ImmutableSet<RegistryToolEnvironment> ENVIRONMENTS_ALLOWING_GROUP_CREATION =
ImmutableSet.of(PRODUCTION, SANDBOX, UNITTEST);

View file

@ -32,7 +32,7 @@ import java.util.List;
*/
@Parameters(separators = " =", commandDescription = "Create groups for a registrar.")
public class CreateRegistrarGroupsCommand extends ConfirmingCommand
implements ServerSideCommand {
implements CommandWithConnection, CommandWithRemoteApi {
@Parameter(
description = "Client identifier(s) of the registrar(s) to create groups for",

View file

@ -46,7 +46,8 @@ import java.util.Map;
import java.util.Objects;
/** A command to execute an epp command. */
abstract class EppToolCommand extends ConfirmingCommand implements ServerSideCommand {
abstract class EppToolCommand extends ConfirmingCommand
implements CommandWithConnection, CommandWithRemoteApi {
@Parameter(
names = {"-u", "--superuser"},

View file

@ -30,7 +30,7 @@ import org.joda.time.DateTime;
/** Command to generate zone files. */
@Parameters(separators = " =", commandDescription = "Generate zone files")
final class GenerateZoneFilesCommand implements ServerSideCommand {
final class GenerateZoneFilesCommand implements CommandWithConnection, CommandWithRemoteApi {
@Parameter(
description = "One or more TLDs to generate zone files for",

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 ServerSideCommand {
abstract class ListObjectsCommand implements CommandWithConnection, CommandWithRemoteApi {
@Nullable
@Parameter(

View file

@ -24,7 +24,8 @@ import google.registry.model.registry.Registries;
/** Command to initiate a load-test. */
@Parameters(separators = " =", commandDescription = "Run a load test.")
class LoadTestCommand extends ConfirmingCommand implements ServerSideCommand {
class LoadTestCommand extends ConfirmingCommand
implements CommandWithConnection, CommandWithRemoteApi {
// This is a mostly arbitrary value, roughly an hour and a quarter. It served as a generous
// timespan for initial backup/restore testing, but has no other special significance.

View file

@ -1,19 +0,0 @@
// Copyright 2017 The Nomulus Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package google.registry.tools;
/** A command that executes on the server. */
interface ServerSideCommand extends CommandWithConnection, CommandWithRemoteApi {
}

View file

@ -40,7 +40,7 @@ import java.util.Objects;
@Parameters(
separators = " =",
commandDescription = "Verify passage of OT&E for specified (or all) registrars")
final class VerifyOteCommand implements ServerSideCommand {
final class VerifyOteCommand implements CommandWithConnection, CommandWithRemoteApi {
@Parameter(
description = "List of registrar names to check; must be the same names as the ones used "