Class BaseClientStoreCommands
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.cli.AbstractCommandsImpl
-
- edu.uiuc.ncsa.security.util.cli.CommonCommands2
-
- edu.uiuc.ncsa.security.storage.cli.StoreCommands2
-
- org.oa4mp.server.admin.oauth2.base.OA4MPStoreCommands
-
- org.oa4mp.server.admin.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 classBaseClientStoreCommands.ApprovalModsConfig
-
Field Summary
Fields Modifier and Type Field Description static StringAPPROVE_FLAGstatic StringAPPROVER_KEYprotected ClientApprovalStoreCommandsclientApprovalStoreCommandsstatic intRESET_SECRET_DEFAULT_SIZEstatic StringRESET_SECRET_NEW_FLAGstatic StringRESET_SECRET_SIZE_FLAG-
Fields inherited from class edu.uiuc.ncsa.security.storage.cli.StoreCommands2
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.util.cli.CLIDriver driver, edu.uiuc.ncsa.security.core.Store store)BaseClientStoreCommands(edu.uiuc.ncsa.security.util.cli.CLIDriver driver, 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 voidapprove(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)protected voidapprove(org.oa4mp.delegation.common.storage.clients.BaseClient client)voidapprover_search(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)protected StringarchiveFormat(edu.uiuc.ncsa.security.core.Identifiable identifiable)voidcreate(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)voidcreate_hash(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)protected abstract BaseClientStoreCommands.ApprovalModsConfigcreateApprovalModsConfig(edu.uiuc.ncsa.security.util.cli.InputLine inputLine, org.oa4mp.delegation.common.storage.clients.BaseClient client, boolean doPrompt)protected org.oa4mp.delegation.common.storage.clients.BaseClientdoApprovalMods(BaseClientStoreCommands.ApprovalModsConfig approvalModsConfig)If there are modifications to the client before saving its approval (e.g.edu.uiuc.ncsa.security.storage.cli.StoreCommands2.ChangeIDRecorddoChangeID(edu.uiuc.ncsa.security.core.Identifiable identifiable, edu.uiuc.ncsa.security.core.Identifier newID, boolean updatePermissions)voidextraUpdates(edu.uiuc.ncsa.security.core.Identifiable identifiable, int magicNumber)protected Stringformat(edu.uiuc.ncsa.security.core.Identifiable identifiable)protected Stringformat(org.oa4mp.delegation.common.storage.clients.BaseClient client, org.oa4mp.delegation.server.storage.ClientApproval ca)org.oa4mp.delegation.server.storage.ClientApprovalStoregetClientApprovalStore()protected voidgetPublicKeyFile(org.oa4mp.delegation.common.storage.clients.BaseClient client, org.oa4mp.delegation.common.storage.clients.BaseClientKeys keys)protected voidgetSecret(org.oa4mp.delegation.common.storage.clients.BaseClient client, org.oa4mp.delegation.common.storage.clients.BaseClientKeys keys)Prompt the user for a secret, hashing the result.protected edu.uiuc.ncsa.security.util.cli.SortablegetSortable()protected net.sf.json.JSONinputJSON(net.sf.json.JSON oldJSON, String componentName)protected net.sf.json.JSONinputJSON(net.sf.json.JSON oldJSON, String componentName, boolean isArray)Allows for entering a new JSON object.protected booleanisCARS(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 intlongFormat(edu.uiuc.ncsa.security.core.Identifiable identifiable, boolean isVerbose)protected intlongFormat(org.oa4mp.delegation.common.storage.clients.BaseClient client, org.oa4mp.delegation.server.storage.ClientApproval clientApproval, boolean isVerbose)protected voidold_approve(edu.uiuc.ncsa.security.util.cli.InputLine inputLine, edu.uiuc.ncsa.security.core.Identifiable identifiable)voidpassword(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)voidprint_help()voidreset_secret(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)protected voidrmCleanup(edu.uiuc.ncsa.security.storage.cli.FoundIdentifiables x)protected voidshowApproveHelp()protected voidshowCreateHashHelp()voidstatus_search(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)-
Methods inherited from class org.oa4mp.server.admin.oauth2.base.OA4MPStoreCommands
about, decode, encode, getEnvironment, getState, initialize, load, printIndexHelp, processList, run_qdl, setState
-
Methods inherited from class edu.uiuc.ncsa.security.storage.cli.StoreCommands2
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, initHelp, 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.CommonCommands2
getIOInterface, getPlaceHolder, getValue, isEmpty, isThrowExceptions, isVerbose, say2, sayii, set_output_on, set_verbose_on, setOutputOnHelp, setPlaceHolder, setThrowExceptions, setVerboseHelp, version, versionHelp
-
Methods inherited from class edu.uiuc.ncsa.security.util.cli.AbstractCommandsImpl
bootstrap, clear_env, clearEnvHelp, debug, error, error, get_env, getDriver, getHelpUtil, getInput, getLogoName, getPropertyHelp, gracefulExit, hasLogger, indentWidth, info, isDebugOn, isOk, isShowHeader, isShowLogo, print_env, printEnvHelp, printGetEnvHelp, printReadEnvHelp, printSaveEnvHelp, printSetEnvHelp, read_env, readJSON, readline, readline, save_env, say, say, sayi, sayv, set_env, setDebugOn, setDriver, setLogoName, setShowHeader, setShowLogo, showHelp, 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.util.cli.CLIDriver driver, String defaultIndent, edu.uiuc.ncsa.security.core.Store clientStore, ClientApprovalStoreCommands clientApprovalStoreCommands) throws Throwable- Throws:
Throwable
-
-
Method Detail
-
getClientApprovalStore
public org.oa4mp.delegation.server.storage.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:
getSortablein classedu.uiuc.ncsa.security.storage.cli.StoreCommands2
-
print_help
public void print_help() throws Exception- Overrides:
print_helpin classedu.uiuc.ncsa.security.storage.cli.StoreCommands2- Throws:
Exception
-
inputJSON
protected net.sf.json.JSON inputJSON(net.sf.json.JSON oldJSON, String componentName, boolean isArray) throws IOExceptionAllows 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:
listEntriesin classedu.uiuc.ncsa.security.storage.cli.StoreCommands2
-
format
protected String format(org.oa4mp.delegation.common.storage.clients.BaseClient client, org.oa4mp.delegation.server.storage.ClientApproval ca)
-
archiveFormat
protected String archiveFormat(edu.uiuc.ncsa.security.core.Identifiable identifiable)
- Overrides:
archiveFormatin classedu.uiuc.ncsa.security.storage.cli.StoreCommands2
-
format
protected String format(edu.uiuc.ncsa.security.core.Identifiable identifiable)
- Specified by:
formatin classedu.uiuc.ncsa.security.storage.cli.StoreCommands2
-
longFormat
protected int longFormat(edu.uiuc.ncsa.security.core.Identifiable identifiable, boolean isVerbose)- Overrides:
longFormatin classedu.uiuc.ncsa.security.storage.cli.StoreCommands2
-
longFormat
protected int longFormat(org.oa4mp.delegation.common.storage.clients.BaseClient client, org.oa4mp.delegation.server.storage.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, org.oa4mp.delegation.common.storage.clients.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(org.oa4mp.delegation.common.storage.clients.BaseClient client) throws IOException- Throws:
IOException
-
doApprovalMods
protected org.oa4mp.delegation.common.storage.clients.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:
rmCleanupin classedu.uiuc.ncsa.security.storage.cli.StoreCommands2
-
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:
createin classedu.uiuc.ncsa.security.storage.cli.StoreCommands2- Throws:
IOException
-
extraUpdates
public void extraUpdates(edu.uiuc.ncsa.security.core.Identifiable identifiable, int magicNumber) throws IOException- Overrides:
extraUpdatesin classOA4MPStoreCommands- Throws:
IOException
-
getSecret
protected void getSecret(org.oa4mp.delegation.common.storage.clients.BaseClient client, org.oa4mp.delegation.common.storage.clients.BaseClientKeys keys) throws IOExceptionPrompt the user for a secret, hashing the result.- Throws:
IOException
-
getPublicKeyFile
protected void getPublicKeyFile(org.oa4mp.delegation.common.storage.clients.BaseClient client, org.oa4mp.delegation.common.storage.clients.BaseClientKeys keys) throws IOException- Throws:
IOException
-
doChangeID
public edu.uiuc.ncsa.security.storage.cli.StoreCommands2.ChangeIDRecord doChangeID(edu.uiuc.ncsa.security.core.Identifiable identifiable, edu.uiuc.ncsa.security.core.Identifier newID, boolean updatePermissions)- Overrides:
doChangeIDin classedu.uiuc.ncsa.security.storage.cli.StoreCommands2
-
-