Package org.oa4mp.server.qdl.storage
Class QDLStoreAccessor
- java.lang.Object
-
- org.oa4mp.server.qdl.storage.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 ofOA4MPStoreCommands. 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.QDLStemarchive(org.qdl_lang.variables.QDLStem arg)Archive the elements (all ids) in the stem list.org.qdl_lang.variables.QDLStemcreate(String id)protected edu.uiuc.ncsa.security.core.IdentifiablefromStem(org.qdl_lang.variables.QDLStem stem)org.qdl_lang.variables.QDLStemfromXML(String x)Does the same asStoreCommands2.deserialize(InputLine)Take a string and turn it into an object (in this case, a stem)protected edu.uiuc.ncsa.security.core.IdentifiablefromXMLMap(edu.uiuc.ncsa.security.storage.XMLMap map)In a few cases we need an actualIdentifiableobject.org.qdl_lang.variables.QDLStemget(edu.uiuc.ncsa.security.core.Identifier id)StringgetAccessorType()protected StemConvertergetConverter()edu.uiuc.ncsa.security.core.StoregetStore()StoreArchivergetStoreArchiver()org.qdl_lang.variables.QDLStemgetVersion(edu.uiuc.ncsa.security.core.Identifier id, Long version)Remove pairs of version ids.voidinfo(String x)protected booleanisVersionID(edu.uiuc.ncsa.security.core.Identifier id)org.qdl_lang.variables.QDLStemlistKeys()booleanremove(edu.uiuc.ncsa.security.core.Identifier id)EitherList<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.QDLStemsearch(String key, String condition, Boolean isregex)Does a standard search, returning a list of found elements.voidsetAccessorType(String accessorType)voidsetMapConverter(StemConverter mapConverter)voidsetStore(edu.uiuc.ncsa.security.core.Store store)booleanshutdown()shutsdown the store.Longsize(Boolean includeVersions)The size of the storeprotected org.qdl_lang.variables.QDLStemtoStem(edu.uiuc.ncsa.security.core.Identifiable identifiable)StringtoXML(org.qdl_lang.variables.QDLStem stem)Does the same as theStoreCommands2.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.voidwarn(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)
-
getStoreArchiver
public StoreArchiver getStoreArchiver()
-
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 theStoreCommands2.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 asStoreCommands2.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)
-
getConverter
protected StemConverter getConverter()
-
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 actualIdentifiableobject.- 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 IOExceptionRemove pairs of version ids. A version ID is a list of the form['uri', integer]- Throws:
IOException
-
-