@Transactional @Service(value="usersManagementService") public class UsersManagementBusinessService extends Object implements UsersManagementService
UsersManagementBusinessService.| Constructor and Description |
|---|
UsersManagementBusinessService() |
| Modifier and Type | Method and Description |
|---|---|
de.alpharogroup.user.management.entities.Users |
addUserContact(de.alpharogroup.user.management.entities.Users user,
de.alpharogroup.user.management.entities.Users contact)
Adds the given contact
Users object to the contacts of the given Users object. |
de.alpharogroup.user.management.entities.UserDatas |
deleteAddress(de.alpharogroup.address.book.entities.Addresses address,
de.alpharogroup.user.management.entities.UserDatas ud)
Deletes the given
Addresses object from the given UserDatas object. |
de.alpharogroup.user.management.entities.UserDatas |
deleteBlacklisted(de.alpharogroup.user.management.entities.Users blacklisted,
Integer userDataId)
Deletes the given black listed
Users object from the given user data id. |
void |
deleteResource(de.alpharogroup.resource.system.application.model.ResourcesModel resourceModel,
Integer userDataId)
Deletes the
Resources object from the given resource model
object with the given user data id. |
boolean |
existsUserWithEmail(de.alpharogroup.user.management.entities.Contactmethods emailContact)
Checks if a user exists with the given email.
|
boolean |
existsUserWithEmail(String email) |
boolean |
existsUserWithEmailOrUsername(String emailOrUsername) |
de.alpharogroup.auth.enums.InsertUserState |
existsUserWithEmailOrUsername(String email,
String username) |
boolean |
existsUserWithUsername(String username) |
List<de.alpharogroup.address.book.entities.Addresses> |
findAddessesFromUser(de.alpharogroup.user.management.entities.Users user)
Find all
Addresses from the given Users. |
de.alpharogroup.address.book.entities.Addresses |
findAddressFromUser(de.alpharogroup.user.management.entities.Users user)
Find the main
Addresses from the given Users. |
List<de.alpharogroup.user.management.entities.Contactmethods> |
findAllEmailContactmethodsFromUser(de.alpharogroup.user.management.entities.Users user)
Find all email contacts from the given
Users. |
List<de.alpharogroup.user.management.entities.Contactmethods> |
findAllFaxContactmethodsFromUser(de.alpharogroup.user.management.entities.Users user)
Find all fax contacts from the given
Users. |
List<de.alpharogroup.user.management.entities.Contactmethods> |
findAllInternetContactmethodsFromUser(de.alpharogroup.user.management.entities.Users user)
Find all internet contacts from the given
Users. |
List<de.alpharogroup.user.management.entities.Contactmethods> |
findAllMobileContactmethodsFromUser(de.alpharogroup.user.management.entities.Users user)
Find all mobile contacts from user.
|
List<de.alpharogroup.user.management.entities.Contactmethods> |
findAllTelefonContactmethodsFromUser(de.alpharogroup.user.management.entities.Users user)
Find all telefon contacts from the given
Users. |
de.alpharogroup.user.management.entities.Contactmethods |
findEmailContactFromUser(de.alpharogroup.user.management.entities.Users user)
Find email contact from the given
Users. |
de.alpharogroup.user.management.entities.Contactmethods |
findFaxContactFromUser(de.alpharogroup.user.management.entities.Users user)
Find fax contact from the given
Users. |
de.alpharogroup.user.management.entities.Contactmethods |
findInternetContactFromUser(de.alpharogroup.user.management.entities.Users user)
Find internet contact from the given
Users. |
de.alpharogroup.user.management.entities.Contactmethods |
findMobileContactFromUser(de.alpharogroup.user.management.entities.Users user)
Find mobile contact from the given
Users. |
List<de.alpharogroup.user.management.entities.Roles> |
findRolesFromUser(de.alpharogroup.user.management.entities.Users user)
Find roles from the given
Users. |
de.alpharogroup.user.management.entities.Contactmethods |
findTelefonContactFromUser(de.alpharogroup.user.management.entities.Users user)
Find telefon contact from the given
Users. |
de.alpharogroup.user.management.entities.Users |
findUserWithEmail(String email)
Find the
Users object with the given email. |
de.alpharogroup.user.management.entities.Users |
findUserWithEmailOrUsername(String emailOrUsername)
Find
Users object from the given email or user name. |
de.alpharogroup.user.management.entities.Users |
findUserWithUsername(String username)
Find
Users object from the given user name. |
boolean |
isInRole(String rolename,
List<de.alpharogroup.user.management.entities.Roles> roles)
Checks if a
Roles object exist in the given list with the given
role name. |
boolean |
isUserInRole(de.alpharogroup.user.management.entities.Users user,
String rolename)
Checks if the given
Users object is in the given role from the
given role name. |
de.alpharogroup.resource.system.entities.Resources |
persistResource(de.alpharogroup.resource.system.application.model.ResourcesModel resourceModel,
Integer userId)
Persist the given resource model object with the given user id.
|
void |
saveAddressesFromUser(de.alpharogroup.user.management.entities.Users user,
Collection<de.alpharogroup.address.book.entities.Addresses> addresses)
Persist the given collection of
Addresses objects from the given
Users object. |
void |
saveAddressFromUser(de.alpharogroup.user.management.entities.Users user,
de.alpharogroup.address.book.entities.Addresses address)
Persist the given
Addresses object from the given Users
object. |
Integer |
saveNewUser(de.alpharogroup.user.management.entities.Users user)
Persist the given
Users object. |
Integer |
saveUserOnlyWithEmail(de.alpharogroup.user.management.entities.Users user)
Persist the given
Users object without checking the user name. |
de.alpharogroup.user.management.entities.Contactmethods |
saveUserWithContactmethod(de.alpharogroup.user.management.entities.Users user,
de.alpharogroup.user.management.entities.Contactmethods contact)
Persist the given
Contactmethods object to the given
Users object contacts. |
List<de.alpharogroup.user.management.entities.Contactmethods> |
saveUserWithContactmethods(de.alpharogroup.user.management.entities.Users user,
List<de.alpharogroup.user.management.entities.Contactmethods> contacts)
Persist the given list of
Contactmethods objects to the given
Users object contacts. |
void |
saveUserWithRoles(de.alpharogroup.user.management.entities.Users user,
Collection<de.alpharogroup.user.management.entities.Roles> roles)
Persist the given
Users object with the given collection of
Roles objects. |
de.alpharogroup.user.management.entities.Contactmethods |
setEmail(String email,
de.alpharogroup.user.management.entities.Users user)
Update email from the given
Users object if the email has changed
and return the new contactMethod object or the contactMethod that is
persist in database. |
boolean |
setUsername(String username,
de.alpharogroup.user.management.entities.Users user)
Sets a new user name to the the given
Users object. |
SignUpUserResult |
signUpUser(de.alpharogroup.auth.models.UsernameSignUpModel model,
Set<de.alpharogroup.user.management.entities.Roles> roles,
UserModel userModel)
Sign up process for insert a new user in the database.
|
de.alpharogroup.user.management.entities.Contactmethods |
updateContactmethod(String contactmethodValue,
de.alpharogroup.user.management.enums.ContactmethodType contactmethodType,
de.alpharogroup.user.management.entities.Contactmethods contactmethod)
Update an existing
Contactmethods object. |
boolean |
updateUsername(String username,
de.alpharogroup.user.management.entities.Users user)
Update user name from the given
Users object if the user name has
changed. |
boolean |
userIsInRole(de.alpharogroup.user.management.entities.Users user,
de.alpharogroup.user.management.entities.Roles role)
Checks if the given
Users object is in the given Roles
object. |
de.alpharogroup.auth.models.ValidationErrors |
validate(de.alpharogroup.auth.models.UsernameSignUpModel model)
Validate the given
UsernameSignUpModel object. |
public boolean existsUserWithEmailOrUsername(String emailOrUsername)
existsUserWithEmailOrUsername in interface de.alpharogroup.auth.usermanagement.UserExistenceServicepublic boolean existsUserWithEmail(String email)
existsUserWithEmail in interface de.alpharogroup.auth.usermanagement.UserExistenceServicepublic boolean existsUserWithEmail(de.alpharogroup.user.management.entities.Contactmethods emailContact)
existsUserWithEmail in interface UsersManagementServiceemailContact - the email contactpublic de.alpharogroup.auth.enums.InsertUserState existsUserWithEmailOrUsername(String email, String username)
existsUserWithEmailOrUsername in interface de.alpharogroup.auth.usermanagement.UserExistenceServicepublic boolean existsUserWithUsername(String username)
existsUserWithUsername in interface de.alpharogroup.auth.usermanagement.UserExistenceServicepublic List<de.alpharogroup.address.book.entities.Addresses> findAddessesFromUser(de.alpharogroup.user.management.entities.Users user)
Addresses from the given Users.findAddessesFromUser in interface UsersManagementServiceuser - the userAddresses from the given Users.public de.alpharogroup.address.book.entities.Addresses findAddressFromUser(de.alpharogroup.user.management.entities.Users user)
Addresses from the given Users.findAddressFromUser in interface UsersManagementServiceuser - the userAddresses from the given Users.public List<de.alpharogroup.user.management.entities.Contactmethods> findAllEmailContactmethodsFromUser(de.alpharogroup.user.management.entities.Users user)
Users.findAllEmailContactmethodsFromUser in interface UsersManagementServiceuser - the userContactmethods from the given
Users.public List<de.alpharogroup.user.management.entities.Contactmethods> findAllFaxContactmethodsFromUser(de.alpharogroup.user.management.entities.Users user)
Users.findAllFaxContactmethodsFromUser in interface UsersManagementServiceuser - the userContactmethods from the given
Users.public List<de.alpharogroup.user.management.entities.Contactmethods> findAllInternetContactmethodsFromUser(de.alpharogroup.user.management.entities.Users user)
Users.findAllInternetContactmethodsFromUser in interface UsersManagementServiceuser - the userContactmethods from the given
Users.public List<de.alpharogroup.user.management.entities.Contactmethods> findAllMobileContactmethodsFromUser(de.alpharogroup.user.management.entities.Users user)
findAllMobileContactmethodsFromUser in interface UsersManagementServiceuser - the userContactmethods from the given
Users.public List<de.alpharogroup.user.management.entities.Contactmethods> findAllTelefonContactmethodsFromUser(de.alpharogroup.user.management.entities.Users user)
Users.findAllTelefonContactmethodsFromUser in interface UsersManagementServiceuser - the userContactmethods from the given
Users.public de.alpharogroup.user.management.entities.Contactmethods findEmailContactFromUser(de.alpharogroup.user.management.entities.Users user)
Users.findEmailContactFromUser in interface UsersManagementServiceuser - the userContactmethods from the given Users.public de.alpharogroup.user.management.entities.Contactmethods findFaxContactFromUser(de.alpharogroup.user.management.entities.Users user)
Users.findFaxContactFromUser in interface UsersManagementServiceuser - the userContactmethods from the given Users.public de.alpharogroup.user.management.entities.Contactmethods findInternetContactFromUser(de.alpharogroup.user.management.entities.Users user)
Users.findInternetContactFromUser in interface UsersManagementServiceuser - the userContactmethods from the given Users.public de.alpharogroup.user.management.entities.Contactmethods findMobileContactFromUser(de.alpharogroup.user.management.entities.Users user)
Users.findMobileContactFromUser in interface UsersManagementServiceuser - the userContactmethods from the given Users.public List<de.alpharogroup.user.management.entities.Roles> findRolesFromUser(de.alpharogroup.user.management.entities.Users user)
Users.findRolesFromUser in interface UsersManagementServiceuser - the userRoles from the given Users.public de.alpharogroup.user.management.entities.Contactmethods findTelefonContactFromUser(de.alpharogroup.user.management.entities.Users user)
Users.findTelefonContactFromUser in interface UsersManagementServiceuser - the userContactmethods from the given Users.public de.alpharogroup.user.management.entities.Users findUserWithEmail(String email)
Users object with the given email.findUserWithEmail in interface UsersManagementServiceemail - the emailUsers objectpublic de.alpharogroup.user.management.entities.Users findUserWithEmailOrUsername(String emailOrUsername)
Users object from the given email or user name.findUserWithEmailOrUsername in interface UsersManagementServiceemailOrUsername - the email or user nameUsers objectpublic de.alpharogroup.user.management.entities.Users findUserWithUsername(String username)
Users object from the given user name.findUserWithUsername in interface UsersManagementServiceusername - the user nameUsers objectpublic boolean isInRole(String rolename, List<de.alpharogroup.user.management.entities.Roles> roles)
Roles object exist in the given list with the given
role name.isInRole in interface UsersManagementServicerolename - the role nameroles - the rolesRoles object exist in the list otherwise
false.public boolean isUserInRole(de.alpharogroup.user.management.entities.Users user,
String rolename)
Users object is in the given role from the
given role name.isUserInRole in interface UsersManagementServiceuser - the userrolename - the role nameUsers object is in role otherwise
false.public void saveAddressesFromUser(de.alpharogroup.user.management.entities.Users user,
Collection<de.alpharogroup.address.book.entities.Addresses> addresses)
Addresses objects from the given
Users object.saveAddressesFromUser in interface UsersManagementServiceuser - the useraddresses - the addressespublic void saveAddressFromUser(de.alpharogroup.user.management.entities.Users user,
de.alpharogroup.address.book.entities.Addresses address)
Addresses object from the given Users
object.saveAddressFromUser in interface UsersManagementServiceuser - the useraddress - the addresspublic Integer saveNewUser(de.alpharogroup.user.management.entities.Users user) throws de.alpharogroup.auth.exceptions.UserAlreadyExistsException
Users object.saveNewUser in interface UsersManagementServiceuser - The Users object to persist.Users object.de.alpharogroup.auth.exceptions.UserAlreadyExistsException - Thrown if the given Users object already exists in
the database.public Integer saveUserOnlyWithEmail(de.alpharogroup.user.management.entities.Users user)
Users object without checking the user name.saveUserOnlyWithEmail in interface UsersManagementServiceuser - The Users object to persist.Users object.public de.alpharogroup.user.management.entities.Contactmethods saveUserWithContactmethod(de.alpharogroup.user.management.entities.Users user,
de.alpharogroup.user.management.entities.Contactmethods contact)
throws BatchUpdateException
Contactmethods object to the given
Users object contacts.saveUserWithContactmethod in interface UsersManagementServiceuser - the usercontact - the contactContactmethods object.BatchUpdateException - the batch update exceptionpublic List<de.alpharogroup.user.management.entities.Contactmethods> saveUserWithContactmethods(de.alpharogroup.user.management.entities.Users user, List<de.alpharogroup.user.management.entities.Contactmethods> contacts) throws BatchUpdateException
Contactmethods objects to the given
Users object contacts.saveUserWithContactmethods in interface UsersManagementServiceuser - the usercontacts - the contactsContactmethods objects.BatchUpdateException - the batch update exceptionpublic void saveUserWithRoles(de.alpharogroup.user.management.entities.Users user,
Collection<de.alpharogroup.user.management.entities.Roles> roles)
Users object with the given collection of
Roles objects.saveUserWithRoles in interface UsersManagementServiceuser - the userroles - the rolespublic de.alpharogroup.user.management.entities.Contactmethods setEmail(String email, de.alpharogroup.user.management.entities.Users user) throws de.alpharogroup.auth.exceptions.EmailAlreadyExistsException
Users object if the email has changed
and return the new contactMethod object or the contactMethod that is
persist in database. Consider to check if the email already exists before
you call this method otherwise an exception is thrown.setEmail in interface UsersManagementServiceemail - the emailuser - the userContactmethods objectde.alpharogroup.auth.exceptions.EmailAlreadyExistsException - the email already exists exceptionpublic boolean setUsername(String username, de.alpharogroup.user.management.entities.Users user) throws de.alpharogroup.auth.exceptions.UserAlreadyExistsException
Users object.setUsername in interface UsersManagementServiceusername - the usernameuser - the userde.alpharogroup.auth.exceptions.UserAlreadyExistsException - is thrown if the user already exists with the given user
name.public de.alpharogroup.user.management.entities.Contactmethods updateContactmethod(String contactmethodValue, de.alpharogroup.user.management.enums.ContactmethodType contactmethodType, de.alpharogroup.user.management.entities.Contactmethods contactmethod)
Contactmethods object. If the contact method
has changed the new Contactmethods object will be returned or
null if nothing changed.updateContactmethod in interface UsersManagementServicecontactmethodValue - the contact method valuecontactmethodType - the contact method typecontactmethod - the contact methodContactmethods objectpublic boolean updateUsername(String username, de.alpharogroup.user.management.entities.Users user) throws de.alpharogroup.auth.exceptions.UserAlreadyExistsException
Users object if the user name has
changed. Returns true if the user name has changed otherwise false.updateUsername in interface UsersManagementServiceusername - the user nameuser - the userde.alpharogroup.auth.exceptions.UserAlreadyExistsException - is thrown if the user already exists with the given user
name.public boolean userIsInRole(de.alpharogroup.user.management.entities.Users user,
de.alpharogroup.user.management.entities.Roles role)
Users object is in the given Roles
object.userIsInRole in interface UsersManagementServiceuser - the userrole - the rolepublic de.alpharogroup.auth.models.ValidationErrors validate(de.alpharogroup.auth.models.UsernameSignUpModel model)
UsernameSignUpModel object.validate in interface UsersManagementServicemodel - the UsernameSignUpModel object.ValidationErrors object if validation fail otherwise
null if the validation is successful.@Transactional(rollbackFor=java.lang.Exception.class) public SignUpUserResult signUpUser(de.alpharogroup.auth.models.UsernameSignUpModel model, Set<de.alpharogroup.user.management.entities.Roles> roles, UserModel userModel)
signUpUser in interface UsersManagementServicemodel - the modelroles - the rolesuserModel - the user modelSignUpUserResult object with the result of the sign
up processpublic de.alpharogroup.resource.system.entities.Resources persistResource(de.alpharogroup.resource.system.application.model.ResourcesModel resourceModel,
Integer userId)
persistResource in interface UsersManagementServiceresourceModel - the resource modeluserId - the user idResources objectpublic void deleteResource(de.alpharogroup.resource.system.application.model.ResourcesModel resourceModel,
Integer userDataId)
Resources object from the given resource model
object with the given user data id.deleteResource in interface UsersManagementServiceresourceModel - the resourceuserDataId - the user data idpublic de.alpharogroup.user.management.entities.UserDatas deleteBlacklisted(de.alpharogroup.user.management.entities.Users blacklisted,
Integer userDataId)
Users object from the given user data id.deleteBlacklisted in interface UsersManagementServiceblacklisted - the black listed useruserDataId - the user data idUserDatas object.public de.alpharogroup.user.management.entities.UserDatas deleteAddress(de.alpharogroup.address.book.entities.Addresses address,
de.alpharogroup.user.management.entities.UserDatas ud)
Addresses object from the given UserDatas object.deleteAddress in interface UsersManagementServiceaddress - the Addresses objectud - the UserDatas objectUserDatas object.public de.alpharogroup.user.management.entities.Users addUserContact(de.alpharogroup.user.management.entities.Users user,
de.alpharogroup.user.management.entities.Users contact)
Users object to the contacts of the given Users object.addUserContact in interface UsersManagementServiceuser - the usercontact - the contact to addUsers object with the new contacts.Copyright © 2015–2016 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.