public class UserManagementRestResource extends Object implements UserManagementResource
UserManagementRestResource.| Constructor and Description |
|---|
UserManagementRestResource() |
| Modifier and Type | Method and Description |
|---|---|
de.alpharogroup.user.domain.User |
addUserContact(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,de.alpharogroup.user.domain.User> saveModel)
Adds the given contact
User object to the contacts of the given User object. |
de.alpharogroup.user.management.domain.UserData |
deleteAddress(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.address.book.domain.Address,de.alpharogroup.user.management.domain.UserData> deleteModel)
Deletes the given
Address object from the given UserData object. |
de.alpharogroup.user.management.domain.UserData |
deleteBlacklisted(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,Integer> deleteModel)
Deletes the given black listed
User object from the given user data id. |
void |
deleteResource(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.resource.system.application.model.ResourcesModel,Integer> deleteModel)
Deletes the
Resource object from the given resource model object with the given user
data id. |
boolean |
existsUserWithEmail(de.alpharogroup.user.management.domain.Contactmethod emailContact)
Checks if a user exists with the given email.
|
boolean |
existsUserWithEmail(String email)
Checks if a user exists with the given email.
|
de.alpharogroup.auth.enums.InsertUserState |
existsUserWithEmailOrUsername(de.alpharogroup.collections.pairs.KeyValuePair<String,String> searchModel)
Checks if a user exists with the given email or user name.
|
boolean |
existsUserWithEmailOrUsername(String emailOrUsername)
Checks if a user exists with the given email or user name.
|
boolean |
existsUserWithUsername(String username)
Checks if a user exists with the given user name.
|
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<de.alpharogroup.user.management.domain.Contactmethod> |
findAllEmailContactmethodsFromUser(de.alpharogroup.user.domain.User user)
Find all email contacts from the given
User. |
List<de.alpharogroup.user.management.domain.Contactmethod> |
findAllFaxContactmethodsFromUser(de.alpharogroup.user.domain.User user)
Find all fax contacts from the given
User. |
List<de.alpharogroup.user.management.domain.Contactmethod> |
findAllInternetContactmethodsFromUser(de.alpharogroup.user.domain.User user)
Find all internet contacts from the given
User. |
List<de.alpharogroup.user.management.domain.Contactmethod> |
findAllMobileContactmethodsFromUser(de.alpharogroup.user.domain.User user)
Find all mobile contacts from user.
|
List<de.alpharogroup.user.management.domain.Contactmethod> |
findAllTelefonContactmethodsFromUser(de.alpharogroup.user.domain.User user)
Find all telefon contacts from the given
User. |
de.alpharogroup.user.management.domain.Contactmethod |
findEmailContactFromUser(de.alpharogroup.user.domain.User user)
Find email contact from the given
User. |
de.alpharogroup.user.management.domain.Contactmethod |
findFaxContactFromUser(de.alpharogroup.user.domain.User user)
Find fax contact from the given
User. |
de.alpharogroup.user.management.domain.Contactmethod |
findInternetContactFromUser(de.alpharogroup.user.domain.User user)
Find internet contact from the given
User. |
de.alpharogroup.user.management.domain.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. |
de.alpharogroup.user.management.domain.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. |
boolean |
isInRole(de.alpharogroup.collections.pairs.KeyValuePair<String,List<de.alpharogroup.user.domain.Role>> roleSearchModel)
Checks if a
Role object exist in the given list with the given role name. |
boolean |
isUserInRole(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,String> userSearchModel)
Checks if the given
User object is in the given role from the given role name. |
de.alpharogroup.resource.system.domain.Resource |
persistResource(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.resource.system.application.model.ResourcesModel,Integer> saveModel)
Persist the given resource model object with the given user id.
|
void |
saveAddressesFromUser(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,Collection<de.alpharogroup.address.book.domain.Address>> userSaveModel)
Persist the given collection of
Address objects from the given User object. |
void |
saveAddressFromUser(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,de.alpharogroup.address.book.domain.Address> userSaveModel)
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. |
de.alpharogroup.user.management.domain.Contactmethod |
saveUserWithContactmethod(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,de.alpharogroup.user.management.domain.Contactmethod> userSaveModel)
Persist the given
Contactmethod object to the given User object contacts. |
List<de.alpharogroup.user.management.domain.Contactmethod> |
saveUserWithContactmethods(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,List<de.alpharogroup.user.management.domain.Contactmethod>> userSaveModel)
Persist the given list of
Contactmethod objects to the given User object
contacts. |
void |
saveUserWithRoles(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,Collection<de.alpharogroup.user.domain.Role>> userSaveModel)
Persist the given
User object with the given collection of Role objects. |
de.alpharogroup.user.management.domain.Contactmethod |
setEmail(de.alpharogroup.collections.pairs.KeyValuePair<String,de.alpharogroup.user.domain.User> userSaveModel)
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(de.alpharogroup.collections.pairs.KeyValuePair<String,de.alpharogroup.user.domain.User> userSaveModel)
Sets a new user name to the the given
User object. |
de.alpharogroup.user.management.sign.up.SignUpUserResult |
signUpUser(de.alpharogroup.collections.pairs.Triple<de.alpharogroup.auth.models.UsernameSignUpModel,Set<de.alpharogroup.user.domain.Role>,de.alpharogroup.user.management.sign.up.UserModel> saveModel)
Sign up process for insert a new user in the database.
|
de.alpharogroup.user.management.domain.Contactmethod |
updateContactmethod(de.alpharogroup.collections.pairs.Triple<String,de.alpharogroup.user.management.enums.ContactmethodType,de.alpharogroup.user.management.domain.Contactmethod> updateModel)
Update an existing
Contactmethod object. |
boolean |
updateUsername(de.alpharogroup.collections.pairs.KeyValuePair<String,de.alpharogroup.user.domain.User> updateModel)
Update user name from the given
User object if the user name has changed. |
boolean |
userIsInRole(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,de.alpharogroup.user.domain.Role> searchModel)
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.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,de.alpharogroup.user.domain.User> saveModel)
UserManagementResourceUser object to the contacts of the given User object.addUserContact in interface UserManagementResourcesaveModel - the KeyValuePair object that encapsulate the user and the contactUser object with the new contacts.public de.alpharogroup.user.management.domain.UserData deleteAddress(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.address.book.domain.Address,de.alpharogroup.user.management.domain.UserData> deleteModel)
UserManagementResourceAddress object from the given UserData object.deleteAddress in interface UserManagementResourcedeleteModel - the KeyValuePair object that encapsulate the Address object and
the UserData objectUserData object.public de.alpharogroup.user.management.domain.UserData deleteBlacklisted(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,Integer> deleteModel)
UserManagementResourceUser object from the given user data id.deleteBlacklisted in interface UserManagementResourcedeleteModel - the KeyValuePair object that encapsulate the black listed user and the
user data idUserData object.public void deleteResource(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.resource.system.application.model.ResourcesModel,Integer> deleteModel)
UserManagementResourceResource object from the given resource model object with the given user
data id.deleteResource in interface UserManagementResourcedeleteModel - the KeyValuePair object that encapsulate the resource and the user data idpublic boolean existsUserWithEmail(de.alpharogroup.user.management.domain.Contactmethod emailContact)
UserManagementResourceexistsUserWithEmail in interface UserManagementResourceemailContact - the email contactpublic boolean existsUserWithEmail(String email)
UserManagementResourceexistsUserWithEmail in interface UserManagementResourceemail - the emailpublic de.alpharogroup.auth.enums.InsertUserState existsUserWithEmailOrUsername(de.alpharogroup.collections.pairs.KeyValuePair<String,String> searchModel)
UserManagementResourceexistsUserWithEmailOrUsername in interface UserManagementResourcesearchModel - the KeyValuePair object that encapsulate the email and the user nameInsertUserState object.public boolean existsUserWithEmailOrUsername(String emailOrUsername)
UserManagementResourceexistsUserWithEmailOrUsername in interface UserManagementResourceemailOrUsername - the email or user namepublic boolean existsUserWithUsername(String username)
UserManagementResourceexistsUserWithUsername in interface UserManagementResourceusername - the user namepublic List<de.alpharogroup.address.book.domain.Address> findAddessesFromUser(de.alpharogroup.user.domain.User user)
UserManagementResourceAddress from the given User.findAddessesFromUser in interface UserManagementResourceuser - the userAddress from the given User.public de.alpharogroup.address.book.domain.Address findAddressFromUser(de.alpharogroup.user.domain.User user)
UserManagementResourceAddress from the given User.findAddressFromUser in interface UserManagementResourceuser - the userAddress from the given User.public List<de.alpharogroup.user.management.domain.Contactmethod> findAllEmailContactmethodsFromUser(de.alpharogroup.user.domain.User user)
UserManagementResourceUser.findAllEmailContactmethodsFromUser in interface UserManagementResourceuser - the userContactmethod from the given User.public List<de.alpharogroup.user.management.domain.Contactmethod> findAllFaxContactmethodsFromUser(de.alpharogroup.user.domain.User user)
UserManagementResourceUser.findAllFaxContactmethodsFromUser in interface UserManagementResourceuser - the userContactmethod from the given User.public List<de.alpharogroup.user.management.domain.Contactmethod> findAllInternetContactmethodsFromUser(de.alpharogroup.user.domain.User user)
UserManagementResourceUser.findAllInternetContactmethodsFromUser in interface UserManagementResourceuser - the userContactmethod from the given User.public List<de.alpharogroup.user.management.domain.Contactmethod> findAllMobileContactmethodsFromUser(de.alpharogroup.user.domain.User user)
UserManagementResourcefindAllMobileContactmethodsFromUser in interface UserManagementResourceuser - the userContactmethod from the given User.public List<de.alpharogroup.user.management.domain.Contactmethod> findAllTelefonContactmethodsFromUser(de.alpharogroup.user.domain.User user)
UserManagementResourceUser.findAllTelefonContactmethodsFromUser in interface UserManagementResourceuser - the userContactmethod from the given User.public de.alpharogroup.user.management.domain.Contactmethod findEmailContactFromUser(de.alpharogroup.user.domain.User user)
UserManagementResourceUser.findEmailContactFromUser in interface UserManagementResourceuser - the userContactmethod from the given User.public de.alpharogroup.user.management.domain.Contactmethod findFaxContactFromUser(de.alpharogroup.user.domain.User user)
UserManagementResourceUser.findFaxContactFromUser in interface UserManagementResourceuser - the userContactmethod from the given User.public de.alpharogroup.user.management.domain.Contactmethod findInternetContactFromUser(de.alpharogroup.user.domain.User user)
UserManagementResourceUser.findInternetContactFromUser in interface UserManagementResourceuser - the userContactmethod from the given User.public de.alpharogroup.user.management.domain.Contactmethod findMobileContactFromUser(de.alpharogroup.user.domain.User user)
UserManagementResourceUser.findMobileContactFromUser in interface UserManagementResourceuser - the userContactmethod from the given User.public List<de.alpharogroup.user.domain.Role> findRolesFromUser(de.alpharogroup.user.domain.User user)
UserManagementResourceUser.findRolesFromUser in interface UserManagementResourceuser - the userRole from the given User.public de.alpharogroup.user.management.domain.Contactmethod findTelefonContactFromUser(de.alpharogroup.user.domain.User user)
UserManagementResourceUser.findTelefonContactFromUser in interface UserManagementResourceuser - the userContactmethod from the given User.public de.alpharogroup.user.domain.User findUserWithEmail(String email)
UserManagementResourceUser object with the given email.findUserWithEmail in interface UserManagementResourceemail - the emailUser objectpublic de.alpharogroup.user.domain.User findUserWithEmailOrUsername(String emailOrUsername)
UserManagementResourceUser object from the given email or user name.findUserWithEmailOrUsername in interface UserManagementResourceemailOrUsername - the email or user nameUser objectpublic de.alpharogroup.user.domain.User findUserWithUsername(String username)
UserManagementResourceUser object from the given user name.findUserWithUsername in interface UserManagementResourceusername - the user nameUser objectpublic boolean isInRole(de.alpharogroup.collections.pairs.KeyValuePair<String,List<de.alpharogroup.user.domain.Role>> roleSearchModel)
UserManagementResourceRole object exist in the given list with the given role name.isInRole in interface UserManagementResourceroleSearchModel - the KeyValuePair object that encapsulate the role name and rolesRole object exist in the list otherwise false.public boolean isUserInRole(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,String> userSearchModel)
UserManagementResourceUser object is in the given role from the given role name.isUserInRole in interface UserManagementResourceuserSearchModel - the KeyValuePair object that encapsulate the user and the role nameUser object is in role otherwise false.public de.alpharogroup.resource.system.domain.Resource persistResource(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.resource.system.application.model.ResourcesModel,Integer> saveModel)
UserManagementResourcepersistResource in interface UserManagementResourcesaveModel - the KeyValuePair object that encapsulate the ResourcesModel object
and the user id.Resource objectpublic void saveAddressesFromUser(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,Collection<de.alpharogroup.address.book.domain.Address>> userSaveModel)
UserManagementResourceAddress objects from the given User object.saveAddressesFromUser in interface UserManagementResourceuserSaveModel - the KeyValuePair object that encapsulate the user and the addressespublic void saveAddressFromUser(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,de.alpharogroup.address.book.domain.Address> userSaveModel)
UserManagementResourceAddress object from the given User object.saveAddressFromUser in interface UserManagementResourceuserSaveModel - the KeyValuePair object that encapsulate the user and the addresspublic Serializable saveNewUser(de.alpharogroup.user.domain.User user) throws de.alpharogroup.auth.exceptions.UserAlreadyExistsException
UserManagementResourceUser object.saveNewUser in interface UserManagementResourceuser - 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
UserManagementResourceUser object without checking the user name.saveUserOnlyWithEmail in interface UserManagementResourceuser - The User object to persist.User object.de.alpharogroup.auth.exceptions.UserAlreadyExistsException - Thrown if the given User object already exists in the database.public de.alpharogroup.user.management.domain.Contactmethod saveUserWithContactmethod(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,de.alpharogroup.user.management.domain.Contactmethod> userSaveModel)
throws BatchUpdateException
UserManagementResourceContactmethod object to the given User object contacts.saveUserWithContactmethod in interface UserManagementResourceuserSaveModel - the KeyValuePair object that encapsulate the user and the contact to saveContactmethod object.BatchUpdateException - is thrown if a batch update occuredpublic List<de.alpharogroup.user.management.domain.Contactmethod> saveUserWithContactmethods(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,List<de.alpharogroup.user.management.domain.Contactmethod>> userSaveModel) throws BatchUpdateException
UserManagementResourceContactmethod objects to the given User object
contacts.saveUserWithContactmethods in interface UserManagementResourceuserSaveModel - the KeyValuePair object that encapsulate the user and the contacts to saveContactmethod objects.BatchUpdateException - is thrown if a batch update occuredpublic void saveUserWithRoles(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,Collection<de.alpharogroup.user.domain.Role>> userSaveModel)
UserManagementResourceUser object with the given collection of Role objects.saveUserWithRoles in interface UserManagementResourceuserSaveModel - the KeyValuePair object that encapsulate the user and the roles to savepublic de.alpharogroup.user.management.domain.Contactmethod setEmail(de.alpharogroup.collections.pairs.KeyValuePair<String,de.alpharogroup.user.domain.User> userSaveModel) throws de.alpharogroup.auth.exceptions.EmailAlreadyExistsException
UserManagementResourceUser 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 UserManagementResourceuserSaveModel - the KeyValuePair object that encapsulate the email and the userContactmethod objectde.alpharogroup.auth.exceptions.EmailAlreadyExistsException - is thrown if the email already exists.public boolean setUsername(de.alpharogroup.collections.pairs.KeyValuePair<String,de.alpharogroup.user.domain.User> userSaveModel) throws de.alpharogroup.auth.exceptions.UserAlreadyExistsException
UserManagementResourceUser object.setUsername in interface UserManagementResourceuserSaveModel - the KeyValuePair object that encapsulate the user name and the user to setde.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.collections.pairs.Triple<de.alpharogroup.auth.models.UsernameSignUpModel,Set<de.alpharogroup.user.domain.Role>,de.alpharogroup.user.management.sign.up.UserModel> saveModel)
UserManagementResourcesignUpUser in interface UserManagementResourcesaveModel - the Triple object that encapsulate the UsernameSignUpModel object,
the roles and the UserModel object.SignUpUserResult object with the result of the sign up processpublic de.alpharogroup.user.management.domain.Contactmethod updateContactmethod(de.alpharogroup.collections.pairs.Triple<String,de.alpharogroup.user.management.enums.ContactmethodType,de.alpharogroup.user.management.domain.Contactmethod> updateModel)
UserManagementResourceContactmethod object. If the contact method has changed the new
Contactmethod object will be returned or null if nothing changed.updateContactmethod in interface UserManagementResourceupdateModel - the Triple object that encapsulate the contact method value and type and
the contact method to update.Contactmethod objectpublic boolean updateUsername(de.alpharogroup.collections.pairs.KeyValuePair<String,de.alpharogroup.user.domain.User> updateModel) throws de.alpharogroup.auth.exceptions.UserAlreadyExistsException
UserManagementResourceUser object if the user name has changed. Returns
true if the user name has changed otherwise false.updateUsername in interface UserManagementResourceupdateModel - the KeyValuePair object that encapsulate the user name and the userde.alpharogroup.auth.exceptions.UserAlreadyExistsException - is thrown if the user already exists with the given user name.public boolean userIsInRole(de.alpharogroup.collections.pairs.KeyValuePair<de.alpharogroup.user.domain.User,de.alpharogroup.user.domain.Role> searchModel)
UserManagementResourceUser object is in the given Role object.userIsInRole in interface UserManagementResourcesearchModel - the KeyValuePair object that encapsulate the user and the rolepublic de.alpharogroup.auth.models.ValidationErrors validate(de.alpharogroup.auth.models.UsernameSignUpModel model)
UserManagementResourceUsernameSignUpModel object.validate in interface UserManagementResourcemodel - 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.