@Transactional @Service(value="userManagementDomainService") public class UserManagementDomainService extends Object implements UserManagementService
UserManagementDomainService.| Constructor and Description |
|---|
UserManagementDomainService() |
| Modifier and Type | Method and Description |
|---|---|
de.alpharogroup.user.domain.User |
addUserContact(de.alpharogroup.user.domain.User user,
de.alpharogroup.user.domain.User contact)
Adds the given contact
User object to the contacts of the given User object. |
UserData |
deleteAddress(de.alpharogroup.address.book.domain.Address address,
UserData ud)
Deletes the given
Address object from the given UserData object. |
UserData |
deleteBlacklisted(de.alpharogroup.user.domain.User blacklisted,
Integer userDataId)
Deletes the given black listed
User object from the given user data id. |
void |
deleteResource(de.alpharogroup.resource.system.application.model.ResourcesModel resource,
Integer userDataId)
Deletes the
Resource object from the given resource model object with the given user
data id. |
boolean |
existsUserWithEmail(Contactmethod emailContact)
Checks if a user exists with the given email.
|
boolean |
existsUserWithEmail(String email) |
boolean |
existsUserWithEmailOrUsername(String emailOrUsername)
Checks if a user exists with the given email or user name.
|
de.alpharogroup.auth.enums.InsertUserState |
existsUserWithEmailOrUsername(String email,
String username) |
boolean |
existsUserWithUsername(String username) |
List<de.alpharogroup.address.book.domain.Address> |
findAddessesFromUser(de.alpharogroup.user.domain.User user)
Find all
Address from the given User. |
de.alpharogroup.address.book.domain.Address |
findAddressFromUser(de.alpharogroup.user.domain.User user)
Find the main
Address from the given User. |
List<Contactmethod> |
findAllEmailContactmethodsFromUser(de.alpharogroup.user.domain.User user)
Find all email contacts from the given
User. |
List<Contactmethod> |
findAllFaxContactmethodsFromUser(de.alpharogroup.user.domain.User user)
Find all fax contacts from the given
User. |
List<Contactmethod> |
findAllInternetContactmethodsFromUser(de.alpharogroup.user.domain.User user)
Find all internet contacts from the given
User. |
List<Contactmethod> |
findAllMobileContactmethodsFromUser(de.alpharogroup.user.domain.User user)
Find all mobile contacts from user.
|
List<Contactmethod> |
findAllTelefonContactmethodsFromUser(de.alpharogroup.user.domain.User user)
Find all telefon contacts from the given
User. |
Contactmethod |
findEmailContactFromUser(de.alpharogroup.user.domain.User user)
Find email contact from the given
User. |
Contactmethod |
findFaxContactFromUser(de.alpharogroup.user.domain.User user)
Find fax contact from the given
User. |
Contactmethod |
findInternetContactFromUser(de.alpharogroup.user.domain.User user)
Find internet contact from the given
User. |
Contactmethod |
findMobileContactFromUser(de.alpharogroup.user.domain.User user)
Find mobile contact from the given
User. |
List<de.alpharogroup.user.domain.Role> |
findRolesFromUser(de.alpharogroup.user.domain.User user)
Find roles from the given
User. |
Contactmethod |
findTelefonContactFromUser(de.alpharogroup.user.domain.User user)
Find telefon contact from the given
User. |
de.alpharogroup.user.domain.User |
findUserWithEmail(String email)
Find the
User object with the given email. |
de.alpharogroup.user.domain.User |
findUserWithEmailOrUsername(String emailOrUsername)
Find
User object from the given email or user name. |
de.alpharogroup.user.domain.User |
findUserWithUsername(String username)
Find
User object from the given user name. |
org.dozer.Mapper |
getMapper() |
boolean |
isInRole(String rolename,
List<de.alpharogroup.user.domain.Role> roles)
Checks if a
Role object exist in the given list with the given role name. |
boolean |
isUserInRole(de.alpharogroup.user.domain.User user,
String rolename)
Checks if the given
User object is in the given role from the given role name. |
boolean |
isValid(String token)
Checks if the given token is valid.
|
String |
newAuthenticationToken(String username)
Factory method that creates a new authentication token from the given user name.
|
org.dozer.Mapper |
newMapper(List<String> mappingFiles)
Factory method for creating the new
Mapper for the mapping process with the given
mapping files list. |
de.alpharogroup.resource.system.domain.Resource |
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.domain.User user,
Collection<de.alpharogroup.address.book.domain.Address> addresses)
Persist the given collection of
Address objects from the given User object. |
void |
saveAddressFromUser(de.alpharogroup.user.domain.User user,
de.alpharogroup.address.book.domain.Address address)
Persist the given
Address object from the given User object. |
Serializable |
saveNewUser(de.alpharogroup.user.domain.User user)
Persist the given
User object. |
Serializable |
saveUserOnlyWithEmail(de.alpharogroup.user.domain.User user)
Persist the given
User object without checking the user name. |
Contactmethod |
saveUserWithContactmethod(de.alpharogroup.user.domain.User user,
Contactmethod contact)
Persist the given
Contactmethod object to the given User object contacts. |
List<Contactmethod> |
saveUserWithContactmethods(de.alpharogroup.user.domain.User user,
List<Contactmethod> contacts)
Persist the given list of
Contactmethod objects to the given User object
contacts. |
void |
saveUserWithRoles(de.alpharogroup.user.domain.User user,
Collection<de.alpharogroup.user.domain.Role> roles)
Persist the given
User object with the given collection of Role objects. |
Contactmethod |
setEmail(String email,
de.alpharogroup.user.domain.User user)
Update email from the given
User 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.domain.User user)
Sets a new user name to the the given
User object. |
de.alpharogroup.user.management.sign.up.SignUpUserResult |
signUpUser(de.alpharogroup.auth.models.UsernameSignUpModel model,
Set<de.alpharogroup.user.domain.Role> roles,
de.alpharogroup.user.management.sign.up.UserModel userModel)
Sign up process for insert a new user in the database.
|
Contactmethod |
updateContactmethod(String contactmethodValue,
de.alpharogroup.user.management.enums.ContactmethodType contactmethodType,
Contactmethod contactmethod)
Update an existing
Contactmethod object. |
boolean |
updateUsername(String username,
de.alpharogroup.user.domain.User user)
Update user name from the given
User object if the user name has changed. |
boolean |
userIsInRole(de.alpharogroup.user.domain.User user,
de.alpharogroup.user.domain.Role role)
Checks if the given
User object is in the given Role object. |
de.alpharogroup.auth.models.ValidationErrors |
validate(de.alpharogroup.auth.models.UsernameSignUpModel model)
Validate the given
UsernameSignUpModel object. |
public de.alpharogroup.user.domain.User addUserContact(de.alpharogroup.user.domain.User user,
de.alpharogroup.user.domain.User contact)
User object to the contacts of the given User object.addUserContact in interface UserManagementServiceuser - the usercontact - the contact to addUser object with the new contacts.public UserData deleteAddress(de.alpharogroup.address.book.domain.Address address, UserData ud)
Address object from the given UserData object.deleteAddress in interface UserManagementServiceaddress - the Address objectud - the UserData objectUserData object.public UserData deleteBlacklisted(de.alpharogroup.user.domain.User blacklisted, Integer userDataId)
User object from the given user data id.deleteBlacklisted in interface UserManagementServiceblacklisted - the black listed useruserDataId - the user data idUserData object.public void deleteResource(de.alpharogroup.resource.system.application.model.ResourcesModel resource,
Integer userDataId)
Resource object from the given resource model object with the given user
data id.deleteResource in interface UserManagementServiceresource - the resourceuserDataId - the user data idpublic boolean existsUserWithEmail(Contactmethod emailContact)
existsUserWithEmail in interface UserManagementServiceemailContact - the email contactpublic boolean existsUserWithEmail(String email)
existsUserWithEmail in interface de.alpharogroup.auth.usermanagement.UserExistenceServicepublic boolean existsUserWithEmailOrUsername(String emailOrUsername)
existsUserWithEmailOrUsername in interface de.alpharogroup.auth.usermanagement.UserExistenceServiceexistsUserWithEmailOrUsername in interface UserManagementServiceemailOrUsername - the email or user namepublic 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.domain.Address> findAddessesFromUser(de.alpharogroup.user.domain.User user)
Address from the given User.findAddessesFromUser in interface UserManagementServiceuser - the userAddress from the given User.public de.alpharogroup.address.book.domain.Address findAddressFromUser(de.alpharogroup.user.domain.User user)
Address from the given User.findAddressFromUser in interface UserManagementServiceuser - the userAddress from the given User.public List<Contactmethod> findAllEmailContactmethodsFromUser(de.alpharogroup.user.domain.User user)
User.findAllEmailContactmethodsFromUser in interface UserManagementServiceuser - the userContactmethod from the given User.public List<Contactmethod> findAllFaxContactmethodsFromUser(de.alpharogroup.user.domain.User user)
User.findAllFaxContactmethodsFromUser in interface UserManagementServiceuser - the userContactmethod from the given User.public List<Contactmethod> findAllInternetContactmethodsFromUser(de.alpharogroup.user.domain.User user)
User.findAllInternetContactmethodsFromUser in interface UserManagementServiceuser - the userContactmethod from the given User.public List<Contactmethod> findAllMobileContactmethodsFromUser(de.alpharogroup.user.domain.User user)
findAllMobileContactmethodsFromUser in interface UserManagementServiceuser - the userContactmethod from the given User.public List<Contactmethod> findAllTelefonContactmethodsFromUser(de.alpharogroup.user.domain.User user)
User.findAllTelefonContactmethodsFromUser in interface UserManagementServiceuser - the userContactmethod from the given User.public Contactmethod findEmailContactFromUser(de.alpharogroup.user.domain.User user)
User.findEmailContactFromUser in interface UserManagementServiceuser - the userContactmethod from the given User.public Contactmethod findFaxContactFromUser(de.alpharogroup.user.domain.User user)
User.findFaxContactFromUser in interface UserManagementServiceuser - the userContactmethod from the given User.public Contactmethod findInternetContactFromUser(de.alpharogroup.user.domain.User user)
User.findInternetContactFromUser in interface UserManagementServiceuser - the userContactmethod from the given User.public Contactmethod findMobileContactFromUser(de.alpharogroup.user.domain.User user)
User.findMobileContactFromUser in interface UserManagementServiceuser - the userContactmethod from the given User.public List<de.alpharogroup.user.domain.Role> findRolesFromUser(de.alpharogroup.user.domain.User user)
User.findRolesFromUser in interface UserManagementServiceuser - the userRole from the given User.public Contactmethod findTelefonContactFromUser(de.alpharogroup.user.domain.User user)
User.findTelefonContactFromUser in interface UserManagementServiceuser - the userContactmethod from the given User.public de.alpharogroup.user.domain.User findUserWithEmail(String email)
User object with the given email.findUserWithEmail in interface UserManagementServiceemail - the emailUser objectpublic de.alpharogroup.user.domain.User findUserWithEmailOrUsername(String emailOrUsername)
User object from the given email or user name.findUserWithEmailOrUsername in interface UserManagementServiceemailOrUsername - the email or user nameUser objectpublic de.alpharogroup.user.domain.User findUserWithUsername(String username)
User object from the given user name.findUserWithUsername in interface UserManagementServiceusername - the user nameUser objectpublic org.dozer.Mapper getMapper()
public boolean isInRole(String rolename, List<de.alpharogroup.user.domain.Role> roles)
Role object exist in the given list with the given role name.isInRole in interface UserManagementServicerolename - the role nameroles - the rolesRole object exist in the list otherwise false.public boolean isUserInRole(de.alpharogroup.user.domain.User user,
String rolename)
User object is in the given role from the given role name.isUserInRole in interface UserManagementServiceuser - the userrolename - the role nameUser object is in role otherwise false.public boolean isValid(String token)
isValid in interface UserManagementServicetoken - the token to validatepublic String newAuthenticationToken(String username)
newAuthenticationToken in interface UserManagementServiceusername - the usernamepublic org.dozer.Mapper newMapper(List<String> mappingFiles)
Mapper for the mapping process with the given
mapping files list. This method is invoked in the constructor and can be overridden so users
can provide their own mapping process.mappingFiles - the mapping filesMapper for the mapping process.public de.alpharogroup.resource.system.domain.Resource persistResource(de.alpharogroup.resource.system.application.model.ResourcesModel resourceModel,
Integer userId)
persistResource in interface UserManagementServiceresourceModel - the resource modeluserId - the user idResource objectpublic void saveAddressesFromUser(de.alpharogroup.user.domain.User user,
Collection<de.alpharogroup.address.book.domain.Address> addresses)
Address objects from the given User object.saveAddressesFromUser in interface UserManagementServiceuser - the useraddresses - the addressespublic void saveAddressFromUser(de.alpharogroup.user.domain.User user,
de.alpharogroup.address.book.domain.Address address)
Address object from the given User object.saveAddressFromUser in interface UserManagementServiceuser - the useraddress - the addresspublic Serializable saveNewUser(de.alpharogroup.user.domain.User user) throws de.alpharogroup.auth.exceptions.UserAlreadyExistsException
User object.saveNewUser in interface UserManagementServiceuser - The User object to persist.User object.de.alpharogroup.auth.exceptions.UserAlreadyExistsException - Thrown if the given User object already exists in the database.public Serializable saveUserOnlyWithEmail(de.alpharogroup.user.domain.User user) throws de.alpharogroup.auth.exceptions.UserAlreadyExistsException
User object without checking the user name.saveUserOnlyWithEmail in interface UserManagementServiceuser - The User object to persist.User object.de.alpharogroup.auth.exceptions.UserAlreadyExistsException - Thrown if the given User object already exists in the database.public Contactmethod saveUserWithContactmethod(de.alpharogroup.user.domain.User user, Contactmethod contact) throws BatchUpdateException
Contactmethod object to the given User object contacts.saveUserWithContactmethod in interface UserManagementServiceuser - the usercontact - the contactContactmethod object.BatchUpdateException - the batch update exceptionpublic List<Contactmethod> saveUserWithContactmethods(de.alpharogroup.user.domain.User user, List<Contactmethod> contacts) throws BatchUpdateException
Contactmethod objects to the given User object
contacts.saveUserWithContactmethods in interface UserManagementServiceuser - the usercontacts - the contactsContactmethod objects.BatchUpdateException - the batch update exceptionpublic void saveUserWithRoles(de.alpharogroup.user.domain.User user,
Collection<de.alpharogroup.user.domain.Role> roles)
User object with the given collection of Role objects.saveUserWithRoles in interface UserManagementServiceuser - the userroles - the rolespublic Contactmethod setEmail(String email, de.alpharogroup.user.domain.User user) throws de.alpharogroup.auth.exceptions.EmailAlreadyExistsException
User 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 UserManagementServiceemail - the emailuser - the userContactmethod objectde.alpharogroup.auth.exceptions.EmailAlreadyExistsException - the email already exists exceptionpublic boolean setUsername(String username, de.alpharogroup.user.domain.User user) throws de.alpharogroup.auth.exceptions.UserAlreadyExistsException
User object.setUsername in interface UserManagementServiceusername - 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.sign.up.SignUpUserResult signUpUser(de.alpharogroup.auth.models.UsernameSignUpModel model,
Set<de.alpharogroup.user.domain.Role> roles,
de.alpharogroup.user.management.sign.up.UserModel userModel)
signUpUser in interface UserManagementServicemodel - the modelroles - the rolesuserModel - the user modelSignUpUserResult object with the result of the sign up processpublic Contactmethod updateContactmethod(String contactmethodValue, de.alpharogroup.user.management.enums.ContactmethodType contactmethodType, Contactmethod contactmethod)
Contactmethod object. If the contact method has changed the new
Contactmethod object will be returned or null if nothing changed.updateContactmethod in interface UserManagementServicecontactmethodValue - the contact method valuecontactmethodType - the contact method typecontactmethod - the contact methodContactmethod objectpublic boolean updateUsername(String username, de.alpharogroup.user.domain.User user) throws de.alpharogroup.auth.exceptions.UserAlreadyExistsException
User object if the user name has changed. Returns
true if the user name has changed otherwise false.updateUsername in interface UserManagementServiceusername - 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.domain.User user,
de.alpharogroup.user.domain.Role role)
User object is in the given Role object.userIsInRole in interface UserManagementServiceuser - the userrole - the rolepublic de.alpharogroup.auth.models.ValidationErrors validate(de.alpharogroup.auth.models.UsernameSignUpModel model)
UsernameSignUpModel object.validate in interface UserManagementServicemodel - the UsernameSignUpModel object.ValidationErrors object if validation fail otherwise null if the validation
is successful.Copyright © 2015–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.