Class StoreUtil
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.cli.CLITool
-
- edu.uiuc.ncsa.security.storage.cli.StoreUtil
-
- All Implemented Interfaces:
Logable
public abstract class StoreUtil extends CLITool
A storage utility that will allow for server administrators to do basic store operations such as delete, read, create or update from the command line. This follows the general pattern of listing all the elements and having the admin select the one to operate on.Created by Jeff Gaynor
on 5/15/13 at 11:51 AM
-
-
Field Summary
Fields Modifier and Type Field Description static int
ACTION_CREATE
static int
ACTION_DELETE
static int
ACTION_EXIT
static String
ACTION_KEY_CREATE
static String
ACTION_KEY_DELETE
static String
ACTION_KEY_EXIT
static String
ACTION_KEY_READ
static String
ACTION_KEY_UPDATE
static int
ACTION_READ
static int
ACTION_UNKNOWN
static int
ACTION_UPDATE
-
Fields inherited from class edu.uiuc.ncsa.security.util.cli.CLITool
CONFIG_FILE_LONG_OPTION, CONFIG_FILE_OPTION, CONFIG_NAME_ACTION, CONFIG_NAME_LONG_OPTION, CONFIG_NAME_OPTION, DEBUG_LONG_OPTION, DEBUG_OPTION, DEFAULT_LOG_FILE, HELP_LONG_OPTION, HELP_OPTION, LOG_FILE_LONG_OPTION, LOG_FILE_OPTION, NO_ACTION, VERBOSE_LONG_OPTION, VERBOSE_OPTION
-
-
Constructor Summary
Constructors Constructor Description StoreUtil()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
create()
protected void
delete()
void
doIt()
Does the actual work.protected int
getAction(String input)
protected abstract Store
getStore()
Get the store this operates on.void
help()
This will be automatically invoked for you if the user supplies a help option.protected LinkedList<Identifiable>
listAll()
protected void
show()
abstract void
update()
-
Methods inherited from class edu.uiuc.ncsa.security.util.cli.CLITool
checkAction, debug, defaultHelp, error, error, getAction, getBufferedReader, getCommandLine, getComponentName, getConfigFile, getConfigurationNode, getEnvironment, getIoInterface, getLoader, getLogfileName, getMyLogger, getOptions, getOptions, hasOption, info, initialize, isDebugOn, isVerbose, parseCommandLine, readline, run, run, say, say2, sayv, setAction, setBufferedReader, setCommandLine, setConfigFile, setConfigurationNode, setDebugOn, setEnvironment, setIoInterface, setLogfileName, setMyLogger, setVerbose, warn
-
-
-
-
Field Detail
-
ACTION_CREATE
public static final int ACTION_CREATE
- See Also:
- Constant Field Values
-
ACTION_READ
public static final int ACTION_READ
- See Also:
- Constant Field Values
-
ACTION_UPDATE
public static final int ACTION_UPDATE
- See Also:
- Constant Field Values
-
ACTION_DELETE
public static final int ACTION_DELETE
- See Also:
- Constant Field Values
-
ACTION_EXIT
public static final int ACTION_EXIT
- See Also:
- Constant Field Values
-
ACTION_UNKNOWN
public static final int ACTION_UNKNOWN
- See Also:
- Constant Field Values
-
ACTION_KEY_CREATE
public static final String ACTION_KEY_CREATE
- See Also:
- Constant Field Values
-
ACTION_KEY_READ
public static final String ACTION_KEY_READ
- See Also:
- Constant Field Values
-
ACTION_KEY_UPDATE
public static final String ACTION_KEY_UPDATE
- See Also:
- Constant Field Values
-
ACTION_KEY_DELETE
public static final String ACTION_KEY_DELETE
- See Also:
- Constant Field Values
-
ACTION_KEY_EXIT
public static final String ACTION_KEY_EXIT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getStore
protected abstract Store getStore() throws Exception
Get the store this operates on.- Returns:
- Throws:
Exception
-
doIt
public void doIt() throws Exception
Description copied from class:CLITool
Does the actual work. This is where you put your executable code.
-
listAll
protected LinkedList<Identifiable> listAll() throws Exception
- Throws:
Exception
-
help
public void help()
Description copied from class:CLITool
This will be automatically invoked for you if the user supplies a help option. This should just print out to the command line (using theCLITool.say(String)
method), rather than logging the help.
-
getAction
protected int getAction(String input)
-
-