Class UserFileStore
- java.lang.Object
-
- edu.uiuc.ncsa.security.storage.IndexedStreamStore<V>
-
- edu.uiuc.ncsa.security.storage.FileStore<V>
-
- edu.uiuc.ncsa.security.storage.monitored.MonitoredFileStore<User>
-
- org.cilogon.oauth2.servlet.storage.user.UserFileStore
-
- All Implemented Interfaces:
edu.uiuc.ncsa.security.core.Store<User>,edu.uiuc.ncsa.security.storage.MonitoredStoreInterface<User>,Map<edu.uiuc.ncsa.security.core.Identifier,User>,UserStore
public class UserFileStore extends edu.uiuc.ncsa.security.storage.monitored.MonitoredFileStore<User> implements UserStore
Created by Jeff Gaynor
on 3/2/12 at 12:52 PM
-
-
Constructor Summary
Constructors Constructor Description UserFileStore(File storeDirectory, File indexDirectory, edu.uiuc.ncsa.security.core.util.IdentifiableProviderImpl<User> up, edu.uiuc.ncsa.security.storage.data.MapConverter converter, boolean removeEmptyFiles, Incrementable incrementable, boolean removeFailedFiles)UserFileStore(File file, UserProvider up, edu.uiuc.ncsa.security.storage.data.MapConverter converter, boolean removeEmptyFiles, boolean removeFailedFiles)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Usercreate()Usercreate(boolean newIdentifier)Create a user, optionally with a new serial string.UsercreateAndRegisterUser(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.Userget(Object key)Collection<User>get(UserMultiID userMultiKey, String idP)The remote user and idp together form a composite key for access.IncrementablegetIncrementable()edu.uiuc.ncsa.security.storage.data.MapConvertergetMapConverter()List<User>getMostRecent(int n, List<String> attributes)protected UserProvidergetUP()edu.uiuc.ncsa.security.core.IdentifiergetUserID(UserMultiID userMultiKey, String idP)Resolves the user id given the remoteUser and IdP.voidrealSave(boolean checkExists, User t)voidsave(User t)protected StringtoIdentifier(String remoteUser, String idp)protected StringtoIdentifier(EduPersonPrincipleName eppn, String idp)protected StringtoIdentifier(EduPersonTargetedID eptid, String idp)protected StringtoIdentifier(OpenIDConnect openIDConnect, String idp)protected StringtoIdentifier(OpenID openID, String idp)protected StringtoIdentifier(PairwiseID pairwiseID, String idp)protected StringtoIdentifier(PersonName remoteUser, String idp)protected StringtoIdentifier(RemoteUserName remoteUser, String idp)protected StringtoIdentifier(SubjectID subjectID, String idp)voidupdate(User t)voidupdateCheckSerialString(User user, boolean noNewSerialID)Save the current user but do not change the serial identifier.-
Methods inherited from class edu.uiuc.ncsa.security.storage.monitored.MonitoredFileStore
addLastAccessedEventListener, doUpkeep, doUpkeep, fireLastAccessedEvent, getLastAccessedEventListeners, getUpkeepConfiguration, getUuid, hasUpkeepConfiguration, isMonitorEnabled, lastAccessUpdate, setMonitorEnabled, setUpkeepConfiguration, updateHook
-
Methods inherited from class edu.uiuc.ncsa.security.storage.FileStore
checkPermissions, clear, containsKey, containsValue, createIndexEntry, delete, doSetup, entrySet, getAll, getIndexDirectory, getIndexEntry, getItemFile, getItemFile, getStorageDirectory, getXMLConverter, keySet, loadByIdentifier, loadFile, loadFromIndex, putAll, realRemove, register, remove, remove, removeByID, removeIndexEntry, search, search, search, search, setIndexDirectory, setStorageDirectory, size, size, toString, update, values
-
Methods inherited from class edu.uiuc.ncsa.security.storage.IndexedStreamStore
createIndexEntry, getCreatedItems, hashString, isEmpty, loadStream, put, put
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, 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, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Constructor Detail
-
UserFileStore
public UserFileStore(File file, UserProvider up, edu.uiuc.ncsa.security.storage.data.MapConverter converter, boolean removeEmptyFiles, boolean removeFailedFiles)
-
UserFileStore
public UserFileStore(File storeDirectory, File indexDirectory, edu.uiuc.ncsa.security.core.util.IdentifiableProviderImpl<User> up, edu.uiuc.ncsa.security.storage.data.MapConverter converter, boolean removeEmptyFiles, Incrementable incrementable, boolean removeFailedFiles)
-
-
Method Detail
-
getIncrementable
public Incrementable getIncrementable()
- Specified by:
getIncrementablein interfaceUserStore
-
getUP
protected UserProvider getUP()
-
save
public void save(User t)
-
realSave
public void realSave(boolean checkExists, User t)- Overrides:
realSavein classedu.uiuc.ncsa.security.storage.FileStore<User>
-
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:UserStoreCreate 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:
createAndRegisterUserin interfaceUserStore- Returns:
-
toIdentifier
protected String toIdentifier(EduPersonPrincipleName eppn, String idp)
-
toIdentifier
protected String toIdentifier(RemoteUserName remoteUser, String idp)
-
toIdentifier
protected String toIdentifier(PersonName remoteUser, String idp)
-
toIdentifier
protected String toIdentifier(EduPersonTargetedID eptid, String idp)
-
toIdentifier
protected String toIdentifier(OpenIDConnect openIDConnect, String idp)
-
toIdentifier
protected String toIdentifier(PairwiseID pairwiseID, String idp)
-
get
public Collection<User> get(UserMultiID userMultiKey, String idP)
Description copied from interface:UserStoreThe 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).
-
create
public User create(boolean newIdentifier)
Description copied from interface:UserStoreCreate 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()
-
getUserID
public edu.uiuc.ncsa.security.core.Identifier getUserID(UserMultiID userMultiKey, String idP)
Description copied from interface:UserStoreResolves the user id given the remoteUser and IdP.
-
updateCheckSerialString
public void updateCheckSerialString(User user, boolean noNewSerialID)
Description copied from interface:UserStoreSave 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:
updateCheckSerialStringin interfaceUserStore
-
update
public void update(User t)
-
getMapConverter
public edu.uiuc.ncsa.security.storage.data.MapConverter getMapConverter()
- Specified by:
getMapConverterin interfaceUserStore- Overrides:
getMapConverterin classedu.uiuc.ncsa.security.storage.FileStore<User>
-
-