fr.paris.lutece.plugins.mylutece.modules.directory.authentication.business
Class MyluteceDirectoryUserHome

java.lang.Object
  extended by fr.paris.lutece.plugins.mylutece.modules.directory.authentication.business.MyluteceDirectoryUserHome

public final class MyluteceDirectoryUserHome
extends java.lang.Object

This class provides instances management methods (create, find, ...) for MyluteceDirectoryUser objects


Method Summary
static boolean checkActivated(java.lang.String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Check if user is activated
static boolean checkPassword(java.lang.String strLogin, java.lang.String strPassword, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Check the password for a DirectoryUser
static int countUserPasswordHistoryFromDate(java.sql.Timestamp minDate, int nUserId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the number of password change done by a user since the given date.
static MyluteceDirectoryUser create(MyluteceDirectoryUser directoryUser, java.lang.String strPassword, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Creation of an instance of directoryUser
static java.util.List<java.lang.Integer> findAllExpiredUserId(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of id of user with the expired status.
static MyluteceDirectoryUser findByPrimaryKey(int nIdRecord, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns an instance of a DirectoryUser whose identifier is specified in parameter
static java.util.Collection<MyluteceDirectoryUser> findDirectoryUsersList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns a collection of DirectoryUser objects
static java.util.Collection<MyluteceDirectoryUser> findDirectoryUsersListForAttributeValue(java.lang.String strAttributeKeys, java.lang.String strAttributeValue, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.util.Locale locale)
          Returns a collection of DirectoryUser objects for a LuteceUser Attribute
static java.util.Collection<MyluteceDirectoryUser> findDirectoryUsersListForEmail(java.lang.String strEmail, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.util.Locale locale)
          Returns a collection of DirectoryUser objects for an email
static java.util.Collection<MyluteceDirectoryUser> findDirectoryUsersListForLogin(java.lang.String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns a collection of DirectoryUser objects for a login
static int findIdRecordFromLogin(java.lang.String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get a user id from his login
static java.lang.String findPasswordByPrimaryKey(int nIdRecord, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the password of the specified user
static java.util.List<java.lang.String> getEmails(int nIdRecord, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.util.Locale locale)
          Get the list of emails given an ID record
static java.util.List<java.lang.Integer> getIdUsersToSendFirstAlert(java.sql.Timestamp firstAlertMaxDate, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of id of users that need to receive their first alert
static java.util.List<java.lang.Integer> getIdUsersToSendOtherAlert(java.sql.Timestamp alertMaxDate, java.sql.Timestamp timeBetweenAlerts, int maxNumberAlerts, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of id of users that need to receive their first alert
static java.util.List<java.lang.Integer> getIdUsersWithExpiredLifeTimeList(java.sql.Timestamp currentTimestamp, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of id of users that have an expired time life but not the expired status
static int getNbAccountLifeTimeNotification(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the number of notification send to a user to warn him about the expiration of his account
static void insertNewPasswordInHistory(java.lang.String strPassword, int nUserId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Log a password change in the password history
static void remove(MyluteceDirectoryUser directoryUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove the directoryUser whose identifier is specified in parameter
static void removeAllPasswordHistoryForUser(int nUserId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove every password saved in the password history for a user.
static java.util.List<java.lang.String> selectUserPasswordHistory(int nUserID, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Gets the history of password of the given user
static MyluteceDirectoryUser update(MyluteceDirectoryUser directoryUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update of the directoryUser which is specified in parameter
static void updateNbAlert(java.util.List<java.lang.Integer> idUserList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Increment the number of alert send to users by 1
static MyluteceDirectoryUser updatePassword(MyluteceDirectoryUser directoryUser, java.lang.String strNewPassword, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update of the directoryUser which is specified in parameter
static MyluteceDirectoryUser updateResetPassword(MyluteceDirectoryUser user, boolean bNewValue, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update of the databaseUser which is specified in parameter
static void updateUserExpirationDate(int nIdUser, java.sql.Timestamp newExpirationDate, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the user expiration date with the new values.
static void updateUserStatus(java.util.List<java.lang.Integer> idUserList, int nNewStatus, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update status of a list of user accounts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static MyluteceDirectoryUser create(MyluteceDirectoryUser directoryUser,
                                           java.lang.String strPassword,
                                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
Creation of an instance of directoryUser

Parameters:
directoryUser - The instance of the DirectoryUser which contains the informations to store
strPassword - The user's password
plugin - The current plugin using this method
Returns:
The instance of DirectoryUser which has been created with its primary key.

update

public static MyluteceDirectoryUser update(MyluteceDirectoryUser directoryUser,
                                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update of the directoryUser which is specified in parameter

Parameters:
directoryUser - The instance of the DirectoryUser which contains the data to store
plugin - The current plugin using this method
Returns:
The instance of the DirectoryUser which has been updated

updatePassword

public static MyluteceDirectoryUser updatePassword(MyluteceDirectoryUser directoryUser,
                                                   java.lang.String strNewPassword,
                                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update of the directoryUser which is specified in parameter

Parameters:
directoryUser - The instance of the DirectoryUser which contains the data to store
strNewPassword - The new password to store
plugin - The current plugin using this method
Returns:
The instance of the DirectoryUser which has been updated

updateResetPassword

public static MyluteceDirectoryUser updateResetPassword(MyluteceDirectoryUser user,
                                                        boolean bNewValue,
                                                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update of the databaseUser which is specified in parameter

Parameters:
databaseUser - The instance of the DatabaseUser which contains the data to store
bNewValue - New value of the reset password property
plugin - The current plugin using this method
Returns:
The instance of the DatabaseUser which has been updated

remove

public static void remove(MyluteceDirectoryUser directoryUser,
                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove the directoryUser whose identifier is specified in parameter

Parameters:
directoryUser - The DirectoryUser object to remove
plugin - The current plugin using this method

findByPrimaryKey

public static MyluteceDirectoryUser findByPrimaryKey(int nIdRecord,
                                                     fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns an instance of a DirectoryUser whose identifier is specified in parameter

Parameters:
nIdRecord - The identifier of User
plugin - The current plugin using this method
Returns:
An instance of DirectoryUser

findDirectoryUsersList

public static java.util.Collection<MyluteceDirectoryUser> findDirectoryUsersList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns a collection of DirectoryUser objects

Parameters:
plugin - The current plugin using this method
Returns:
A collection of DirectoryUser

findDirectoryUsersListForLogin

public static java.util.Collection<MyluteceDirectoryUser> findDirectoryUsersListForLogin(java.lang.String strLogin,
                                                                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns a collection of DirectoryUser objects for a login

Parameters:
strLogin - The login of the databseUser
plugin - The current plugin using this method
Returns:
A collection of DirectoryUser

findDirectoryUsersListForAttributeValue

public static java.util.Collection<MyluteceDirectoryUser> findDirectoryUsersListForAttributeValue(java.lang.String strAttributeKeys,
                                                                                                  java.lang.String strAttributeValue,
                                                                                                  fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                                                                                  java.util.Locale locale)
Returns a collection of DirectoryUser objects for a LuteceUser Attribute

Parameters:
strAttributeKeys - The attribute keys list of the DirectoryUser (comma separated)
strAttributeValue - The attribute value of the DirectoryUser
plugin - The current plugin using this method
locale - The locale
Returns:
A collection of DirectoryUser

findDirectoryUsersListForEmail

public static java.util.Collection<MyluteceDirectoryUser> findDirectoryUsersListForEmail(java.lang.String strEmail,
                                                                                         fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                                                                         java.util.Locale locale)
Returns a collection of DirectoryUser objects for an email

Parameters:
strEmail - The email of the DirectoryUser
plugin - The current plugin using this method
locale - The locale
Returns:
A collection of DirectoryUser

findPasswordByPrimaryKey

public static java.lang.String findPasswordByPrimaryKey(int nIdRecord,
                                                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the password of the specified user

Parameters:
nIdRecord - The Primary key of the directoryUser
plugin - The current plugin using this method
Returns:
String the user password

checkPassword

public static boolean checkPassword(java.lang.String strLogin,
                                    java.lang.String strPassword,
                                    fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check the password for a DirectoryUser

Parameters:
strLogin - The user login of DirectoryUser
strPassword - The password of DirectoryUser
plugin - The Plugin using this data access service
Returns:
true if password is ok

checkActivated

public static boolean checkActivated(java.lang.String strLogin,
                                     fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check if user is activated

Parameters:
strLogin - The user login of DirectoryUser
plugin - The Plugin using this data access service
Returns:
true if user is activated

getEmails

public static java.util.List<java.lang.String> getEmails(int nIdRecord,
                                                         fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                                         java.util.Locale locale)
Get the list of emails given an ID record

Parameters:
nIdRecord - the ID record
plugin - Plugin
locale - the locale
Returns:
the list of emails

findIdRecordFromLogin

public static int findIdRecordFromLogin(java.lang.String strLogin,
                                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get a user id from his login

Parameters:
strLogin - The login of the user
plugin - The plugin
Returns:
The user id, or 0 if no user has this login.

selectUserPasswordHistory

public static java.util.List<java.lang.String> selectUserPasswordHistory(int nUserID,
                                                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Gets the history of password of the given user

Parameters:
nUserID - Id of the user
plugin - The plugin
Returns:
The list of recent passwords used by the user.

countUserPasswordHistoryFromDate

public static int countUserPasswordHistoryFromDate(java.sql.Timestamp minDate,
                                                   int nUserId,
                                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the number of password change done by a user since the given date.

Parameters:
minDate - Minimum date to consider.
nUserId - Id of the user
plugin - The plugin
Returns:
The number of password change done by the user since the given date.

insertNewPasswordInHistory

public static void insertNewPasswordInHistory(java.lang.String strPassword,
                                              int nUserId,
                                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
Log a password change in the password history

Parameters:
strPassword - New password of the user
nUserId - Id of the user
plugin - The plugin

removeAllPasswordHistoryForUser

public static void removeAllPasswordHistoryForUser(int nUserId,
                                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove every password saved in the password history for a user.

Parameters:
nUserId - Id of the user
plugin - The plugin

findAllExpiredUserId

public static java.util.List<java.lang.Integer> findAllExpiredUserId(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of id of user with the expired status.

Parameters:
plugin - The plugin
Returns:
The list of if of user with the expired status.

getIdUsersWithExpiredLifeTimeList

public static java.util.List<java.lang.Integer> getIdUsersWithExpiredLifeTimeList(java.sql.Timestamp currentTimestamp,
                                                                                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of id of users that have an expired time life but not the expired status

Parameters:
currentTimestamp - Timestamp describing the current time.
plugin - The plugin
Returns:
the list of id of users with expired time life

getIdUsersToSendFirstAlert

public static java.util.List<java.lang.Integer> getIdUsersToSendFirstAlert(java.sql.Timestamp firstAlertMaxDate,
                                                                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of id of users that need to receive their first alert

Parameters:
firstAlertMaxDate - The maximum expiration date to send first alert.
plugin - The plugin
Returns:
the list of id of users that need to receive their first alert

getIdUsersToSendOtherAlert

public static java.util.List<java.lang.Integer> getIdUsersToSendOtherAlert(java.sql.Timestamp alertMaxDate,
                                                                           java.sql.Timestamp timeBetweenAlerts,
                                                                           int maxNumberAlerts,
                                                                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of id of users that need to receive their first alert

Parameters:
alertMaxDate - The maximum date to send alerts.
timeBetweenAlerts - Timestamp describing the time between two alerts.
maxNumberAlerts - Maximum number of alerts to send to a user
plugin - The plugin
Returns:
the list of id of users that need to receive their first alert

updateUserStatus

public static void updateUserStatus(java.util.List<java.lang.Integer> idUserList,
                                    int nNewStatus,
                                    fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update status of a list of user accounts

Parameters:
idUserList - List of user accounts to update
nNewStatus - New status of the user
plugin - The plugin

updateNbAlert

public static void updateNbAlert(java.util.List<java.lang.Integer> idUserList,
                                 fr.paris.lutece.portal.service.plugin.Plugin plugin)
Increment the number of alert send to users by 1

Parameters:
nIdUserList - The list of users to update
plugin - The plugin

updateUserExpirationDate

public static void updateUserExpirationDate(int nIdUser,
                                            java.sql.Timestamp newExpirationDate,
                                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the user expiration date with the new values. Also update his alert account to 0

Parameters:
nIdUser - Id of the user to update
plugin - The plugin
newExpirationDate - Id of the user to update

getNbAccountLifeTimeNotification

public static int getNbAccountLifeTimeNotification(int nIdUser,
                                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the number of notification send to a user to warn him about the expiration of his account

Parameters:
nIdUser - Id of the user
plugin - The plugin
Returns:
The number of notification send to the user


Copyright © 2012 Mairie de Paris. All Rights Reserved.