Package edu.uiuc.ncsa.security.util.json
Class TestMemStore<V extends JSONEntry>
- java.lang.Object
- 
- java.util.AbstractMap<K,V>
- 
- java.util.HashMap<Identifier,V>
- 
- edu.uiuc.ncsa.security.util.json.TestMemStore<V>
 
 
 
- 
- All Implemented Interfaces:
- Store<V>,- JSONStore<V>,- Serializable,- Cloneable,- Map<Identifier,V>
 
 public class TestMemStore<V extends JSONEntry> extends HashMap<Identifier,V> implements JSONStore<V> This is used in various places for testing and debugging. It ends up here because of test re-usability requirements and should not be used for anything in production.Created by Jeff Gaynor 
 on 6/6/19 at 6:23 PM- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class java.util.AbstractMapAbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
 
- 
 - 
Field Summary- 
Fields inherited from interface edu.uiuc.ncsa.security.core.StoreVERSION_TAG
 
- 
 - 
Constructor SummaryConstructors Constructor Description TestMemStore()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Vcreate()Create a new object of the given type.List<V>getAll()Method to get every element in the store.List<V>getMostRecent(int n, List<String> attributes)XMLConverter<V>getXMLConverter()voidregister(V value)Almost Identical to put(K,V) but since the object should have an identifier, passing along the key is redundant.booleanremove(List<V> objects)Removes a list of identifiable objects.booleanremoveByID(List<Identifier> objects)voidsave(V value)Saves an object.List<V>search(String key, boolean isNull)Searches if a single column and returns all of the null or non-null elementsList<V>search(String key, String condition, boolean isRegEx)Allows for searching via a reg ex.List<V>search(String key, String condition, boolean isRegEx, List<String> attr)Return a subset of all the attributes.List<V>search(String key, String condition, boolean isRegEx, List<String> attr, String dateField, Date before, Date after)intsize(boolean includeVersions)voidupdate(List<Identifier> ids, Map<String,Object> values)Mass update.voidupdate(V value)Update an existing object.- 
Methods inherited from class java.util.HashMapclear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
 - 
Methods inherited from class java.util.AbstractMapequals, hashCode, toString
 - 
Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.util.Mapclear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
 
- 
 
- 
- 
- 
Method Detail- 
updatepublic void update(List<Identifier> ids, Map<String,Object> values) throws UnregisteredObjectException Description copied from interface:StoreMass update. For each id, update the keys with the new values. At the end of this operation, every entry in the id list has the same (key, value) pairs. This is used in processing StoreCommands RSRecords.- Specified by:
- updatein interface- Store<V extends JSONEntry>
- Throws:
- UnregisteredObjectException
 
 - 
getAllpublic List<V> getAll() Description copied from interface:StoreMethod to get every element in the store. This is useful for command line interfaces. Note that this might be very expensive.
 - 
createpublic V create() Description copied from interface:StoreCreate a new object of the given type. This is not in the store until it is registered. Attempts to update the object should throw an exception. Note that this allows for a separation of creation semantics. Some objects require specific initialization before saving
 - 
updatepublic void update(V value) Description copied from interface:StoreUpdate an existing object. AnUnregisteredObjectExceptionis thrown if the object has not been saved first.
 - 
registerpublic void register(V value) Description copied from interface:StoreAlmost Identical to put(K,V) but since the object should have an identifier, passing along the key is redundant. This persists the object in the store. Note that this returns void since the contract assumes that this is not registered. If the object is registered an exception should be thrown. Generally use save(V).
 - 
savepublic void save(V value) Description copied from interface:StoreSaves an object. This bridges the gap between SQL stores update and insert commands. Implementations should check if the object already exists in the store and issue an appropriate call.
 - 
sizepublic int size(boolean includeVersions) 
 - 
getXMLConverterpublic XMLConverter<V> getXMLConverter() - Specified by:
- getXMLConverterin interface- Store<V extends JSONEntry>
 
 - 
searchpublic List<V> search(String key, String condition, boolean isRegEx) Description copied from interface:StoreAllows for searching via a reg ex. Note that this may be very expensive for certain stores!
 - 
searchpublic List<V> search(String key, String condition, boolean isRegEx, List<String> attr) Description copied from interface:StoreReturn a subset of all the attributes. For non-SQL stores performance may be slow.
 - 
searchpublic List<V> search(String key, String condition, boolean isRegEx, List<String> attr, String dateField, Date before, Date after) 
 - 
searchpublic List<V> search(String key, boolean isNull) Description copied from interface:StoreSearches if a single column and returns all of the null or non-null elements
 - 
removepublic boolean remove(List<V> objects) Description copied from interface:StoreRemoves a list of identifiable objects. I.e., it will grab theIdentifiers from the objects and pass this toStore.removeByID(List).
 - 
removeByIDpublic boolean removeByID(List<Identifier> objects) - Specified by:
- removeByIDin interface- Store<V extends JSONEntry>
 
 
- 
 
-