Interface UserStore
-
- All Superinterfaces:
Map<edu.uiuc.ncsa.security.core.Identifier,User>
,edu.uiuc.ncsa.security.core.Store<User>
- All Known Implementing Classes:
CILSQLUserStore
,MemoryUserStore
,UserFileStore
public interface UserStore extends edu.uiuc.ncsa.security.core.Store<User>
One note is about saving users: InvokingStore.save(edu.uiuc.ncsa.security.core.Identifiable)
on a user should either register the user (if not in the store) or update the user. Updating a user means changing the serial string of the user. Do not save a user unless there is a bona fide change to their information on this account!
What's more, users in a store are independent of any instances returned by the store (so some cloning on saves and gets might be required). This is because of archiving semantics: The sequence is determine if the current instance of a user has changed, invoke ArchivedUserStore.archiveUser, which gets the old stored in this store, and archives it. Then you may save the user instance.Created by Jeff Gaynor
on Mar 12, 2010 at 12:55:02 PM
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description User
create(boolean newSerialString)
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.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()
edu.uiuc.ncsa.security.core.Identifier
getUserID(UserMultiID userMultiKey, String idP)
Resolves the user id given the remoteUser and IdP.void
updateCheckSerialString(User user, boolean noNewSerialID)
Save the current user but do not change the serial identifier.-
Methods inherited from interface java.util.Map
clear, 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
-
getIncrementable
Incrementable getIncrementable()
-
updateCheckSerialString
void updateCheckSerialString(User user, boolean noNewSerialID)
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.- Parameters:
noNewSerialID
-
-
get
Collection<User> get(UserMultiID userMultiKey, String idP)
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).- Parameters:
idP
-- Returns:
-
createAndRegisterUser
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. 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.- Parameters:
userMultiKey
-idP
-idPDisplayName
-firstName
-lastName
-email
-- Returns:
-
getUserID
edu.uiuc.ncsa.security.core.Identifier getUserID(UserMultiID userMultiKey, String idP)
Resolves the user id given the remoteUser and IdP.- Parameters:
userMultiKey
-idP
-- Returns:
-
create
User create(boolean newSerialString)
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.)- Parameters:
newSerialString
-- Returns:
-
getMapConverter
edu.uiuc.ncsa.security.storage.data.MapConverter getMapConverter()
-
-