Package org.ametys.core.user.status
Class UserStatusManager
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.datasource.AbstractMyBatisDAO
org.ametys.core.user.status.UserStatusManager
- All Implemented Interfaces:
DeferredServiceable,LogEnabled,PluginAware,Component,Configurable,Contextualizable,Serviceable
Component responsible of managing the status of a user (last connection date, missing date, ...)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected UserManagerThe user managerprotected UserPopulationDAOThe user population DAOstatic final Stringthe avalon roleFields inherited from class org.ametys.core.datasource.AbstractMyBatisDAO
_manager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ConfigurationGet the mybatis configurationvoidactivatePersonalDataRemoval(List<UserIdentity> identities) Activate the personal data removal processes for these identitiesvoiddeactivatePersonalDataRemoval(List<UserIdentity> identities) Deactivate the personal data removal processes for these identitiesvoiddeferredService(ServiceManager manager) Pass theServiceManagerused to access other components.Get the last connection date of the userGet the list of the unknown users with personal data removal activevoidremove(UserIdentity userIdentity) Remove the identity from the list of know user statusGet a list of the unknown users.voidservice(ServiceManager manager) voidupdateConnectionDate(UserIdentity userIdentity) Update the last connection date for the given uservoidupdateStatusOfInactiveUsers(int monthDelay, ContainerProgressionTracker progressionTracker) Check and update the unknown status for every users that didn't log in since 2 months (inactive users)Methods inherited from class org.ametys.core.datasource.AbstractMyBatisDAO
_configureDatasource, _getDataSourceId, configure, contextualize, getSession, getSession, reload, setPluginInfoMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
the avalon role -
_userManager
The user manager -
_userPopulationDAO
The user population DAO
-
-
Constructor Details
-
UserStatusManager
public UserStatusManager()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractMyBatisDAO- Throws:
ServiceException
-
deferredService
Description copied from interface:DeferredServiceablePass theServiceManagerused to access other components.- Specified by:
deferredServicein interfaceDeferredServiceable- Parameters:
manager- TheServiceManagerwhich thisDeferredServiceableuses. Must not benull.- Throws:
ServiceException- if an error occurs
-
_getMyBatisConfiguration
Description copied from class:AbstractMyBatisDAOGet the mybatis configuration- Overrides:
_getMyBatisConfigurationin classAbstractMyBatisDAO- Parameters:
env- the mybatis environnement- Returns:
- the mybatis configuration
-
getLastConnectionDate
Get the last connection date of the user- Parameters:
user- the user identity- Returns:
- the last connection date or empty if the user never logged in
-
updateConnectionDate
Update the last connection date for the given user- Parameters:
userIdentity- the user that just logged in
-
searchUnknownUsers
public Map<String,Object> searchUnknownUsers(String pattern, int offset, int limit, List<Map<String, String>> sorts) Get a list of the unknown users. A user is considered unknown if its last connection is older than 2 months and the user is not present in its user directory anymore.- Parameters:
pattern- the pattern to searchoffset- the position of the first resultlimit- the number of resultsorts- the sorters to apply- Returns:
- the unknown users
-
getUnknownUsersWithDataRemovalActive
Get the list of the unknown users with personal data removal active- Returns:
- the unknown users
-
activatePersonalDataRemoval
Activate the personal data removal processes for these identities- Parameters:
identities- the identities
-
deactivatePersonalDataRemoval
Deactivate the personal data removal processes for these identities- Parameters:
identities- the identities
-
updateStatusOfInactiveUsers
public void updateStatusOfInactiveUsers(int monthDelay, ContainerProgressionTracker progressionTracker) Check and update the unknown status for every users that didn't log in since 2 months (inactive users)- Parameters:
monthDelay- number of month since last connection to be considered inactive. The configured value will be used for value lower than 0.progressionTracker- a tracker for the operation
-
remove
Remove the identity from the list of know user status- Parameters:
userIdentity- the identity to remove
-