Class 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 StoreCommands2
    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/interfaces inherited from class edu.uiuc.ncsa.security.storage.cli.StoreCommands

        edu.uiuc.ncsa.security.storage.cli.StoreCommands.RSRecord
    • Field Summary

      Fields 
      Modifier and Type Field Description
      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, NEXT_N_COMMAND, RANDOM_ID_FLAG, resultSets, RM_FORCE_FLAG, RS_CLEAR_KEY, RS_LIST_INFO_KEY, RS_REMOVE_KEY, RS_SHOW_KEY, SEARCH_AFTER_TS_FLAG, SEARCH_BEFORE_TS_FLAG, SEARCH_DATE_FLAG, SEARCH_DEBUG_FLAG, SEARCH_REGEX_FLAG, SEARCH_RESULT_SET_NAME, SEARCH_RETURNED_ATTRIBUTES_FLAG, SEARCH_SHORT_REGEX_FLAG, SEARCH_SIZE_FLAG, SHORT_UPDATE_FLAG, SIZE_ALL_FLAG, SIZE_VERSIONS_FLAG, sortable, UPDATE_FLAG, UPKEEP_FLAG_CFG, UPKEEP_FLAG_ENABLE, UPKEEP_FLAG_RUN, UPKEEP_FLAG_SHOW, UPKEEP_FLAG_TEST, VERBOSE_COMMAND
      • 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 
      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 Concrete Methods 
      Modifier and Type Method Description
      protected BaseClient approvalMods​(edu.uiuc.ncsa.security.util.cli.InputLine inputLine, BaseClient client)
      If there are modifications to the client before saving its approval (e.g.
      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)  
      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> listAll​(boolean useLongFormat, String otherFlags)  
      protected int longFormat​(edu.uiuc.ncsa.security.core.Identifiable identifiable, boolean isVerbose)  
      protected int longFormat​(BaseClient client, ClientApproval clientApproval, boolean isVerbose)  
      void password​(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)  
      void print_help()  
      void reset_secret​(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)  
      void rm​(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)  
      protected void rmCleanup​(edu.uiuc.ncsa.security.core.Identifiable x)  
      void rs​(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)  
      protected void showApproveHelp()  
      protected void showCreateHashHelp()  
      void status_search​(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)  
      • Methods inherited from class edu.uiuc.ncsa.security.storage.cli.StoreCommands

        actualCreate, addEntry, addEntry, archive, bootstrap, clear_id, clear_store, clearEntries, copy, create, create, createEntry, createNew, deserialize, doCopy, doRename, edit, escapeRegex, findItem, formatLongLine, fromXMLMap, get_id, getAndCheckKeyArg, getArgList, getEditorEntry, getID, getKeyArg, getKeyArg, getMapConverter, getPrompt, getResultSets, getSerializationKeys, getStore, getStoreArchiver, getTempDir, hasEntries, hasId, hasID, hasKey, inputJSON, isMonitored, list_keys, loadAllEntries, loadQDLScript, longFormat, longFormat, ls, multiLineInput, multiLinePropertyInput, oldls, oldrm, oldUpdate, preCreation, printRS, removeEntries, removeEntry, rename, search, serialize, serialize, set_id, setEnvironment, setID, setIDFromInputLine, setResultSets, setSortable, setStore, showArchiveHelp, showCommandLineSwitchesHelp, showCreateHelp, showDeserializeHelp, showEntries, showEntry, showKeyShorthandHelp, showListKeysHelp, showLSHelp, showLSHelp3, showResultSetHelp, showRMHelp, showSearchHelp, showSearchHelpExamples, showSerializeHelp, showSizeHelp, showUpdateHelp, showUpkeepHelp, size, supportsQDL, toXMLMap, update, update, update, updateSingleValue, updateSingleValue, 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
      • Methods inherited from interface edu.uiuc.ncsa.security.util.cli.Commands

        getName
    • Field Detail

      • 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
      • BaseClientStoreCommands

        public BaseClientStoreCommands​(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger,
                                       edu.uiuc.ncsa.security.core.Store store)
                                throws Throwable
        Throws:
        Throwable
    • Method Detail

      • 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 class edu.uiuc.ncsa.security.storage.cli.StoreCommands
      • print_help

        public void print_help()
                        throws Exception
        Specified by:
        print_help in interface edu.uiuc.ncsa.security.util.cli.Commands
        Overrides:
        print_help in class edu.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)
      • listAll

        protected List<edu.uiuc.ncsa.security.core.Identifiable> listAll​(boolean useLongFormat,
                                                                         String otherFlags)
        Overrides:
        listAll in class edu.uiuc.ncsa.security.storage.cli.StoreCommands
      • archiveFormat

        protected String archiveFormat​(edu.uiuc.ncsa.security.core.Identifiable identifiable)
        Overrides:
        archiveFormat in class edu.uiuc.ncsa.security.storage.cli.StoreCommands
      • format

        protected String format​(edu.uiuc.ncsa.security.core.Identifiable identifiable)
        Specified by:
        format in class edu.uiuc.ncsa.security.storage.cli.StoreCommands
      • longFormat

        protected int longFormat​(edu.uiuc.ncsa.security.core.Identifiable identifiable,
                                 boolean isVerbose)
        Overrides:
        longFormat in class edu.uiuc.ncsa.security.storage.cli.StoreCommands
      • showApproveHelp

        protected void showApproveHelp()
      • approve

        public void approve​(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
                     throws IOException
        Throws:
        IOException
      • approvalMods

        protected BaseClient approvalMods​(edu.uiuc.ncsa.security.util.cli.InputLine inputLine,
                                          BaseClient client)
                                   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:
        inputLine -
        client -
        Returns:
        Throws:
        IOException
      • rmCleanup

        protected void rmCleanup​(edu.uiuc.ncsa.security.core.Identifiable x)
        Overrides:
        rmCleanup in class edu.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:
      • rs

        public void rs​(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
                throws Exception
        Overrides:
        rs in class edu.uiuc.ncsa.security.storage.cli.StoreCommands
        Throws:
        Exception
      • rm

        public void rm​(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
                throws IOException
        Overrides:
        rm in class edu.uiuc.ncsa.security.storage.cli.StoreCommands
        Throws:
        IOException
      • 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 Exception
        Throws:
        Exception
      • create

        public void create​(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
                    throws IOException
        Overrides:
        create in class edu.uiuc.ncsa.security.storage.cli.StoreCommands
        Throws:
        IOException