fr.paris.lutece.portal.business.user
Class AdminUserDAO

java.lang.Object
  extended by fr.paris.lutece.portal.business.user.AdminUserDAO
All Implemented Interfaces:
IAdminUserDAO

public class AdminUserDAO
extends java.lang.Object
implements IAdminUserDAO

This class porvides Data Access methods for AdminUser objects


Constructor Summary
AdminUserDAO()
           
 
Method Summary
 boolean checkAccessCodeAlreadyInUse(java.lang.String strAccessCode)
           
 boolean checkRoleAttributed(java.lang.String strRoleKey)
          Checks wether the role is in use or not
 void delete(int nUserId)
           
 void deleteAllDelegatedRightsForUser(int nUserId, int nUserLevel)
          Deletes rights delegated by user ie rights with level < userlevel
 void deleteAllOwnRightsForUser(int nUserId, int nUserLevel)
          Deletes rights own by user ie rights with level >= userlevel
 void deleteAllRightsForUser(int nUserId)
           
 void deleteAllRolesForUser(int nUserId)
           
 void insert(AdminUser user)
          Insert a new record in the table.
 void insert(LuteceDefaultAdminUser user)
          Insert a new record in the table.
 void insertRightsListForUser(int nUserId, java.lang.String strRightId)
           
 void insertRolesListForUser(int nUserId, java.lang.String strRoleKey)
           
 AdminUser load(int nUserId)
           
 LuteceDefaultAdminUser loadDefaultAdminUser(int nUserId)
           
 int newPrimaryKey()
          Generates a new primary key
 java.util.Map<java.lang.String,Right> selectRightsListForUser(int nUserId)
          Get the right list associated to a given user id
 java.util.Map<java.lang.String,AdminRole> selectRolesListForUser(int nUserId)
          Get the role list associated to a given user id
 AdminUser selectUserByAccessCode(java.lang.String strUserAccessCode)
           
 java.util.Collection<AdminUser> selectUserList()
           
 java.util.Collection<AdminUser> selectUsersByRole(java.lang.String strRoleKey)
           
 void store(AdminUser user)
           
 void store(LuteceDefaultAdminUser user)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdminUserDAO

public AdminUserDAO()
Method Detail

load

public AdminUser load(int nUserId)
Specified by:
load in interface IAdminUserDAO
Parameters:
nUserId - th user id
Returns:
user

selectUserByAccessCode

public AdminUser selectUserByAccessCode(java.lang.String strUserAccessCode)
Specified by:
selectUserByAccessCode in interface IAdminUserDAO
Parameters:
strUserAccessCode - th elogin
Returns:
user

selectUserList

public java.util.Collection<AdminUser> selectUserList()
Specified by:
selectUserList in interface IAdminUserDAO
Returns:
userList

newPrimaryKey

public int newPrimaryKey()
Generates a new primary key

Specified by:
newPrimaryKey in interface IAdminUserDAO
Returns:
nKey

insert

public void insert(AdminUser user)
Insert a new record in the table.

Specified by:
insert in interface IAdminUserDAO
Parameters:
user - The AdminUser

store

public void store(AdminUser user)
Specified by:
store in interface IAdminUserDAO
Parameters:
user - The AdminUser

delete

public void delete(int nUserId)
Specified by:
delete in interface IAdminUserDAO
Parameters:
nUserId - th user id

selectRightsListForUser

public java.util.Map<java.lang.String,Right> selectRightsListForUser(int nUserId)
Get the right list associated to a given user id

Specified by:
selectRightsListForUser in interface IAdminUserDAO
Parameters:
nUserId - the id of the user to retrieve rights
Returns:
the right list as a collection of strings

insertRightsListForUser

public void insertRightsListForUser(int nUserId,
                                    java.lang.String strRightId)
Specified by:
insertRightsListForUser in interface IAdminUserDAO
Parameters:
nUserId - the user id
strRightId - the right id

deleteAllRightsForUser

public void deleteAllRightsForUser(int nUserId)
Specified by:
deleteAllRightsForUser in interface IAdminUserDAO
Parameters:
nUserId - the user id

selectRolesListForUser

public java.util.Map<java.lang.String,AdminRole> selectRolesListForUser(int nUserId)
Get the role list associated to a given user id

Specified by:
selectRolesListForUser in interface IAdminUserDAO
Parameters:
nUserId - the id of the user to retrieve roles
Returns:
the role list

insertRolesListForUser

public void insertRolesListForUser(int nUserId,
                                   java.lang.String strRoleKey)
Specified by:
insertRolesListForUser in interface IAdminUserDAO
Parameters:
nUserId - the user id
strRoleKey - the key role

deleteAllRolesForUser

public void deleteAllRolesForUser(int nUserId)
Specified by:
deleteAllRolesForUser in interface IAdminUserDAO
Parameters:
nUserId - the user id

checkRoleAttributed

public boolean checkRoleAttributed(java.lang.String strRoleKey)
Checks wether the role is in use or not

Specified by:
checkRoleAttributed in interface IAdminUserDAO
Parameters:
strRoleKey - the role key to check
Returns:
true if the role is attributed, false otherwise

checkAccessCodeAlreadyInUse

public boolean checkAccessCodeAlreadyInUse(java.lang.String strAccessCode)
Specified by:
checkAccessCodeAlreadyInUse in interface IAdminUserDAO
Parameters:
strAccessCode -
Returns:

insert

public void insert(LuteceDefaultAdminUser user)
Insert a new record in the table.

Specified by:
insert in interface IAdminUserDAO
Parameters:
user - The AdminUser

store

public void store(LuteceDefaultAdminUser user)
Specified by:
store in interface IAdminUserDAO
Parameters:
user - The AdminUser

loadDefaultAdminUser

public LuteceDefaultAdminUser loadDefaultAdminUser(int nUserId)
Specified by:
loadDefaultAdminUser in interface IAdminUserDAO
Parameters:
nUserId - th user id
Returns:
user

selectUsersByRole

public java.util.Collection<AdminUser> selectUsersByRole(java.lang.String strRoleKey)
Specified by:
selectUsersByRole in interface IAdminUserDAO
Returns:
userList

deleteAllOwnRightsForUser

public void deleteAllOwnRightsForUser(int nUserId,
                                      int nUserLevel)
Deletes rights own by user ie rights with level >= userlevel

Specified by:
deleteAllOwnRightsForUser in interface IAdminUserDAO
Parameters:
nUserId - the user id
nUserLevel - the user level

deleteAllDelegatedRightsForUser

public void deleteAllDelegatedRightsForUser(int nUserId,
                                            int nUserLevel)
Deletes rights delegated by user ie rights with level < userlevel

Specified by:
deleteAllDelegatedRightsForUser in interface IAdminUserDAO
Parameters:
nUserId - the user id
nUserLevel - the user level


Copyright © 2008 Mairie de Paris. All Rights Reserved.