Class AbstractUserSetupCommand

java.lang.Object
dev.getelements.elements.setup.commands.AbstractUserSetupCommand
All Implemented Interfaces:
SetupCommand, AutoCloseable
Direct Known Subclasses:
AddUser, UpdateUser

public abstract class AbstractUserSetupCommand extends Object implements SetupCommand
Created by patricktwohig on 5/8/15.
  • Constructor Details

    • AbstractUserSetupCommand

      public AbstractUserSetupCommand()
  • Method Details

    • getOptionParser

      public joptsimple.OptionParser getOptionParser()
    • getUsernameOptionSpec

      public joptsimple.OptionSpec<String> getUsernameOptionSpec()
    • getPasswordOptionSpec

      public joptsimple.OptionSpec<String> getPasswordOptionSpec()
    • getEmailOptionSpec

      public joptsimple.OptionSpec<String> getEmailOptionSpec()
    • getLevelOptionSpec

      public joptsimple.OptionSpec<User.Level> getLevelOptionSpec()
    • getStrictOptionSpec

      public joptsimple.OptionSpec<Boolean> getStrictOptionSpec()
    • getUser

      public User getUser()
    • getPassword

      public String getPassword()
    • hasPassword

      public boolean hasPassword()
    • run

      public void run(String[] args) throws Exception
      Description copied from interface: SetupCommand
      Passed to the command after it has been instantiated by the IoC system.
      Specified by:
      run in interface SetupCommand
      Parameters:
      args -
      Throws:
      Exception
    • readOptions

      protected User readOptions(joptsimple.OptionSet optionSet)
      Reads the OptionSet and generates a User instance from the options supplied to this command. The returned User will be made available using subsequent calls using getUser().
      Parameters:
      optionSet - the OptionSet made from the arguments passed to run(String[]).
    • writeUserToDatabase

      protected abstract void writeUserToDatabase(joptsimple.OptionSet optionSet)
      Performs the actual changes and commits them to the database.
      Parameters:
      optionSet -