Class MemoryUserStore
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<edu.uiuc.ncsa.security.core.Identifier,V>
-
- edu.uiuc.ncsa.security.storage.MemoryStore<V>
-
- edu.uiuc.ncsa.security.storage.monitored.MonitoredMemoryStore<User>
-
- org.cilogon.oauth2.servlet.storage.user.MemoryUserStore
-
- All Implemented Interfaces:
edu.uiuc.ncsa.security.core.Store<User>
,edu.uiuc.ncsa.security.storage.MonitoredStoreInterface<User>
,Serializable
,Cloneable
,Map<edu.uiuc.ncsa.security.core.Identifier,User>
,UserStore
public class MemoryUserStore extends edu.uiuc.ncsa.security.storage.monitored.MonitoredMemoryStore<User> implements UserStore
NOTE: This does not retain the serial strings (or users) across system reboots. This is at this point in time, a debugging tool.Created by Jeff Gaynor
on 3/13/12 at 2:20 PM- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.uiuc.ncsa.security.storage.MemoryStore
edu.uiuc.ncsa.security.storage.MemoryStore.MSInitializer
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description MemoryUserStore(edu.uiuc.ncsa.security.core.util.IdentifiableProviderImpl<User> up, Incrementable incrementable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description User
create()
User
create(boolean newIdentifier)
Create a user, optionally with a new serial string.User
createAndRegisterUser(UserMultiID userMultiKey, String idP, String idPDisplayName, String firstName, String lastName, String email, String affiliation, String displayName, String organizationalUnit)
Create a user from all the given possible information.protected void
fromIndex(PersonName personName, String idp, Map<String,User> index, Map<edu.uiuc.ncsa.security.core.Identifier,User> users)
User
get(Object key)
Collection<User>
get(UserMultiID userMultiKey, String idP)
The remote user and idp together form a composite key for access.Incrementable
getIncrementable()
edu.uiuc.ncsa.security.storage.data.MapConverter
getMapConverter()
List<User>
getMostRecent(int n, List<String> attributes)
edu.uiuc.ncsa.security.core.Identifier
getUserID(UserMultiID userMultiKey, String idP)
Resolves the user id given the remoteUser and IdP.protected UserProvider
getUserProvider()
edu.uiuc.ncsa.security.core.XMLConverter<User>
getXMLConverter()
protected String
glom(String remoteUser, String idp)
User
put(edu.uiuc.ncsa.security.core.Identifier key, User value)
void
save(User value)
void
update(User value)
void
updateCheckSerialString(User user, boolean noNewSerialID)
Save the current user but do not change the serial identifier.protected void
updateIndex(PersonName personName, String idp, User user, Map<String,User> index)
-
Methods inherited from class edu.uiuc.ncsa.security.storage.monitored.MonitoredMemoryStore
addLastAccessedEventListener, doUpkeep, doUpkeep, fireLastAccessedEvent, getLastAccessedEventListeners, getUpkeepConfiguration, getUuid, hasUpkeepConfiguration, isMonitorEnabled, lastAccessUpdate, setMonitorEnabled, setUpkeepConfiguration, updateHook
-
Methods inherited from class edu.uiuc.ncsa.security.storage.MemoryStore
getAll, getInitializer, realSave, register, remove, search, search, search, size
-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Constructor Detail
-
MemoryUserStore
public MemoryUserStore(edu.uiuc.ncsa.security.core.util.IdentifiableProviderImpl<User> up, Incrementable incrementable)
-
-
Method Detail
-
createAndRegisterUser
public User createAndRegisterUser(UserMultiID userMultiKey, String idP, String idPDisplayName, String firstName, String lastName, String email, String affiliation, String displayName, String organizationalUnit)
Description copied from interface:UserStore
Create a user from all the given possible information. Some of this might be missing, but the minimal set is the remoteUser and idp. Note that this creates the user uid too AND it registers the user.- Specified by:
createAndRegisterUser
in interfaceUserStore
- Returns:
-
updateIndex
protected void updateIndex(PersonName personName, String idp, User user, Map<String,User> index)
-
fromIndex
protected void fromIndex(PersonName personName, String idp, Map<String,User> index, Map<edu.uiuc.ncsa.security.core.Identifier,User> users)
-
get
public Collection<User> get(UserMultiID userMultiKey, String idP)
Description copied from interface:UserStore
The remote user and idp together form a composite key for access. (Our URIs are internally generated unique identifiers and are not used outside of the store).
-
getUserID
public edu.uiuc.ncsa.security.core.Identifier getUserID(UserMultiID userMultiKey, String idP)
Description copied from interface:UserStore
Resolves the user id given the remoteUser and IdP.
-
getIncrementable
public Incrementable getIncrementable()
- Specified by:
getIncrementable
in interfaceUserStore
-
getUserProvider
protected UserProvider getUserProvider()
-
create
public User create(boolean newIdentifier)
Description copied from interface:UserStore
Create a user, optionally with a new serial string. The default behavior for this store is that new users are not created with a new serial identifier (or various operations such as listing users can run through a great many unused identifiers and if they are expensive to create, such as from an SQL database, this might slow down the application noticeably.)
-
create
public User create()
-
save
public void save(User value)
-
updateCheckSerialString
public void updateCheckSerialString(User user, boolean noNewSerialID)
Description copied from interface:UserStore
Save the current user but do not change the serial identifier. Note that this circumvents the contract forStore.update(edu.uiuc.ncsa.security.core.Identifiable)
for this interface, which, because of issue CIL-69 requires it in most cases. This is in effect an internal call that allows for administrative updates. IfnoNewSerialID = false
, then the effect is the same as callingStore.update(Identifiable)
and a new serial id is created.- Specified by:
updateCheckSerialString
in interfaceUserStore
-
update
public void update(User value)
-
getMapConverter
public edu.uiuc.ncsa.security.storage.data.MapConverter getMapConverter()
- Specified by:
getMapConverter
in interfaceUserStore
- Overrides:
getMapConverter
in classedu.uiuc.ncsa.security.storage.MemoryStore<User>
-
getXMLConverter
public edu.uiuc.ncsa.security.core.XMLConverter<User> getXMLConverter()
-
-