Package google.registry.tools
Class ConfirmingCommand
- java.lang.Object
-
- google.registry.tools.ConfirmingCommand
-
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
CreateCancellationsForOneTimesCommand
,CreateOrUpdateReservedListCommand
,CreatePremiumListCommand
,CreateRegistrarGroupsCommand
,LockOrUnlockDomainCommand
,MutatingCommand
,MutatingEppToolCommand
,SetDatabaseMigrationStateCommand
public abstract class ConfirmingCommand extends java.lang.Object implements Command
ACommand
that implements a confirmation step before executing.
-
-
Constructor Summary
Constructors Constructor Description ConfirmingCommand()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
checkExecutionState()
Run any pre-execute command checks and return true if they all pass.protected boolean
dontRunCommand()
Whether to NOT run the command.protected abstract java.lang.String
execute()
Perform the command and return a result description.protected void
init()
Initializes the command.protected java.lang.String
postExecute()
Perform any post-execution steps (e.g.protected java.lang.String
prompt()
Returns the optional extra confirmation prompt for the command.void
run()
Performs the command.
-
-
-
Method Detail
-
run
public final void run() throws java.lang.Exception
Description copied from interface:Command
Performs the command.
-
checkExecutionState
protected boolean checkExecutionState()
Run any pre-execute command checks and return true if they all pass.
-
init
protected void init() throws java.lang.Exception
Initializes the command.- Throws:
java.lang.Exception
-
dontRunCommand
protected boolean dontRunCommand()
Whether to NOT run the command. Override to true for dry-run commands.
-
prompt
protected java.lang.String prompt() throws java.lang.Exception
Returns the optional extra confirmation prompt for the command.- Throws:
java.lang.Exception
-
execute
protected abstract java.lang.String execute() throws java.lang.Exception
Perform the command and return a result description.- Throws:
java.lang.Exception
-
postExecute
protected java.lang.String postExecute()
Perform any post-execution steps (e.g. verifying the result), and return a description String to be printed if non-empty.
-
-