@Transactional public class UserDao extends Object implements IDataProviderDao<User>
User
Modifier and Type | Field and Description |
---|---|
static String[] |
searchFields |
Constructor and Description |
---|
UserDao() |
Modifier and Type | Method and Description |
---|---|
User |
addUser(Set<User.Right> rights,
String firstname,
String login,
String lastname,
long languageId,
String userpass,
Address adress,
boolean sendSMS,
Date age,
String hash,
TimeZone timezone,
Boolean forceTimeZoneCheck,
String userOffers,
String userSearchs,
Boolean showContactData,
Boolean showContactDataToContacts,
String externalId,
String externalType,
List<GroupUser> orgList,
String pictureuri) |
boolean |
checkEmail(String email,
User.Type type,
Long domainId,
Long id)
Checks if a mail is already taken by someone else
|
boolean |
checkLogin(String login,
User.Type type,
Long domainId,
Long id)
check for duplicates
|
long |
count()
Count the number of instances of
T |
long |
count(String search)
Count the number of instances of
T |
long |
count(String search,
boolean filterContacts,
long currentUserId) |
long |
count(String search,
long currentUserId) |
void |
delete(User u,
Long userId)
Delete an instance of
T |
List<User> |
get(Collection<Long> ids) |
List<User> |
get(int first,
int count)
Get a list of instances of
T |
User |
get(Long id)
Get an instance of an
T |
List<User> |
get(String search,
boolean excludeContacts,
int first,
int count) |
List<User> |
get(String search,
boolean filterContacts,
long currentUserId) |
List<User> |
get(String search,
int start,
int count,
String order)
Get a list of instances of
T |
List<User> |
get(String search,
int start,
int count,
String sort,
boolean filterContacts,
long currentUserId) |
Address |
getAddress(String street,
String zip,
String town,
long stateId,
String additionalname,
String fax,
String phone,
String email) |
List<User> |
getAllBackupUsers() |
List<User> |
getAllUsers() |
User |
getByEmail(String email) |
User |
getByEmail(String email,
User.Type type,
Long domainId) |
User |
getByLogin(String login,
User.Type type,
Long domainId) |
User |
getContact(String email,
long ownerId) |
User |
getContact(String email,
String firstName,
String lastName,
long ownerId) |
User |
getContact(String email,
String firstName,
String lastName,
Long langId,
String tzId,
long ownerId) |
User |
getContact(String email,
String firstName,
String lastName,
Long langId,
String tzId,
User owner) |
User |
getContact(String email,
User owner) |
static Set<User.Right> |
getDefaultRights() |
User |
getExternalUser(String extId,
String extType) |
User |
getNewUserInstance(User currentUser)
Get a new instance of the
User entity, with all default values
set |
Set<User.Right> |
getRights(Long id) |
User |
getUserByActivationHash(String hash) |
Object |
getUserByHash(String hash) |
User |
login(String userOrEmail,
String userpass)
login logic
|
Long |
searchCountUserProfile(long userId,
String text,
String offers,
String search) |
List<User> |
searchUserProfile(long userId,
String text,
String offers,
String search,
String orderBy,
int start,
int max,
boolean asc) |
Long |
selectMaxFromUsersWithSearch(String search) |
User |
update(User u,
Long userId)
Update an instance of
T |
User |
update(User user,
String password,
long updatedBy) |
boolean |
validLogin(String login) |
boolean |
verifyPassword(Long userId,
String password)
Returns true if the password is correct
|
public static final String[] searchFields
public static Set<User.Right> getDefaultRights()
public User getNewUserInstance(User currentUser)
User
entity, with all default values
setcurrentUser
- - the user to copy time zone frompublic List<User> get(int first, int count)
IDataProviderDao
T
get
in interface IDataProviderDao<User>
first
- - the start to range to retrievecount
- - maximum instance count to retrievepublic List<User> get(String search, int start, int count, String sort, boolean filterContacts, long currentUserId)
public long count()
IDataProviderDao
T
count
in interface IDataProviderDao<User>
public long count(String search)
IDataProviderDao
T
count
in interface IDataProviderDao<User>
search
- - string search criteria to filter entitiespublic long count(String search, long currentUserId)
public long count(String search, boolean filterContacts, long currentUserId)
public User update(User u, Long userId)
IDataProviderDao
T
update
in interface IDataProviderDao<User>
u
- - entity to be updateduserId
- - user performed updatepublic User update(User user, String password, long updatedBy) throws NoSuchAlgorithmException, UnsupportedEncodingException
public User get(Long id)
IDataProviderDao
T
get
in interface IDataProviderDao<User>
id
- - id of instance to retrievepublic void delete(User u, Long userId)
IDataProviderDao
T
delete
in interface IDataProviderDao<User>
u
- - entity to be deleteduserId
- - user performed deletepublic List<User> get(Collection<Long> ids)
public boolean checkLogin(String login, User.Type type, Long domainId, Long id)
login
- type
- domainId
- id
- public boolean checkEmail(String email, User.Type type, Long domainId, Long id)
email
- type
- domainId
- id
- public boolean validLogin(String login)
public Long selectMaxFromUsersWithSearch(String search)
search
- public boolean verifyPassword(Long userId, String password)
userId
- password
- public User getContact(String email, String firstName, String lastName, Long langId, String tzId, long ownerId)
public User getContact(String email, String firstName, String lastName, Long langId, String tzId, User owner)
public List<User> searchUserProfile(long userId, String text, String offers, String search, String orderBy, int start, int max, boolean asc)
public Long searchCountUserProfile(long userId, String text, String offers, String search)
public List<User> get(String search, int start, int count, String order)
IDataProviderDao
T
get
in interface IDataProviderDao<User>
search
- - string search criteria to filter entitiesstart
- - the start to range to retrievecount
- - maximum instance count to retrieveorder
- - column and sort orderpublic Set<User.Right> getRights(Long id)
public User login(String userOrEmail, String userpass) throws org.apache.openmeetings.util.OmException
userOrEmail:
- login or email of the user being testeduserpass:
- password of the user being testedorg.apache.openmeetings.util.OmException
- in case of any issuepublic Address getAddress(String street, String zip, String town, long stateId, String additionalname, String fax, String phone, String email)
public User addUser(Set<User.Right> rights, String firstname, String login, String lastname, long languageId, String userpass, Address adress, boolean sendSMS, Date age, String hash, TimeZone timezone, Boolean forceTimeZoneCheck, String userOffers, String userSearchs, Boolean showContactData, Boolean showContactDataToContacts, String externalId, String externalType, List<GroupUser> orgList, String pictureuri) throws NoSuchAlgorithmException, UnsupportedEncodingException
Copyright © 2012–2016 Apache Software Foundation. All rights reserved.