Class QDLStoreAccessor

  • Direct Known Subclasses:
    QDLPermissionStoreAccessor

    public class QDLStoreAccessor
    extends Object
    This gives QDL the ability to look into stores such as clients, approvals, etc. programmatically. It is designed to be similar to the CLI for OA4MP, hence more or less a take off of OA4MPStoreCommands. This class is used by others for accessing a store, so it assumes that the inputs have been checked (e.g. that a method is called with the right value). As such the error handling here is pretty barebones.

    Created by Jeff Gaynor
    on 12/17/20 at 4:28 PM

    • Constructor Summary

      Constructors 
      Constructor Description
      QDLStoreAccessor​(String accessorType, edu.uiuc.ncsa.security.core.Store store, edu.uiuc.ncsa.security.core.util.MyLoggingFacade myLogger)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.qdl_lang.variables.QDLStem archive​(org.qdl_lang.variables.QDLStem arg)
      Archive the elements (all ids) in the stem list.
      org.qdl_lang.variables.QDLStem create​(String id)  
      protected edu.uiuc.ncsa.security.core.Identifiable fromStem​(org.qdl_lang.variables.QDLStem stem)  
      org.qdl_lang.variables.QDLStem fromXML​(String x)
      Does the same as StoreCommands2.deserialize(InputLine) Take a string and turn it into an object (in this case, a stem)
      protected edu.uiuc.ncsa.security.core.Identifiable fromXMLMap​(edu.uiuc.ncsa.security.storage.XMLMap map)
      In a few cases we need an actual Identifiable object.
      org.qdl_lang.variables.QDLStem get​(edu.uiuc.ncsa.security.core.Identifier id)  
      String getAccessorType()  
      protected StemConverter getConverter()  
      edu.uiuc.ncsa.security.core.Store getStore()  
      StoreArchiver getStoreArchiver()  
      org.qdl_lang.variables.QDLStem getVersion​(edu.uiuc.ncsa.security.core.Identifier id, Long version)
      Remove pairs of version ids.
      void info​(String x)  
      protected boolean isVersionID​(edu.uiuc.ncsa.security.core.Identifier id)  
      org.qdl_lang.variables.QDLStem listKeys()  
      boolean remove​(edu.uiuc.ncsa.security.core.Identifier id)
      Either
      List<Boolean> saveOrUpdate​(org.qdl_lang.variables.QDLStem QDLStem, boolean doSave)
      Save OR update the store from a stem or list of them.
      org.qdl_lang.variables.QDLStem search​(String key, String condition, Boolean isregex)
      Does a standard search, returning a list of found elements.
      void setAccessorType​(String accessorType)  
      void setMapConverter​(StemConverter mapConverter)  
      void setStore​(edu.uiuc.ncsa.security.core.Store store)  
      boolean shutdown()
      shutsdown the store.
      Long size​(Boolean includeVersions)
      The size of the store
      protected org.qdl_lang.variables.QDLStem toStem​(edu.uiuc.ncsa.security.core.Identifiable identifiable)  
      String toXML​(org.qdl_lang.variables.QDLStem stem)
      Does the same as the StoreCommands2.serialize(InputLine) Take a stem and convert it to an object then to XML format.

      Note this is not used for serialization of the store, just to exchange entries in the store.
      void warn​(String x)  
    • Constructor Detail

      • QDLStoreAccessor

        public QDLStoreAccessor​(String accessorType,
                                edu.uiuc.ncsa.security.core.Store store,
                                edu.uiuc.ncsa.security.core.util.MyLoggingFacade myLogger)
    • Method Detail

      • getAccessorType

        public String getAccessorType()
      • setAccessorType

        public void setAccessorType​(String accessorType)
      • getStore

        public edu.uiuc.ncsa.security.core.Store getStore()
      • setStore

        public void setStore​(edu.uiuc.ncsa.security.core.Store store)
      • get

        public org.qdl_lang.variables.QDLStem get​(edu.uiuc.ncsa.security.core.Identifier id)
      • saveOrUpdate

        public List<Boolean> saveOrUpdate​(org.qdl_lang.variables.QDLStem QDLStem,
                                          boolean doSave)
        Save OR update the store from a stem or list of them.
        Parameters:
        QDLStem -
        doSave -
        Returns:
      • toXML

        public String toXML​(org.qdl_lang.variables.QDLStem stem)
        Does the same as the StoreCommands2.serialize(InputLine) Take a stem and convert it to an object then to XML format.

        Note this is not used for serialization of the store, just to exchange entries in the store.
        Parameters:
        stem -
        Returns:
      • fromXML

        public org.qdl_lang.variables.QDLStem fromXML​(String x)
        Does the same as StoreCommands2.deserialize(InputLine) Take a string and turn it into an object (in this case, a stem)
        Parameters:
        x -
        Returns:
      • shutdown

        public boolean shutdown()
        shutsdown the store. This really only affect Derby stores which can be unusable if they are not shutdown correctly.
        Returns:
      • remove

        public boolean remove​(edu.uiuc.ncsa.security.core.Identifier id)
        Either
        Parameters:
        id -
        Returns:
      • setMapConverter

        public void setMapConverter​(StemConverter mapConverter)
      • size

        public Long size​(Boolean includeVersions)
        The size of the store
        Parameters:
        includeVersions - include versions of items
        Returns:
      • toStem

        protected org.qdl_lang.variables.QDLStem toStem​(edu.uiuc.ncsa.security.core.Identifiable identifiable)
      • fromStem

        protected edu.uiuc.ncsa.security.core.Identifiable fromStem​(org.qdl_lang.variables.QDLStem stem)
      • create

        public org.qdl_lang.variables.QDLStem create​(String id)
      • search

        public org.qdl_lang.variables.QDLStem search​(String key,
                                                     String condition,
                                                     Boolean isregex)
        Does a standard search, returning a list of found elements. Note that this may be very long if the query is too general.
        Parameters:
        key -
        condition -
        isregex -
        Returns:
      • isVersionID

        protected boolean isVersionID​(edu.uiuc.ncsa.security.core.Identifier id)
      • listKeys

        public org.qdl_lang.variables.QDLStem listKeys()
      • fromXMLMap

        protected edu.uiuc.ncsa.security.core.Identifiable fromXMLMap​(edu.uiuc.ncsa.security.storage.XMLMap map)
        In a few cases we need an actual Identifiable object.
        Parameters:
        map -
        Returns:
      • warn

        public void warn​(String x)
      • info

        public void info​(String x)
      • archive

        public org.qdl_lang.variables.QDLStem archive​(org.qdl_lang.variables.QDLStem arg)
        Archive the elements (all ids) in the stem list. Returns stem of version numberss created.
        Parameters:
        arg -
      • getVersion

        public org.qdl_lang.variables.QDLStem getVersion​(edu.uiuc.ncsa.security.core.Identifier id,
                                                         Long version)
                                                  throws IOException
        Remove pairs of version ids. A version ID is a list of the form
             ['uri', integer]
         
        Throws:
        IOException