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.OptionParserjoptsimple.OptionSpec<String> joptsimple.OptionSpec<Boolean> getUser()joptsimple.OptionSpec<String> booleanprotected UserreadOptions(joptsimple.OptionSet optionSet) Reads theOptionSetand generates aUserinstance from the options supplied to this command.voidPassed to the command after it has been instantiated by the IoC system.protected abstract voidwriteUserToDatabase(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, waitMethods 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:SetupCommandPassed to the command after it has been instantiated by the IoC system.- Specified by:
runin interfaceSetupCommand- Parameters:
args-- Throws:
Exception
-
readOptions
Reads theOptionSetand generates aUserinstance from the options supplied to this command. The returnedUserwill be made available using subsequent calls usinggetUser().- Parameters:
optionSet- theOptionSetmade 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-
-