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. programatically. It is designed to be similar to the CLI for OA4MP, hence more or less a take off of StoreCommands2. 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
      edu.uiuc.ncsa.qdl.variables.QDLStem archive​(edu.uiuc.ncsa.qdl.variables.QDLStem arg)
      Archive the elements (all ids) in the stem list.
      edu.uiuc.ncsa.qdl.variables.QDLStem create​(String id)  
      protected edu.uiuc.ncsa.security.core.Identifiable fromStem​(edu.uiuc.ncsa.qdl.variables.QDLStem stem)  
      edu.uiuc.ncsa.qdl.variables.QDLStem fromXML​(String x)
      Does the same as StoreCommands.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.
      edu.uiuc.ncsa.qdl.variables.QDLStem get​(edu.uiuc.ncsa.security.core.Identifier id)  
      String getAccessorType()  
      protected StemConverter getConverter()  
      edu.uiuc.ncsa.security.core.Store getStore()  
      StoreArchiver getStoreArchiver()  
      edu.uiuc.ncsa.qdl.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)  
      edu.uiuc.ncsa.qdl.variables.QDLStem listKeys()  
      boolean remove​(edu.uiuc.ncsa.security.core.Identifier id)
      Either
      List<Boolean> saveOrUpdate​(edu.uiuc.ncsa.qdl.variables.QDLStem QDLStem, boolean doSave)
      Save OR update the store from a stem or list of them.
      edu.uiuc.ncsa.qdl.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)  
      Long size​(Boolean includeVersions)
      The size of the store
      protected edu.uiuc.ncsa.qdl.variables.QDLStem toStem​(edu.uiuc.ncsa.security.core.Identifiable identifiable)  
      String toXML​(edu.uiuc.ncsa.qdl.variables.QDLStem stem)
      Does the same as the StoreCommands.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 edu.uiuc.ncsa.qdl.variables.QDLStem get​(edu.uiuc.ncsa.security.core.Identifier id)
      • saveOrUpdate

        public List<Boolean> saveOrUpdate​(edu.uiuc.ncsa.qdl.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​(edu.uiuc.ncsa.qdl.variables.QDLStem stem)
        Does the same as the StoreCommands.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 edu.uiuc.ncsa.qdl.variables.QDLStem fromXML​(String x)
        Does the same as StoreCommands.deserialize(InputLine) Take a string and turn it into an object (in this case, a stem)
        Parameters:
        x -
        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 edu.uiuc.ncsa.qdl.variables.QDLStem toStem​(edu.uiuc.ncsa.security.core.Identifiable identifiable)
      • fromStem

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

        public edu.uiuc.ncsa.qdl.variables.QDLStem create​(String id)
      • search

        public edu.uiuc.ncsa.qdl.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 edu.uiuc.ncsa.qdl.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 edu.uiuc.ncsa.qdl.variables.QDLStem archive​(edu.uiuc.ncsa.qdl.variables.QDLStem arg)
        Archive the elements (all ids) in the stem list. Returns stem of version numberss created.
        Parameters:
        arg -
      • getVersion

        public edu.uiuc.ncsa.qdl.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