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:
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 UserManager
The user managerprotected UserPopulationDAO
The user population DAOstatic final String
the avalon roleFields inherited from class org.ametys.core.datasource.AbstractMyBatisDAO
_manager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Configuration
Get the mybatis configurationvoid
activatePersonalDataRemoval
(List<UserIdentity> identities) Activate the personal data removal processes for these identitiesvoid
deactivatePersonalDataRemoval
(List<UserIdentity> identities) Deactivate the personal data removal processes for these identitiesGet the last connection date of the userGet the list of the unknown users with personal data removal activevoid
remove
(UserIdentity userIdentity) Remove the identity from the list of know user statusGet a list of the unknown users.void
service
(ServiceManager manager) void
updateConnectionDate
(UserIdentity userIdentity) Update the last connection date for the given uservoid
updateStatusOfInactiveUsers
(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, setPluginInfo
Methods 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:
service
in interfaceServiceable
- Overrides:
service
in classAbstractMyBatisDAO
- Throws:
ServiceException
-
_getMyBatisConfiguration
Description copied from class:AbstractMyBatisDAO
Get the mybatis configuration- Overrides:
_getMyBatisConfiguration
in 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
Check and update the unknown status for every users that didn't log in since 2 months (inactive users)- Parameters:
progressionTracker
- a tracker for the operation
-
remove
Remove the identity from the list of know user status- Parameters:
userIdentity
- the identity to remove
-