Class AbstractUserSetupCommand
java.lang.Object
dev.getelements.elements.setup.commands.AbstractUserSetupCommand
- All Implemented Interfaces:
SetupCommand
,AutoCloseable
- Direct Known Subclasses:
AddUser
,UpdateUser
Created by patricktwohig on 5/8/15.
-
Field Summary
Fields inherited from interface dev.getelements.elements.setup.SetupCommand
STDERR, STDIN, STDOUT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjoptsimple.OptionSpec
<String> joptsimple.OptionSpec
<User.Level> joptsimple.OptionParser
joptsimple.OptionSpec
<String> joptsimple.OptionSpec
<Boolean> getUser()
joptsimple.OptionSpec
<String> boolean
protected User
readOptions
(joptsimple.OptionSet optionSet) Reads theOptionSet
and generates aUser
instance from the options supplied to this command.void
Passed to the command after it has been instantiated by the IoC system.protected abstract void
writeUserToDatabase
(joptsimple.OptionSet optionSet) Performs the actual changes and commits them to the database.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.getelements.elements.setup.SetupCommand
close
-
Constructor Details
-
AbstractUserSetupCommand
public AbstractUserSetupCommand()
-
-
Method Details
-
getOptionParser
public joptsimple.OptionParser getOptionParser() -
getUsernameOptionSpec
-
getPasswordOptionSpec
-
getEmailOptionSpec
-
getLevelOptionSpec
-
getStrictOptionSpec
-
getUser
-
getPassword
-
hasPassword
public boolean hasPassword() -
run
Description copied from interface:SetupCommand
Passed to the command after it has been instantiated by the IoC system.- Specified by:
run
in interfaceSetupCommand
- Parameters:
args
-- Throws:
Exception
-
readOptions
Reads theOptionSet
and generates aUser
instance from the options supplied to this command. The returnedUser
will be made available using subsequent calls usinggetUser()
.- Parameters:
optionSet
- theOptionSet
made from the arguments passed torun(String[])
.
-
writeUserToDatabase
protected abstract void writeUserToDatabase(joptsimple.OptionSet optionSet) Performs the actual changes and commits them to the database.- Parameters:
optionSet
-
-