Class UserDao
java.lang.Object
org.apache.openmeetings.db.dao.user.UserDao
- All Implemented Interfaces:
IDataProviderDao<User>
,IGroupAdminDataProviderDao<User>
@Repository
@Transactional
public class UserDao
extends Object
implements IGroupAdminDataProviderDao<User>
CRUD operations for
User
- Author:
- swagner, vasya
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
adminCount
(String search) Count the number of instances ofIGroupAdminDataProviderDao
long
adminCount
(String search, Long adminId) Count the number of instances ofIGroupAdminDataProviderDao
adminGet
(String search, long start, long count, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort) Get a list of instances ofIGroupAdminDataProviderDao
adminGet
(String search, Long adminId, long start, long count, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort) Get a list of instances ofIGroupAdminDataProviderDao
boolean
checkEmail
(String email, User.Type type, Long domainId, Long id) Checks if a mail is already taken by someone elseboolean
checkLogin
(String login, User.Type type, Long domainId, Long id) check for duplicateslong
count()
Count the number of instances ofIDataProviderDao
long
Count the number of instances ofIDataProviderDao
long
long
countUsers
(String search, Long currentUserId) void
Delete an instance ofIDataProviderDao
get
(long first, long count) Get a list of instances ofIDataProviderDao
Get an instance of anIDataProviderDao
get
(String search, long start, long count, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort) Get a list of instances ofIDataProviderDao
get
(String search, long start, long count, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort, boolean filterContacts, Long currentUserId) get
(Collection<Long> ids) getByActivationHash
(String hash) getByEmail
(String email) getByEmail
(String _email, User.Type type, Long domainId) getByExpiredHash
(long ttl) getByLogin
(String _login, User.Type type, Long domainId) getContact
(String email, Long ownerId) getContact
(String email, String firstName, String lastName, Long ownerId) getContact
(String email, User owner) static Set<User.Right>
getExternalUser
(String extId, String extType) static User
getNewUserInstance
(User currentUser) Get a new instance of theUser
entity, with all default values setgetUserByHash
(String hash) login logicvoid
resetPassword
(User u, String password) searchCountUserProfile
(Long userId, String search, String userOffers, String userSearches) searchUserProfile
(Long userId, String search, String userOffers, String userSearches, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort, long start, long count) selectMaxFromUsersWithSearch
(String search) Update an instance ofIDataProviderDao
boolean
validLogin
(String login) boolean
verifyPassword
(Long userId, String password) Returns true if the password is correctMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.openmeetings.db.dao.IDataProviderDao
get
-
Field Details
-
FETCH_GROUP_GROUP
- See Also:
-
FETCH_GROUP_BACKUP
- See Also:
-
-
Constructor Details
-
UserDao
public UserDao()
-
-
Method Details
-
getDefaultRights
-
getNewUserInstance
Get a new instance of theUser
entity, with all default values set- Parameters:
currentUser
- - the user to copy time zone from- Returns:
- new User instance
-
get
Description copied from interface:IDataProviderDao
Get a list of instances ofIDataProviderDao
- Specified by:
get
in interfaceIDataProviderDao<User>
- Parameters:
first
- - the start to range to retrievecount
- - maximum instance count to retrieve- Returns:
- list of instances in the range specified
-
get
-
get
-
adminGet
public List<User> adminGet(String search, long start, long count, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort) Description copied from interface:IGroupAdminDataProviderDao
Get a list of instances ofIGroupAdminDataProviderDao
- Specified by:
adminGet
in interfaceIGroupAdminDataProviderDao<User>
- Parameters:
search
- - string search criteria to filter entitiesstart
- - the start to range to retrievecount
- - maximum instance count to retrievesort
- - column and sort order- Returns:
- list of instances in the range specified
-
adminGet
public List<User> adminGet(String search, Long adminId, long start, long count, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort) Description copied from interface:IGroupAdminDataProviderDao
Get a list of instances ofIGroupAdminDataProviderDao
- Specified by:
adminGet
in interfaceIGroupAdminDataProviderDao<User>
- Parameters:
search
- - string search criteria to filter entitiesadminId
- - id of group admin userstart
- - the start to range to retrievecount
- - maximum instance count to retrievesort
- - column and sort order- Returns:
- list of instances in the range specified
-
searchUserProfile
-
count
public long count()Description copied from interface:IDataProviderDao
Count the number of instances ofIDataProviderDao
- Specified by:
count
in interfaceIDataProviderDao<User>
- Returns:
- count of instances
-
count
Description copied from interface:IDataProviderDao
Count the number of instances ofIDataProviderDao
- Specified by:
count
in interfaceIDataProviderDao<User>
- Parameters:
search
- - string search criteria to filter entities- Returns:
- count of instances satisfying given search criteria
-
countUsers
-
count
-
adminCount
Description copied from interface:IGroupAdminDataProviderDao
Count the number of instances ofIGroupAdminDataProviderDao
- Specified by:
adminCount
in interfaceIGroupAdminDataProviderDao<User>
- Parameters:
search
- - string search criteria to filter entities- Returns:
- count of instances satisfying given search criteria
-
adminCount
Description copied from interface:IGroupAdminDataProviderDao
Count the number of instances ofIGroupAdminDataProviderDao
- Specified by:
adminCount
in interfaceIGroupAdminDataProviderDao<User>
- Parameters:
search
- - string search criteria to filter entitiesadminId
- - id of group admin user- Returns:
- count of instances satisfying given search criteria
-
searchCountUserProfile
-
update
Description copied from interface:IDataProviderDao
Update an instance ofIDataProviderDao
- Specified by:
update
in interfaceIDataProviderDao<User>
- Parameters:
u
- - entity to be updateduserId
- - user performed update- Returns:
- - updated entity
-
resetPassword
- Throws:
NoSuchAlgorithmException
-
update
- Throws:
NoSuchAlgorithmException
-
get
Description copied from interface:IDataProviderDao
Get an instance of anIDataProviderDao
- Specified by:
get
in interfaceIDataProviderDao<User>
- Parameters:
id
- - id of instance to retrieve- Returns:
- instance with the id gived
-
delete
Description copied from interface:IDataProviderDao
Delete an instance ofIDataProviderDao
- Specified by:
delete
in interfaceIDataProviderDao<User>
- Parameters:
u
- - entity to be deleteduserId
- - user performed delete
-
purge
-
get
-
getAllUsers
-
getAllBackupUsers
-
checkLogin
check for duplicates- Parameters:
login
- - login to checktype
- - userUser.Type
to checkdomainId
- - domain to checkid
- - id of current user to allow self update- Returns:
true
in case login is allowed
-
checkEmail
Checks if a mail is already taken by someone else- Parameters:
email
- - email to checktype
- - userUser.Type
to checkdomainId
- - domain to checkid
- - id of current user to allow self update- Returns:
true
in case email is allowed
-
validLogin
-
getByLogin
-
getByEmail
-
getByEmail
-
getUserByHash
-
selectMaxFromUsersWithSearch
- Parameters:
search
- - term to search- Returns:
- - number of matching user
-
verifyPassword
Returns true if the password is correct- Parameters:
userId
- - id of the user to checkpassword
- - password to check- Returns:
true
if entered password is correct
-
getContact
-
getContact
-
getContact
-
getContact
-
getContact
-
getByActivationHash
- Parameters:
hash
- - activation hash- Returns:
- user with this hash
-
getExternalUser
-
get
public List<User> get(String search, long start, long count, org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sort) Description copied from interface:IDataProviderDao
Get a list of instances ofIDataProviderDao
- Specified by:
get
in interfaceIDataProviderDao<User>
- Parameters:
search
- - string search criteria to filter entitiesstart
- - the start to range to retrievecount
- - maximum instance count to retrievesort
- - column and sort order- Returns:
- list of instances in the range specified
-
getRights
-
login
login logic- Parameters:
userOrEmail
- - login or email of the user being testeduserpass
- - password of the user being tested- Returns:
- User object in case of successful login
- Throws:
OmException
- in case of any issue
-
getByExpiredHash
-