Package google.registry.tools
Class ConfirmingCommand
java.lang.Object
google.registry.tools.ConfirmingCommand
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
CreateCancellationsForBillingEventsCommand
,CreateOrUpdateReservedListCommand
,CreateOrUpdateUserCommand
,CreatePremiumListCommand
,CreateRegistrarGroupsCommand
,DeleteUserCommand
,LockOrUnlockDomainCommand
,MutatingCommand
,MutatingEppToolCommand
,RecreateBillingRecurrencesCommand
,UpdateRecurrenceCommand
A
Command
that implements a confirmation step before executing.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Run any pre-execute command checks and return true if they all pass.protected boolean
Whether to NOT run the command.protected abstract String
execute()
Perform the command and return a result description.protected void
init()
Initializes the command.protected String
Perform any post-execution steps (e.g.protected String
prompt()
Returns the optional extra confirmation prompt for the command.final void
run()
Performs the command.
-
Field Details
-
printStream
-
errorPrintStream
-
-
Constructor Details
-
ConfirmingCommand
protected ConfirmingCommand()
-
-
Method Details
-
run
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
Initializes the command.- Throws:
Exception
-
dontRunCommand
protected boolean dontRunCommand()Whether to NOT run the command. Override to true for dry-run commands. -
prompt
Returns the optional extra confirmation prompt for the command.- Throws:
Exception
-
execute
Perform the command and return a result description.- Throws:
Exception
-
postExecute
Perform any post-execution steps (e.g. verifying the result), and return a description String to be printed if non-empty.
-