Package google.registry.tools
Class MutatingEppToolCommand
- java.lang.Object
-
- google.registry.tools.ConfirmingCommand
-
- google.registry.tools.MutatingEppToolCommand
-
- All Implemented Interfaces:
Command
,CommandWithConnection
public abstract class MutatingEppToolCommand extends ConfirmingCommand
A command to execute an epp command that intends to mutate objects (i.e. enables a dry run option).
-
-
Constructor Summary
Constructors Constructor Description MutatingEppToolCommand()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addSoyRecord(java.lang.String clientId, com.google.template.soy.data.SoyRecord record)
protected void
addXmlCommand(java.lang.String clientId, java.lang.String xml)
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.java.lang.String
execute()
Perform the command and return a result description.protected void
init()
Initializes the command.protected void
initEppToolCommand()
protected abstract void
initMutatingEppToolCommand()
protected boolean
isDryRun()
Subclasses can override to implement a dry run flag.java.lang.String
prompt()
Returns the optional extra confirmation prompt for the command.void
setConnection(ServiceConnection connection)
protected void
setSoyTemplate(com.google.template.soy.parseinfo.SoyFileInfo soyFileInfo, com.google.template.soy.parseinfo.SoyTemplateInfo soyRenderer)
protected static com.google.common.collect.Multimap<java.lang.String,java.lang.String>
validateAndGroupDomainNamesByTld(java.util.List<java.lang.String> names)
Helper function for grouping sets of domain names into respective TLDs.-
Methods inherited from class google.registry.tools.ConfirmingCommand
postExecute, run
-
-
-
-
Method Detail
-
checkExecutionState
protected boolean checkExecutionState()
Description copied from class:ConfirmingCommand
Run any pre-execute command checks and return true if they all pass.- Overrides:
checkExecutionState
in classConfirmingCommand
-
isDryRun
protected boolean isDryRun()
Subclasses can override to implement a dry run flag. False by default.
-
initEppToolCommand
protected void initEppToolCommand() throws java.lang.Exception
- Throws:
java.lang.Exception
-
initMutatingEppToolCommand
protected abstract void initMutatingEppToolCommand() throws java.lang.Exception
- Throws:
java.lang.Exception
-
validateAndGroupDomainNamesByTld
protected static com.google.common.collect.Multimap<java.lang.String,java.lang.String> validateAndGroupDomainNamesByTld(java.util.List<java.lang.String> names)
Helper function for grouping sets of domain names into respective TLDs. Useful for batched EPP calls when invoking commands (i.e. domain check) with sets of domains across multiple TLDs.
-
setSoyTemplate
protected void setSoyTemplate(com.google.template.soy.parseinfo.SoyFileInfo soyFileInfo, com.google.template.soy.parseinfo.SoyTemplateInfo soyRenderer)
-
setConnection
public void setConnection(ServiceConnection connection)
- Specified by:
setConnection
in interfaceCommandWithConnection
-
addXmlCommand
protected void addXmlCommand(java.lang.String clientId, java.lang.String xml)
-
addSoyRecord
protected void addSoyRecord(java.lang.String clientId, com.google.template.soy.data.SoyRecord record)
-
dontRunCommand
protected boolean dontRunCommand()
Description copied from class:ConfirmingCommand
Whether to NOT run the command. Override to true for dry-run commands.- Overrides:
dontRunCommand
in classConfirmingCommand
-
prompt
public java.lang.String prompt() throws java.io.IOException
Description copied from class:ConfirmingCommand
Returns the optional extra confirmation prompt for the command.- Overrides:
prompt
in classConfirmingCommand
- Throws:
java.io.IOException
-
execute
public java.lang.String execute() throws java.lang.Exception
Description copied from class:ConfirmingCommand
Perform the command and return a result description.- Specified by:
execute
in classConfirmingCommand
- Throws:
java.lang.Exception
-
init
protected final void init() throws java.lang.Exception
Description copied from class:ConfirmingCommand
Initializes the command.- Overrides:
init
in classConfirmingCommand
- Throws:
java.lang.Exception
-
-