Class DynamoDBStore<V extends Identifiable>
- java.lang.Object
-
- edu.uiuc.ncsa.security.storage.dynamodb.DynamoDBStore<V>
-
- All Implemented Interfaces:
Store<V>,Map<Identifier,V>
public class DynamoDBStore<V extends Identifiable> extends Object implements Store<V>
Created by Jeff Gaynor
on 4/22/24 at 12:59 PM
-
-
Field Summary
-
Fields inherited from interface edu.uiuc.ncsa.security.core.Store
VERSION_TAG
-
-
Constructor Summary
Constructors Constructor Description DynamoDBStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(Object o)booleancontainsValue(Object o)Vcreate()Create a new object of the given type.Set<Map.Entry<Identifier,V>>entrySet()Vget(Object o)List<V>getAll()Method to get every element in the store.List<V>getMostRecent(int n, List<String> attributes)XMLConverter<V>getXMLConverter()booleanisEmpty()Set<Identifier>keySet()Vput(Identifier identifier, V v)voidputAll(Map<? extends Identifier,? extends V> map)voidregister(V value)Almost Identical to put(K,V) but since the object should have an identifier, passing along the key is redundant.Vremove(Object o)booleanremove(List<Identifiable> objects)Removes a list of identifiable object from the store by ID.voidsave(V value)Saves an object.List<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()intsize(boolean includeVersions)voidupdate(V value)Update an existing object.Collection<V>values()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Method Detail
-
create
public 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- Specified by:
createin interfaceStore<V extends Identifiable>- Returns:
-
update
public void update(V value)
Description copied from interface:StoreUpdate an existing object. AnUnregisteredObjectExceptionis thrown if the object has not been saved first.- Specified by:
updatein interfaceStore<V extends Identifiable>
-
register
public 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).- Specified by:
registerin interfaceStore<V extends Identifiable>
-
save
public 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.- Specified by:
savein interfaceStore<V extends Identifiable>
-
getAll
public 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.- Specified by:
getAllin interfaceStore<V extends Identifiable>- Returns:
-
getXMLConverter
public XMLConverter<V> getXMLConverter()
- Specified by:
getXMLConverterin interfaceStore<V extends Identifiable>
-
search
public 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!- Specified by:
searchin interfaceStore<V extends Identifiable>- Returns:
-
search
public 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.- Specified by:
searchin interfaceStore<V extends Identifiable>- Returns:
-
search
public List<V> search(String key, String condition, boolean isRegEx, List<String> attr, String dateField, Date before, Date after)
- Specified by:
searchin interfaceStore<V extends Identifiable>
-
size
public int size(boolean includeVersions)
- Specified by:
sizein interfaceStore<V extends Identifiable>
-
remove
public boolean remove(List<Identifiable> objects)
Description copied from interface:StoreRemoves a list of identifiable object from the store by ID.- Specified by:
removein interfaceStore<V extends Identifiable>- Returns:
-
getMostRecent
public List<V> getMostRecent(int n, List<String> attributes)
- Specified by:
getMostRecentin interfaceStore<V extends Identifiable>
-
size
public int size()
- Specified by:
sizein interfaceMap<Identifier,V extends Identifiable>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceMap<Identifier,V extends Identifiable>
-
containsKey
public boolean containsKey(Object o)
- Specified by:
containsKeyin interfaceMap<Identifier,V extends Identifiable>
-
containsValue
public boolean containsValue(Object o)
- Specified by:
containsValuein interfaceMap<Identifier,V extends Identifiable>
-
get
public V get(Object o)
- Specified by:
getin interfaceMap<Identifier,V extends Identifiable>
-
put
public V put(Identifier identifier, V v)
- Specified by:
putin interfaceMap<Identifier,V extends Identifiable>
-
remove
public V remove(Object o)
- Specified by:
removein interfaceMap<Identifier,V extends Identifiable>
-
putAll
public void putAll(Map<? extends Identifier,? extends V> map)
- Specified by:
putAllin interfaceMap<Identifier,V extends Identifiable>
-
clear
public void clear()
- Specified by:
clearin interfaceMap<Identifier,V extends Identifiable>
-
keySet
public Set<Identifier> keySet()
- Specified by:
keySetin interfaceMap<Identifier,V extends Identifiable>
-
values
public Collection<V> values()
- Specified by:
valuesin interfaceMap<Identifier,V extends Identifiable>
-
entrySet
public Set<Map.Entry<Identifier,V>> entrySet()
- Specified by:
entrySetin interfaceMap<Identifier,V extends Identifiable>
-
-