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 intACTION_CREATEstatic intACTION_DELETEstatic intACTION_EXITstatic StringACTION_KEY_CREATEstatic StringACTION_KEY_DELETEstatic StringACTION_KEY_EXITstatic StringACTION_KEY_READstatic StringACTION_KEY_UPDATEstatic intACTION_READstatic intACTION_UNKNOWNstatic intACTION_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 voidcreate()protected voiddelete()voiddoIt()Does the actual work.protected intgetAction(String input)protected abstract StoregetStore()Get the store this operates on.voidhelp()This will be automatically invoked for you if the user supplies a help option.protected LinkedList<Identifiable>listAll()protected voidshow()abstract voidupdate()-
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 ExceptionDescription copied from class:CLIToolDoes 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:CLIToolThis 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)
-
-