Class ClientApprovalStoreCommands
- 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.ClientApprovalStoreCommands
-
- All Implemented Interfaces:
edu.uiuc.ncsa.security.core.Logable,edu.uiuc.ncsa.security.util.cli.Commands,Serializable
public class ClientApprovalStoreCommands extends OA4MPStoreCommands
Created by Jeff Gaynor
on 5/22/13 at 1:51 PM- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringSHOW_UNAPPROVED_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, SHOW_HEADER, SHOW_VERSIONS_LIST_COMMAND, SIZE_ALL_FLAG, SIZE_VERSIONS_FLAG, SKIP_UPDATE_PERMISSIONS_FLAG, sortable, STILE, UPDATE_FLAG, UPKEEP_FLAG_CFG, UPKEEP_FLAG_ENABLE, UPKEEP_FLAG_RUN, UPKEEP_FLAG_SHOW, UPKEEP_FLAG_TEST, VERBOSE_COMMAND
-
-
Constructor Summary
Constructors Constructor Description ClientApprovalStoreCommands(edu.uiuc.ncsa.security.util.cli.CLIDriver driver, edu.uiuc.ncsa.security.core.Store store)ClientApprovalStoreCommands(edu.uiuc.ncsa.security.util.cli.CLIDriver driver, String defaultIndent, edu.uiuc.ncsa.security.core.Store store)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapprove(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)booleanapprove(ClientApproval ca)protected booleanapprove(ClientApproval ca, boolean isapproved, String approver)voidchange_id(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)protected StringcolumnHeader(int offset, int[] fieldWidths)int[]fieldWidths(List<edu.uiuc.ncsa.security.core.Identifiable> identifiables)protected Stringformat(edu.uiuc.ncsa.security.core.Identifiable identifiable)protected Stringformat(edu.uiuc.ncsa.security.core.Identifiable identifiable, int offset, int[] fieldWidths)static StringgetApprover()StringgetName()static booleanhasApprover()voidinitHelp()voidset_status(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)static voidsetApprover(String approver)static voidsetupApprovalRecord(ClientApproval ca, boolean isapproved, String approver)Does the work of setting the approval status, approver etc.static ClientApprovalsetupApprovalRecord(ClientApprovalStore caStore, edu.uiuc.ncsa.security.core.Identifier identifier, boolean isapproved, String approver)For thoses cases where the record needs to me fetched or created then set to the right values.protected voidshow(boolean showApproved, String regex)voidshow(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)voidshowApproveHelp()static StringstatusToShortString(ClientApproval ca)booleanupdate(edu.uiuc.ncsa.security.core.Identifiable identifiable)protected intupdateStorePermissions(edu.uiuc.ncsa.security.core.Identifier newID, edu.uiuc.ncsa.security.core.Identifier oldID, boolean copy)-
Methods inherited from class org.oa4mp.server.admin.oauth2.base.OA4MPStoreCommands
about, decode, encode, extraUpdates, getEnvironment, getState, initialize, load, printIndexHelp, processList, run_qdl, setState
-
Methods inherited from class edu.uiuc.ncsa.security.storage.cli.StoreCommands2
actualCreate, addEntry, addEntry, archive, archiveFormat, bootstrap, clear_id, clear_store, clearEntries, copy, create, create, create, createEntry, deserialize, doChangeID, doCopy, edit, extractRawList, findByIDOrRS, findItem, findItem, findItem, findSingleton, findSingleton, formatCounter, formatLongLine, fromXMLMap, get_id, getAndCheckKeyArg, getArgList, getEditorEntry, getID, getIdentifierfromIndex, getKeyArg, getKeyArg, getKeys, getMapConverter, getMethodName, getPrompt, getResultSets, getSerializationKeys, getSortable, getStore, getStoreArchiver, getTempDir, hasEntries, hasId, hasID, hasKey, inputJSON, isBadID, isMonitored, list_keys, listEntries, loadAllEntries, loadQDLScript, longFormat, longFormat, longFormat, ls, multiLineInput, multiLinePropertyInput, oldrm, oldUpdate, preCopy, preCreation, print_help, printLS, printRS, rangeHelpSnippet, removeEntries, removeEntry, rm, rmCleanup, rs, search, serialize, serialize, set_id, setEnvironment, setID, setIDFromInputLine, setResultSets, setSortable, setStore, showArchiveHelp, showCommandLineSwitchesHelp, showCopyHelp, showCreateHelp, showDeserializeHelp, showEntry, showEntrySubset, showKeyShorthandHelp, showListKeysHelp, showLSHelp, showResultSetHelp, showRMHelp, showSearchHelp, showSearchHelpExamples, showSerializeHelp, showSizeHelp, showUpdateHelp, showUpkeepHelp, size, time, toXMLMap, update, update, updateSingleValue, updateSingleValue, 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, configureCommands, 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
-
SHOW_UNAPPROVED_FLAG
public static final String SHOW_UNAPPROVED_FLAG
- See Also:
- Constant Field Values
-
-
Method Detail
-
format
protected String format(edu.uiuc.ncsa.security.core.Identifiable identifiable)
- Specified by:
formatin classedu.uiuc.ncsa.security.storage.cli.StoreCommands2
-
statusToShortString
public static String statusToShortString(ClientApproval ca)
-
format
protected String format(edu.uiuc.ncsa.security.core.Identifiable identifiable, int offset, int[] fieldWidths)
- Overrides:
formatin classOA4MPStoreCommands
-
fieldWidths
public int[] fieldWidths(List<edu.uiuc.ncsa.security.core.Identifiable> identifiables)
- Specified by:
fieldWidthsin classedu.uiuc.ncsa.security.storage.cli.StoreCommands2
-
columnHeader
protected String columnHeader(int offset, int[] fieldWidths)
- Overrides:
columnHeaderin classOA4MPStoreCommands
-
getName
public String getName()
-
update
public boolean update(edu.uiuc.ncsa.security.core.Identifiable identifiable) throws IOException- Overrides:
updatein classedu.uiuc.ncsa.security.storage.cli.StoreCommands2- Throws:
IOException
-
showApproveHelp
public void showApproveHelp()
-
hasApprover
public static boolean hasApprover()
-
getApprover
public static String getApprover()
-
setApprover
public static void setApprover(String approver)
-
approve
public void approve(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws Throwable- Throws:
Throwable
-
set_status
public void set_status(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws Throwable- Throws:
Throwable
-
approve
public boolean approve(ClientApproval ca) throws IOException
- Parameters:
ca-- Returns:
- true if saved.
- Throws:
IOException
-
setupApprovalRecord
public static ClientApproval setupApprovalRecord(ClientApprovalStore caStore, edu.uiuc.ncsa.security.core.Identifier identifier, boolean isapproved, String approver) throws IOException
For thoses cases where the record needs to me fetched or created then set to the right values. This andsetupApprovalRecord(ClientApproval, boolean, String)are called in this class and are exposed as static methods to be called by other classes to central approvals. This does do the save of this record since it has the logic to invokeStore.update(Identifiable)versusStore.save(Identifiable)- Parameters:
identifier-isapproved-approver-- Throws:
IOException
-
approve
protected boolean approve(ClientApproval ca, boolean isapproved, String approver) throws IOException
- Throws:
IOException
-
setupApprovalRecord
public static void setupApprovalRecord(ClientApproval ca, boolean isapproved, String approver)
Does the work of setting the approval status, approver etc. Does not save it.- Parameters:
ca-isapproved-approver-
-
show
public void show(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws Exception- Throws:
Exception
-
initHelp
public void initHelp() throws Throwable- Overrides:
initHelpin classedu.uiuc.ncsa.security.storage.cli.StoreCommands2- Throws:
Throwable
-
change_id
public void change_id(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws Throwable- Overrides:
change_idin classedu.uiuc.ncsa.security.storage.cli.StoreCommands2- Throws:
Throwable
-
updateStorePermissions
protected int updateStorePermissions(edu.uiuc.ncsa.security.core.Identifier newID, edu.uiuc.ncsa.security.core.Identifier oldID, boolean copy)- Specified by:
updateStorePermissionsin classedu.uiuc.ncsa.security.storage.cli.StoreCommands2
-
-