Class BaseClientStoreCommands
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.cli.CommonCommands
-
- edu.uiuc.ncsa.security.storage.cli.StoreCommands
-
- org.oa4mp.server.admin.myproxy.oauth2.base.OA4MPStoreCommands
-
- org.oa4mp.server.admin.myproxy.oauth2.base.BaseClientStoreCommands
-
- All Implemented Interfaces:
edu.uiuc.ncsa.security.core.Logable
,edu.uiuc.ncsa.security.util.cli.Commands
,Serializable
- Direct Known Subclasses:
ClientStoreCommands
,OA2AdminClientCommands
public abstract class BaseClientStoreCommands extends OA4MPStoreCommands
Commands for a base client store. This is the super class to several variations of clients.Created by Jeff Gaynor
on 12/8/16 at 1:03 PM- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BaseClientStoreCommands.ApprovalModsConfig
-
Field Summary
Fields Modifier and Type Field Description static String
APPROVE_FLAG
static String
APPROVER_KEY
protected ClientApprovalStoreCommands
clientApprovalStoreCommands
static int
RESET_SECRET_DEFAULT_SIZE
static String
RESET_SECRET_NEW_FLAG
static String
RESET_SECRET_SIZE_FLAG
-
Fields inherited from class edu.uiuc.ncsa.security.storage.cli.StoreCommands
ALL_LIST_COMMAND, allEntries, DEFAULT_MAGIC_NUMBER, display_width, FILE_FLAG, FORCE_COPY_FLAG, KEY_SHORTHAND_PREFIX, LINE_LIST_COMMAND, LIST_EOL_MARKER, LOAD_ONLY_COMMAND, NEXT_N_COMMAND, RANDOM_ID_FLAG, RESULT_SET_KEY, resultSets, RM_FORCE_FLAG, RS_APPEND_ACTION, RS_CLEAR_ACTION, RS_DROP_ACTION, RS_FIELDS_ACTION, RS_FILE_KEY, RS_LIST_ACTION, RS_RANGE_KEY, RS_RANGE_SHORT_KEY, RS_READ_ACTION, RS_REMOVE_ACTION, RS_SAVE_ACTION, RS_SHOW_ACTION, RS_SIZE_ACTION, RS_SUBSET_ACTION, RS_WRITE_ACTION, SEARCH_AFTER_TS_FLAG, SEARCH_BEFORE_TS_FLAG, SEARCH_DATE_FLAG, SEARCH_DEBUG_FLAG, SEARCH_IS_NULL_FLAG, SEARCH_REGEX_FLAG, SEARCH_RESULT_SET_NAME, SEARCH_RETURNED_ATTRIBUTES_FLAG, SEARCH_SHORT_REGEX_FLAG, SEARCH_SIZE_FLAG, SEARCH_VERSIONS_FALSE_VALUE, SEARCH_VERSIONS_FLAG, SEARCH_VERSIONS_ONLY_VALUE, SEARCH_VERSIONS_TRUE_VALUE, SHORT_UPDATE_FLAG, SIZE_ALL_FLAG, SIZE_VERSIONS_FLAG, SKIP_UPDATE_PERMISSIONS_FLAG, sortable, UPDATE_FLAG, UPKEEP_FLAG_CFG, UPKEEP_FLAG_ENABLE, UPKEEP_FLAG_RUN, UPKEEP_FLAG_SHOW, UPKEEP_FLAG_TEST, VERBOSE_COMMAND
-
-
Constructor Summary
Constructors Constructor Description BaseClientStoreCommands(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger, edu.uiuc.ncsa.security.core.Store store)
BaseClientStoreCommands(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger, String defaultIndent, edu.uiuc.ncsa.security.core.Store clientStore, ClientApprovalStoreCommands clientApprovalStoreCommands)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
approve(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
protected void
approve(BaseClient client)
void
approver_search(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
protected String
archiveFormat(edu.uiuc.ncsa.security.core.Identifiable identifiable)
void
create(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
void
create_hash(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
protected abstract BaseClientStoreCommands.ApprovalModsConfig
createApprovalModsConfig(edu.uiuc.ncsa.security.util.cli.InputLine inputLine, BaseClient client, boolean doPrompt)
protected BaseClient
doApprovalMods(BaseClientStoreCommands.ApprovalModsConfig approvalModsConfig)
If there are modifications to the client before saving its approval (e.g.edu.uiuc.ncsa.security.storage.cli.StoreCommands.ChangeIDRecord
doChangeID(edu.uiuc.ncsa.security.core.Identifiable identifiable, edu.uiuc.ncsa.security.core.Identifier newID, boolean updatePermissions)
void
extraUpdates(edu.uiuc.ncsa.security.core.Identifiable identifiable, int magicNumber)
protected String
format(edu.uiuc.ncsa.security.core.Identifiable identifiable)
protected String
format(BaseClient client, ClientApproval ca)
ClientApprovalStore
getClientApprovalStore()
protected void
getPublicKeyFile(BaseClient client, BaseClientKeys keys)
protected void
getSecret(BaseClient client, BaseClientKeys keys)
Prompt the user for a secret, hashing the result.protected edu.uiuc.ncsa.security.util.cli.Sortable
getSortable()
protected net.sf.json.JSON
inputJSON(net.sf.json.JSON oldJSON, String componentName)
protected net.sf.json.JSON
inputJSON(net.sf.json.JSON oldJSON, String componentName, boolean isArray)
Allows for entering a new JSON object.protected boolean
isCARS(String name)
CARS = Client Approval Result Set.protected List<edu.uiuc.ncsa.security.core.Identifiable>
listEntries(List<edu.uiuc.ncsa.security.core.Identifiable> entries, boolean lineList, boolean verboseList)
protected int
longFormat(edu.uiuc.ncsa.security.core.Identifiable identifiable, boolean isVerbose)
protected int
longFormat(BaseClient client, ClientApproval clientApproval, boolean isVerbose)
protected void
old_approve(edu.uiuc.ncsa.security.util.cli.InputLine inputLine, edu.uiuc.ncsa.security.core.Identifiable identifiable)
void
password(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
void
print_help()
void
reset_secret(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
protected void
rmCleanup(edu.uiuc.ncsa.security.storage.cli.FoundIdentifiables x)
protected void
showApproveHelp()
protected void
showCreateHashHelp()
void
status_search(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
-
Methods inherited from class org.oa4mp.server.admin.myproxy.oauth2.base.OA4MPStoreCommands
decode, encode, getEnvironment, getState, main, printIndexHelp, processList, run_qdl, setState
-
Methods inherited from class edu.uiuc.ncsa.security.storage.cli.StoreCommands
actualCreate, addEntry, addEntry, archive, bootstrap, change_id, clear_id, clear_store, clearEntries, copy, create, create, createEntry, deserialize, doCopy, edit, extractRawList, findByIDOrRS, findItem, findItem, findItem, findSingleton, findSingleton, formatLongLine, fromXMLMap, get_id, getAndCheckKeyArg, getArgList, getEditorEntry, getID, getIdentifierfromIndex, getKeyArg, getKeyArg, getKeys, getMapConverter, getPrompt, getResultSets, getSerializationKeys, getStore, getStoreArchiver, getTempDir, hasEntries, hasId, hasID, hasKey, inputJSON, isBadID, isMonitored, list_keys, loadAllEntries, loadQDLScript, longFormat, longFormat, ls, multiLineInput, multiLinePropertyInput, oldls1, oldrm, oldUpdate, preCreation, printRS, rangeHelpSnippet, removeEntries, removeEntry, rm, rs, search, serialize, serialize, set_id, setEnvironment, setID, setIDFromInputLine, setResultSets, setSortable, setStore, showArchiveHelp, showCommandLineSwitchesHelp, showCreateHelp, showDeserializeHelp, showEntry, showEntrySubset, showKeyShorthandHelp, showListKeysHelp, showLSHelp, showLSHelp3, showResultSetHelp, showRMHelp, showSearchHelp, showSearchHelpExamples, showSerializeHelp, showSizeHelp, showUpdateHelp, showUpkeepHelp, size, toXMLMap, update, update, update, updateSingleValue, updateSingleValue, updateStorePermissions, upkeep
-
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
-
clientApprovalStoreCommands
protected ClientApprovalStoreCommands clientApprovalStoreCommands
-
APPROVE_FLAG
public static final String APPROVE_FLAG
- See Also:
- Constant Field Values
-
APPROVER_KEY
public static final String APPROVER_KEY
- See Also:
- Constant Field Values
-
RESET_SECRET_SIZE_FLAG
public static String RESET_SECRET_SIZE_FLAG
-
RESET_SECRET_NEW_FLAG
public static String RESET_SECRET_NEW_FLAG
-
RESET_SECRET_DEFAULT_SIZE
public static int RESET_SECRET_DEFAULT_SIZE
-
-
Constructor Detail
-
BaseClientStoreCommands
public BaseClientStoreCommands(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger, String defaultIndent, edu.uiuc.ncsa.security.core.Store clientStore, ClientApprovalStoreCommands clientApprovalStoreCommands) throws Throwable
- Throws:
Throwable
-
-
Method Detail
-
getClientApprovalStore
public ClientApprovalStore getClientApprovalStore()
-
inputJSON
protected net.sf.json.JSON inputJSON(net.sf.json.JSON oldJSON, String componentName) throws IOException
- Throws:
IOException
-
getSortable
protected edu.uiuc.ncsa.security.util.cli.Sortable getSortable()
- Overrides:
getSortable
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
-
print_help
public void print_help() throws Exception
- Specified by:
print_help
in interfaceedu.uiuc.ncsa.security.util.cli.Commands
- Overrides:
print_help
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
- Throws:
Exception
-
inputJSON
protected net.sf.json.JSON inputJSON(net.sf.json.JSON oldJSON, String componentName, boolean isArray) 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
-
showCreateHashHelp
protected void showCreateHashHelp()
-
create_hash
public void create_hash(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
-
listEntries
protected List<edu.uiuc.ncsa.security.core.Identifiable> listEntries(List<edu.uiuc.ncsa.security.core.Identifiable> entries, boolean lineList, boolean verboseList)
- Overrides:
listEntries
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
-
format
protected String format(BaseClient client, ClientApproval ca)
-
archiveFormat
protected String archiveFormat(edu.uiuc.ncsa.security.core.Identifiable identifiable)
- Overrides:
archiveFormat
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
-
format
protected String format(edu.uiuc.ncsa.security.core.Identifiable identifiable)
- Specified by:
format
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
-
longFormat
protected int longFormat(edu.uiuc.ncsa.security.core.Identifiable identifiable, boolean isVerbose)
- Overrides:
longFormat
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
-
longFormat
protected int longFormat(BaseClient client, ClientApproval clientApproval, boolean isVerbose)
-
showApproveHelp
protected void showApproveHelp()
-
approve
public void approve(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws Throwable
- Throws:
Throwable
-
createApprovalModsConfig
protected abstract BaseClientStoreCommands.ApprovalModsConfig createApprovalModsConfig(edu.uiuc.ncsa.security.util.cli.InputLine inputLine, BaseClient client, boolean doPrompt)
-
old_approve
protected void old_approve(edu.uiuc.ncsa.security.util.cli.InputLine inputLine, edu.uiuc.ncsa.security.core.Identifiable identifiable) throws Throwable
- Throws:
Throwable
-
approve
protected void approve(BaseClient client) throws IOException
- Throws:
IOException
-
doApprovalMods
protected BaseClient doApprovalMods(BaseClientStoreCommands.ApprovalModsConfig approvalModsConfig) throws IOException
If there are modifications to the client before saving its approval (e.g. admin clients should be prompted for QDL policy) put it here.- Parameters:
approvalModsConfig
-- Returns:
- Throws:
IOException
-
rmCleanup
protected void rmCleanup(edu.uiuc.ncsa.security.storage.cli.FoundIdentifiables x)
- Overrides:
rmCleanup
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
-
approver_search
public void approver_search(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
-
status_search
public void status_search(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
-
isCARS
protected boolean isCARS(String name)
CARS = Client Approval Result Set. Return true if the given name is stored as a result set for client approvals.- Parameters:
name
-- Returns:
-
password
public void password(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws Exception
- Throws:
Exception
-
reset_secret
public void reset_secret(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws Throwable
- Throws:
Throwable
-
create
public void create(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws IOException
- Overrides:
create
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
- Throws:
IOException
-
extraUpdates
public void extraUpdates(edu.uiuc.ncsa.security.core.Identifiable identifiable, int magicNumber) throws IOException
- Overrides:
extraUpdates
in classOA4MPStoreCommands
- Throws:
IOException
-
getSecret
protected void getSecret(BaseClient client, BaseClientKeys keys) throws IOException
Prompt the user for a secret, hashing the result.- Throws:
IOException
-
getPublicKeyFile
protected void getPublicKeyFile(BaseClient client, BaseClientKeys keys) throws IOException
- Throws:
IOException
-
doChangeID
public edu.uiuc.ncsa.security.storage.cli.StoreCommands.ChangeIDRecord doChangeID(edu.uiuc.ncsa.security.core.Identifiable identifiable, edu.uiuc.ncsa.security.core.Identifier newID, boolean updatePermissions)
- Overrides:
doChangeID
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
-
-