Package edu.uiuc.ncsa.security.storage
Class GenericStoreUtils
- java.lang.Object
-
- edu.uiuc.ncsa.security.storage.GenericStoreUtils
-
public class GenericStoreUtils extends Object
This is where static generic methods for stores like searches live. These are horribly inefficient but sometimes there is no other way. The intent is that if you need to use these, they are centralized to prevent boiler plating.Created by Jeff Gaynor
on 8/10/21 at 6:38 AM
-
-
Constructor Summary
Constructors Constructor Description GenericStoreUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Identifiable
fromXML(Store store, XMLMap map)
This will convert a map into an object.static void
fromXMLAndSave(Store store, XMLMap map)
static <V extends Identifiable>
List<V>getMostRecent(Store<V> store, int n, List<String> attributes)
static <V extends Identifiable>
List<V>search(Store<V> store, String key, String condition, boolean isRegEx, List<String> attr)
static <V extends Identifiable>
List<V>search(Store<V> store, String key, String condition, boolean isRegEx, List<String> attr, String dateField, Date before, Date after)
static XMLMap
toXML(Store store, Identifiable identifiable)
Convert an identifiable object to anXMLMap
.
-
-
-
Method Detail
-
search
public static <V extends Identifiable> List<V> search(Store<V> store, String key, String condition, boolean isRegEx, List<String> attr)
-
search
public static <V extends Identifiable> List<V> search(Store<V> store, String key, String condition, boolean isRegEx, List<String> attr, String dateField, Date before, Date after)
-
getMostRecent
public static <V extends Identifiable> List<V> getMostRecent(Store<V> store, int n, List<String> attributes)
-
toXML
public static XMLMap toXML(Store store, Identifiable identifiable)
Convert an identifiable object to anXMLMap
. This is useful for serializing objects in the store, backing them up, etc.- Parameters:
store
-identifiable
-- Returns:
-
fromXML
public static Identifiable fromXML(Store store, XMLMap map)
This will convert a map into an object. You must issue a save separately or if you prefer,fromXMLAndSave(Store, XMLMap)
.- Parameters:
store
-map
-- Returns:
-
-