Class StoreCommands
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.cli.CommonCommands
-
- edu.uiuc.ncsa.security.storage.cli.StoreCommands
-
- Direct Known Subclasses:
SASCommands
public abstract class StoreCommands extends CommonCommands
This also has the machinery for parsing configurations since the user should be able to load one from the command line.Created by Jeff Gaynor
on 5/20/13 at 3:22 PM
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StoreCommands.RSRecord
-
Field Summary
-
Fields inherited from class edu.uiuc.ncsa.security.util.cli.CommonCommands
BATCH_FILE_LINE_CONTINUES, BATCH_FILE_MODE_FLAG, BATCH_MODE_FLAG, batchFile, CL_INPUT_FILE_FLAG, CL_OUTPUT_FILE_FLAG, DEFAULT_NULL_VALUE_PLACEHOLDER, defaultIndent, INDENT, logger, placeHolder
-
-
Constructor Summary
Constructors Modifier Constructor Description StoreCommands(AbstractEnvironment environment)
StoreCommands(MyLoggingFacade logger)
StoreCommands(MyLoggingFacade logger, Store store)
protected
StoreCommands(MyLoggingFacade logger, String defaultIndent, Store store)
Constructor that sets the indent level for this command processor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected Identifiable
actualCreate(InputLine inputLine, int magicNumber)
does the actual creation and returns the created object.protected void
addEntry(Identifiable identifiable, String key, String value)
protected void
addEntry(Identifiable identifiable, net.sf.json.JSON jjj)
Add to an existing entry.void
archive(InputLine inputLine)
protected String
archiveFormat(Identifiable id)
void
bootstrap()
void
clear_id(InputLine inputLine)
void
clear_store(InputLine line)
protected void
clearEntries()
Clears the list of entries so next call will get it afreshvoid
copy(InputLine inputLine)
protected Identifiable
create(Identifiable identifiable)
protected Identifiable
create(Identifiable c, int magicNumber)
void
create(InputLine inputLine)
Creates a new item.protected Identifiable
createEntry(int magicNumber)
Wraps the store create method.Identifiable
createNew()
void
deserialize(InputLine inputLine)
protected Identifier
doCopy(Identifiable source, Identifier targetId, boolean useRandomID)
Do the copy.protected void
doRename(Identifier srcID, Identifier targetID)
void
edit(InputLine inputLine)
protected String
escapeRegex(String x)
abstract void
extraUpdates(Identifiable identifiable, int magicNumber)
This is a hook for extensions so they don't have to completely rewrite complexupdate(edu.uiuc.ncsa.security.core.Identifiable)
methods.protected Identifiable
findItem(InputLine inputLine)
Resolves the first argument of a command line into either a unique identifier The contract is that IF there is an ID set (withset_id(InputLine)
) then use that.protected abstract String
format(Identifiable identifiable)
In listing operations, take theIdentifiable
argument and make a string version that a user can understandprotected String
formatLongLine(String leftSide, String rightSide, int leftColumWidth, boolean isVerbose)
Gets a consistent look and feel.protected Identifiable
fromXMLMap(XMLMap map)
Take the updated values for the object and return a new, updated object.void
get_id(InputLine inputLine)
protected String
getAndCheckKeyArg(InputLine inputLine)
resolves key shorthand of &key_name or -key key_name returns null if no such key OR if it is not valid in the key list.protected List<String>
getArgList(InputLine inputLine)
Deprecated.EditorEntry
getEditorEntry()
AbstractEnvironment
getEnvironment()
Identifier
getID()
Mutators for sub classesprotected String
getKeyArg(InputLine inputLine)
protected String
getKeyArg(InputLine inputLine, boolean removeIt)
Just gets the key argument or null if not present.protected MapConverter
getMapConverter()
abstract String
getName()
String
getPrompt()
The prompt displayed to the user.HashMap<String,StoreCommands.RSRecord>
getResultSets()
protected SerializationKeys
getSerializationKeys()
Get the serialization keys for the main store.protected Sortable
getSortable()
Store
getStore()
StoreArchiver
getStoreArchiver()
protected File
getTempDir()
protected boolean
hasEntries()
Tell if the user has run the listAll command.protected boolean
hasId()
boolean
hasID()
protected boolean
hasKey(String key)
protected net.sf.json.JSONObject
inputJSON(net.sf.json.JSONObject oldJSON, String key)
Allows for entering a new JSON object.boolean
isMonitored()
void
list_keys(InputLine inputLine)
protected List<Identifiable>
listAll(boolean useLongFormat, String otherFlags)
protected List<Identifiable>
loadAllEntries()
protected net.sf.json.JSONObject
loadQDLScript(net.sf.json.JSONObject currentConfig)
The contract is that this gets the entire current config and updates exactly the bits relating to QDL.protected int
longFormat(Identifiable identifiable)
Give a long (multi-line) formatted object.protected int
longFormat(Identifiable identifiable, boolean isVerbose)
Long formatting with the switch for verbose or not.protected int
longFormat(Identifiable identifiable, List<String> keySubset, boolean isVerbose)
Prints a restricted set of keys from the first argument.void
ls(InputLine inputLine)
protected String
multiLineInput(String oldValue, String key)
For entering muli-line strings (includes JSON).protected String
multiLinePropertyInput(String propertyName, String oldValue, String key)
protected void
oldls(InputLine inputLine)
protected void
oldrm(InputLine inputLine)
protected void
oldUpdate(InputLine inputLine)
Older version of update.protected Identifiable
preCreation(Identifiable identifiable, int magicNumber)
How to customize different objects this command processor creates (e.g.void
print_help()
boolean
printRS(InputLine inputLine, List<Identifiable> values, List<String> returnedAttributes, List<Integer> limits)
If limits is empty or null, show everything.protected void
removeEntries(Identifiable identifiable, List<String> keys)
protected void
removeEntry(Identifiable identifiable, String key)
void
rename(InputLine inputLine)
void
rm(InputLine inputLine)
protected void
rmCleanup(Identifiable identifiable)
Called if there is additional clean up needed.void
rs(InputLine inputLine)
void
search(InputLine inputLine)
void
serialize(InputLine inputLine)
protected void
serialize(InputLine inputLine, Identifiable x)
void
set_id(InputLine inputLine)
void
setEnvironment(AbstractEnvironment environment)
void
setID(Identifier id)
protected Identifiable
setIDFromInputLine(Identifiable x, InputLine inputLine)
if the user specified the new identifier on the command line, peel it off and use it.void
setResultSets(HashMap<String,StoreCommands.RSRecord> resultSets)
void
setSortable(Sortable sortable)
void
setStore(Store store)
protected void
showArchiveHelp()
protected void
showCommandLineSwitchesHelp()
protected void
showCreateHelp()
protected void
showDeserializeHelp()
protected void
showEntries(Identifiable identifiable, List<String> keys, boolean isVerbose)
protected void
showEntry(Identifiable identifiable, String key, boolean isVerbose)
protected void
showKeyShorthandHelp()
protected void
showListKeysHelp(InputLine inputLine)
protected void
showLSHelp()
protected void
showLSHelp3()
protected void
showResultSetHelp()
protected void
showRMHelp()
protected void
showSearchHelp()
protected void
showSearchHelpExamples()
protected void
showSerializeHelp()
protected void
showSizeHelp()
protected void
showUpdateHelp()
protected void
showUpkeepHelp()
void
size(InputLine inputLine)
protected boolean
supportsQDL()
protected XMLMap
toXMLMap(Identifiable identifiable)
Once an object is found in the store, convert it to JSON so that the properties may be accessed in a canonical way.boolean
update(Identifiable identifiable)
This is the workhorse method for the object that lets you edit the values.boolean
update(Identifiable identifiable, boolean doSave, int magicNumber)
Update the object.void
update(InputLine inputLine)
protected boolean
updateSingleValue(XMLMap map, String key)
protected net.sf.json.JSONArray
updateSingleValue(String key, net.sf.json.JSONArray currentValue)
void
upkeep(InputLine inputLine)
-
Methods inherited from class edu.uiuc.ncsa.security.util.cli.CommonCommands
clear_env, clearEnvHelp, debug, echo, echoHelp, error, get_env, getBufferedReader, getDriver, getHelpUtil, getInput, getIOInterface, getPlaceHolder, getPropertyHelp, getValue, gracefulExit, indentWidth, info, isBatch, isBatchFile, isBatchMode, isDebugOn, isEmpty, isOk, isPrintOuput, isVerbose, logit, print_env, printEnvHelp, printGetEnvHelp, printReadEnvHelp, printSaveEnvHelp, printSetEnvHelp, read_env, readFile, readJSON, readline, readline, save_env, say, say, say2, sayi, sayii, sayv, set_env, set_output_on, set_verbose_on, setBatchFile, setBatchMode, setBufferedReader, setDebugOn, setDriver, setHelpUtil, setIOInterface, setOutputOnHelp, setPlaceHolder, setPrintOuput, setVerbose, setVerboseHelp, showHelp, version, versionHelp, warn
-
-
-
-
Field Detail
-
sortable
protected Sortable sortable
-
UPKEEP_FLAG_TEST
public static String UPKEEP_FLAG_TEST
-
UPKEEP_FLAG_SHOW
public static String UPKEEP_FLAG_SHOW
-
UPKEEP_FLAG_CFG
public static String UPKEEP_FLAG_CFG
-
UPKEEP_FLAG_RUN
public static String UPKEEP_FLAG_RUN
-
UPKEEP_FLAG_ENABLE
public static String UPKEEP_FLAG_ENABLE
-
NEXT_N_COMMAND
protected final String NEXT_N_COMMAND
- See Also:
- Constant Field Values
-
SEARCH_REGEX_FLAG
public static final String SEARCH_REGEX_FLAG
- See Also:
- Constant Field Values
-
SEARCH_SHORT_REGEX_FLAG
public static final String SEARCH_SHORT_REGEX_FLAG
- See Also:
- Constant Field Values
-
SEARCH_SIZE_FLAG
public static final String SEARCH_SIZE_FLAG
- See Also:
- Constant Field Values
-
SEARCH_DEBUG_FLAG
public static final String SEARCH_DEBUG_FLAG
- See Also:
- Constant Field Values
-
SEARCH_RETURNED_ATTRIBUTES_FLAG
public static final String SEARCH_RETURNED_ATTRIBUTES_FLAG
- See Also:
- Constant Field Values
-
SEARCH_RESULT_SET_NAME
public static final String SEARCH_RESULT_SET_NAME
- See Also:
- Constant Field Values
-
SEARCH_BEFORE_TS_FLAG
public static final String SEARCH_BEFORE_TS_FLAG
- See Also:
- Constant Field Values
-
SEARCH_AFTER_TS_FLAG
public static final String SEARCH_AFTER_TS_FLAG
- See Also:
- Constant Field Values
-
SEARCH_DATE_FLAG
public static final String SEARCH_DATE_FLAG
- See Also:
- Constant Field Values
-
resultSets
protected HashMap<String,StoreCommands.RSRecord> resultSets
-
allEntries
protected List<Identifiable> allEntries
-
DEFAULT_MAGIC_NUMBER
public static final int DEFAULT_MAGIC_NUMBER
This is the system default (only one defined, equals zero). use another number so you can specify cases for overrides. This way your commands can work with slightly different types of objects (such as ersatz or service clients) and be able to disambiguate without having some more complex system in the API to do it. Specify any non-zero magic numbers in your commands and use those.- See Also:
- Constant Field Values
-
LINE_LIST_COMMAND
protected final String LINE_LIST_COMMAND
- See Also:
- Constant Field Values
-
ALL_LIST_COMMAND
protected final String ALL_LIST_COMMAND
- See Also:
- Constant Field Values
-
VERBOSE_COMMAND
protected final String VERBOSE_COMMAND
- See Also:
- Constant Field Values
-
SIZE_ALL_FLAG
protected static String SIZE_ALL_FLAG
-
SIZE_VERSIONS_FLAG
protected static String SIZE_VERSIONS_FLAG
-
display_width
protected int display_width
-
FILE_FLAG
public static final String FILE_FLAG
- See Also:
- Constant Field Values
-
UPDATE_FLAG
public static final String UPDATE_FLAG
- See Also:
- Constant Field Values
-
SHORT_UPDATE_FLAG
public static final String SHORT_UPDATE_FLAG
- See Also:
- Constant Field Values
-
KEY_SHORTHAND_PREFIX
public static String KEY_SHORTHAND_PREFIX
-
RANDOM_ID_FLAG
public static String RANDOM_ID_FLAG
-
FORCE_COPY_FLAG
public static String FORCE_COPY_FLAG
-
RS_SHOW_KEY
public static String RS_SHOW_KEY
-
RS_REMOVE_KEY
public static String RS_REMOVE_KEY
-
RS_CLEAR_KEY
public static String RS_CLEAR_KEY
-
RS_LIST_INFO_KEY
public static String RS_LIST_INFO_KEY
-
RM_FORCE_FLAG
public static String RM_FORCE_FLAG
-
-
Constructor Detail
-
StoreCommands
public StoreCommands(MyLoggingFacade logger) throws Throwable
- Throws:
Throwable
-
StoreCommands
public StoreCommands(AbstractEnvironment environment) throws Throwable
- Throws:
Throwable
-
StoreCommands
protected StoreCommands(MyLoggingFacade logger, String defaultIndent, Store store) throws Throwable
Constructor that sets the indent level for this command processor. Every bit of output will be indented by this amount.- Parameters:
defaultIndent
-store
-- Throws:
Throwable
-
StoreCommands
public StoreCommands(MyLoggingFacade logger, Store store) throws Throwable
- Throws:
Throwable
-
-
Method Detail
-
getEnvironment
public AbstractEnvironment getEnvironment()
-
setEnvironment
public void setEnvironment(AbstractEnvironment environment)
-
setSortable
public void setSortable(Sortable sortable)
-
getSortable
protected Sortable getSortable()
-
isMonitored
public boolean isMonitored()
-
showUpkeepHelp
protected void showUpkeepHelp()
-
getName
public abstract String getName()
-
getPrompt
public String getPrompt()
Description copied from interface:Commands
The prompt displayed to the user. This allows it to change based on context.- Returns:
- java.lang.String
-
getStore
public Store getStore()
-
setStore
public void setStore(Store store)
-
showUpdateHelp
protected void showUpdateHelp()
-
showSerializeHelp
protected void showSerializeHelp()
-
serialize
public void serialize(InputLine inputLine)
-
showDeserializeHelp
protected void showDeserializeHelp()
-
deserialize
public void deserialize(InputLine inputLine)
-
getResultSets
public HashMap<String,StoreCommands.RSRecord> getResultSets()
-
setResultSets
public void setResultSets(HashMap<String,StoreCommands.RSRecord> resultSets)
-
search
public void search(InputLine inputLine)
-
printRS
public boolean printRS(InputLine inputLine, List<Identifiable> values, List<String> returnedAttributes, List<Integer> limits)
If limits is empty or null, show everything. If limits has an element, that is the number of things to show starting at 0. If it has two elements, the zeroth is the start, the 1st is that stop index.- Parameters:
inputLine
-values
-returnedAttributes
-limits
-- Returns:
-
getMapConverter
protected MapConverter getMapConverter()
-
edit
public void edit(InputLine inputLine)
-
oldUpdate
protected void oldUpdate(InputLine inputLine) throws IOException
Older version of update. Not nearly as full-featured but still useful, so keep it and in cases it is needed, just invoke it on behalf of the user.- Parameters:
inputLine
-- Throws:
IOException
-
createNew
public Identifiable createNew()
-
update
public boolean update(Identifiable identifiable) throws IOException
This is the workhorse method for the object that lets you edit the values. Generally this should do validation and checking so that updates to the store are not garbage.- Parameters:
identifiable
-- Returns:
- returns true if the passed object needs to be saved, false otherwise.
- Throws:
IOException
-
update
public boolean update(Identifiable identifiable, boolean doSave, int magicNumber) throws IOException
Update the object. doSave if true means to prompt the user to save it (usually what you want). The magic number is for when you are over-riding this with some specific tweak.- Parameters:
identifiable
-doSave
-magicNumber
-- Returns:
- Throws:
IOException
-
extraUpdates
public abstract void extraUpdates(Identifiable identifiable, int magicNumber) throws IOException
This is a hook for extensions so they don't have to completely rewrite complexupdate(edu.uiuc.ncsa.security.core.Identifiable)
methods. It will be invoked before update displays the completed item and saves it, allowing any properties not in the base class to be queried and saved.- Parameters:
identifiable
-magicNumber
-- Throws:
IOException
-
format
protected abstract String format(Identifiable identifiable)
In listing operations, take theIdentifiable
argument and make a string version that a user can understand- Parameters:
identifiable
-
-
longFormat
protected int longFormat(Identifiable identifiable)
Give a long (multi-line) formatted object. This should allow users to see everything cleanly. This assumes the long format, not the verbose- Parameters:
identifiable
-- Returns:
- the width of the left field when formatting (for consistent look and feel in overrides).
-
longFormat
protected int longFormat(Identifiable identifiable, boolean isVerbose)
Long formatting with the switch for verbose or not. If false, that means use the long format- Parameters:
identifiable
-isVerbose
-- Returns:
- the width of the left field when formatting (for consistent look and feel in overrides).
-
hasEntries
protected boolean hasEntries()
Tell if the user has run the listAll command.- Returns:
-
loadAllEntries
protected List<Identifiable> loadAllEntries()
-
clearEntries
protected void clearEntries()
Clears the list of entries so next call will get it afresh
-
listAll
protected List<Identifiable> listAll(boolean useLongFormat, String otherFlags)
-
showCreateHelp
protected void showCreateHelp()
-
create
public void create(InputLine inputLine) throws IOException
Creates a new item. The optional argument is the new identifier.- Parameters:
inputLine
-- Throws:
IOException
-
createEntry
protected Identifiable createEntry(int magicNumber)
Wraps the store create method. This can be overridden in certain cases (e.g. creating users) where special handling is needed.- Returns:
-
getSerializationKeys
protected SerializationKeys getSerializationKeys()
Get the serialization keys for the main store.- Returns:
-
actualCreate
protected Identifiable actualCreate(InputLine inputLine, int magicNumber) throws IOException
does the actual creation and returns the created object. If you overridecreate(InputLine)
, this is what does the actual work.- Parameters:
inputLine
-magicNumber
-- Returns:
- Throws:
IOException
-
setIDFromInputLine
protected Identifiable setIDFromInputLine(Identifiable x, InputLine inputLine)
if the user specified the new identifier on the command line, peel it off and use it.- Parameters:
x
-inputLine
-- Returns:
-
preCreation
protected Identifiable preCreation(Identifiable identifiable, int magicNumber)
How to customize different objects this command processor creates (e.g. creating ersatz clients as a special case with a flag). These are invoked right after creation, but before the object is saved, so you can just set properties or prompt the user for specific properties. Note that if the user elects toupdate(Identifiable)
the properties, then in the course of thatextraUpdates(Identifiable, int)
will be invoked, so that is another location for the user to get prompted for properties.- Parameters:
identifiable
-magicNumber
-- Returns:
-
create
protected Identifiable create(Identifiable identifiable) throws IOException
- Throws:
IOException
-
create
protected Identifiable create(Identifiable c, int magicNumber) throws IOException
- Throws:
IOException
-
hasID
public boolean hasID()
-
getID
public Identifier getID()
Mutators for sub classes- Returns:
-
setID
public void setID(Identifier id)
-
clear_id
public void clear_id(InputLine inputLine)
-
get_id
public void get_id(InputLine inputLine)
-
findItem
protected Identifiable findItem(InputLine inputLine)
Resolves the first argument of a command line into either a unique identifier The contract is that IF there is an ID set (withset_id(InputLine)
) then use that. Otherwise, take the last argument of the input line and try to find that.- Parameters:
inputLine
-- Returns:
-
oldrm
protected void oldrm(InputLine inputLine) throws IOException
- Throws:
IOException
-
rm
public void rm(InputLine inputLine) throws IOException
- Throws:
IOException
-
showLSHelp
protected void showLSHelp()
-
hasId
protected boolean hasId()
-
oldls
protected void oldls(InputLine inputLine)
-
ls
public void ls(InputLine inputLine)
-
showSizeHelp
protected void showSizeHelp()
-
size
public void size(InputLine inputLine)
-
print_help
public void print_help() throws Exception
- Specified by:
print_help
in interfaceCommands
- Overrides:
print_help
in classCommonCommands
- Throws:
Exception
-
formatLongLine
protected String formatLongLine(String leftSide, String rightSide, int leftColumWidth, boolean isVerbose)
Gets a consistent look and feel. If you have to overridelongFormat(Identifiable)
and add your own entries, use this.- Parameters:
leftSide
-rightSide
-leftColumWidth
-- Returns:
-
longFormat
protected int longFormat(Identifiable identifiable, List<String> keySubset, boolean isVerbose)
Prints a restricted set of keys from the first argument. Note that a missing or empty subset means print everything.- Parameters:
identifiable
-keySubset
-isVerbose
-- Returns:
-
serialize
protected void serialize(InputLine inputLine, Identifiable x)
-
showSearchHelp
protected void showSearchHelp()
-
showSearchHelpExamples
protected void showSearchHelpExamples()
-
getAndCheckKeyArg
protected String getAndCheckKeyArg(InputLine inputLine)
resolves key shorthand of &key_name or -key key_name returns null if no such key OR if it is not valid in the key list.- Parameters:
inputLine
-- Returns:
-
getKeyArg
protected String getKeyArg(InputLine inputLine, boolean removeIt)
Just gets the key argument or null if not present. This does no checking if the key that is found is valid for the store.- Parameters:
inputLine
-removeIt
-- Returns:
-
showCommandLineSwitchesHelp
protected void showCommandLineSwitchesHelp()
-
showKeyShorthandHelp
protected void showKeyShorthandHelp()
-
doCopy
protected Identifier doCopy(Identifiable source, Identifier targetId, boolean useRandomID)
Do the copy. Note that if useRandomID is true, targetID is ignored,- Parameters:
source
-targetId
-useRandomID
-
-
doRename
protected void doRename(Identifier srcID, Identifier targetID)
-
showResultSetHelp
protected void showResultSetHelp()
-
showEntries
protected void showEntries(Identifiable identifiable, List<String> keys, boolean isVerbose)
-
showEntry
protected void showEntry(Identifiable identifiable, String key, boolean isVerbose)
-
hasKey
protected boolean hasKey(String key)
-
toXMLMap
protected XMLMap toXMLMap(Identifiable identifiable)
Once an object is found in the store, convert it to JSON so that the properties may be accessed in a canonical way. This lets us take any identifiable object and manipulate its properties without knowing anything else about it.- Parameters:
identifiable
-- Returns:
-
fromXMLMap
protected Identifiable fromXMLMap(XMLMap map)
Take the updated values for the object and return a new, updated object. This does not store it, so you have to do that if you want to keep the changes.- Parameters:
map
-
-
inputJSON
protected net.sf.json.JSONObject inputJSON(net.sf.json.JSONObject oldJSON, String key) throws IOException
Allows for entering a new JSON object. This permits multi-line entry so formatted JSON can be cut and pasted into the command line (as long as there are no blank lines). This will validate the JSON, print out a message and check that you want to keep the new JSON. Note that you cannot overwrite the value of a configuration at this point mostly as a safety feature. So hitting return or /exit will have the same effect of keeping the current value.- Parameters:
oldJSON
-- Returns:
- null if the input is terminated (so retain the old object)
- Throws:
IOException
-
multiLinePropertyInput
protected String multiLinePropertyInput(String propertyName, String oldValue, String key) throws IOException
- Throws:
IOException
-
multiLineInput
protected String multiLineInput(String oldValue, String key) throws IOException
For entering muli-line strings (includes JSON).- Parameters:
oldValue
- may be null if a new valuekey
- used for constructing prompts.- Returns:
- Throws:
IOException
-
addEntry
protected void addEntry(Identifiable identifiable, net.sf.json.JSON jjj)
Add to an existing entry.- Parameters:
identifiable
-jjj
-
-
addEntry
protected void addEntry(Identifiable identifiable, String key, String value)
-
removeEntries
protected void removeEntries(Identifiable identifiable, List<String> keys)
-
removeEntry
protected void removeEntry(Identifiable identifiable, String key)
-
updateSingleValue
protected boolean updateSingleValue(XMLMap map, String key) throws IOException
- Throws:
IOException
-
supportsQDL
protected boolean supportsQDL()
-
updateSingleValue
protected net.sf.json.JSONArray updateSingleValue(String key, net.sf.json.JSONArray currentValue) throws IOException
- Throws:
IOException
-
getArgList
protected List<String> getArgList(InputLine inputLine)
Deprecated.Slightly special case. This will look on the input line and extract a list of the form[a,b,c,...]
So to avoid having a lot of parsing (and the fact that there is pretty much at most one array per line) this will take everything between [ ] and try to turn it in to a list. The alternative would be make the list syntax have to conform toInputLine
's fairly primitive system of checking for flags.- Parameters:
inputLine
-- Returns:
-
getEditorEntry
public EditorEntry getEditorEntry()
-
getTempDir
protected File getTempDir()
-
archive
public void archive(InputLine inputLine) throws Exception
- Parameters:
inputLine
-- Throws:
Exception
-
showArchiveHelp
protected void showArchiveHelp()
-
archiveFormat
protected String archiveFormat(Identifiable id)
-
getStoreArchiver
public StoreArchiver getStoreArchiver()
-
update
public void update(InputLine inputLine) throws IOException
- Throws:
IOException
-
loadQDLScript
protected net.sf.json.JSONObject loadQDLScript(net.sf.json.JSONObject currentConfig) throws IOException
The contract is that this gets the entire current config and updates exactly the bits relating to QDL. This is then saved elsewhere.- Parameters:
currentConfig
-- Returns:
- Throws:
IOException
-
showListKeysHelp
protected void showListKeysHelp(InputLine inputLine)
-
showLSHelp3
protected void showLSHelp3()
-
showRMHelp
protected void showRMHelp()
-
rmCleanup
protected void rmCleanup(Identifiable identifiable)
Called if there is additional clean up needed. For instance, removing a client requires removing its approval record.- Parameters:
identifiable
-
-
bootstrap
public void bootstrap() throws Throwable
- Specified by:
bootstrap
in interfaceCommands
- Overrides:
bootstrap
in classCommonCommands
- Throws:
Throwable
-
-