Interface UserAccountManager
- 
@Service public interface UserAccountManagerCentral service to managerUserAccountinstances.- Author:
 - Paul Henke, Oliver Gierke
 
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidchangePassword(UserAccount userAccount, Password.UnencryptedPassword password)Changes the password of theUserAccount.booleancontains(UserAccountIdentifier userAccountIdentifier)Checks if anUserAccountexists.UserAccountcreate(String userName, Password.UnencryptedPassword password, String emailAddress, Role... roles)Creates a newUserAccountand persists it right away.UserAccountcreate(String userName, Password.UnencryptedPassword password, Role... roles)Creates a newUserAccountand persists it right away.UserAccountdelete(UserAccount account)Deletes the givenUserAccount.voiddisable(UserAccountIdentifier userAccountIdentifier)Disables theUserAccount.voidenable(UserAccountIdentifier userAccountIdentifier)Enables theUserAccount.org.springframework.data.util.Streamable<UserAccount>findAll()Finds allUserAccounts.Optional<UserAccount>findByUsername(String username)Returns the user with the given user name.org.springframework.data.util.Streamable<UserAccount>findDisabled()Finds only disabledUserAccounts.org.springframework.data.util.Streamable<UserAccount>findEnabled()Finds only enabledUserAccounts.Optional<UserAccount>get(UserAccountIdentifier userAccountIdentifier)Returns anUserAccountfor a given identifier.UserAccountsave(UserAccount userAccount)Saves theUserAccount 
 - 
 
- 
- 
Method Detail
- 
create
UserAccount create(String userName, Password.UnencryptedPassword password, Role... roles)
Creates a newUserAccountand persists it right away.- Parameters:
 userName- the unique name of the user, the name is also used as login name.password- the passwordroles- zero or more roles- Returns:
 - a 
UserAccount, will never be null. 
 
- 
create
UserAccount create(String userName, Password.UnencryptedPassword password, String emailAddress, Role... roles)
Creates a newUserAccountand persists it right away.- Parameters:
 userName- the unique name of the user, the name is also used as login name.password- the passwordemailAddress- the email address to be usedroles- zero or more roles- Returns:
 - a 
UserAccount, will never be null. - Since:
 - 7.1
 
 
- 
get
Optional<UserAccount> get(UserAccountIdentifier userAccountIdentifier)
Returns anUserAccountfor a given identifier.- Parameters:
 userAccountIdentifier-- Returns:
 - will never be null.
 
 
- 
save
UserAccount save(UserAccount userAccount)
Saves theUserAccount- Parameters:
 userAccount-- Returns:
 - will never be null.
 
 
- 
enable
void enable(UserAccountIdentifier userAccountIdentifier)
Enables theUserAccount.- Parameters:
 userAccountIdentifier-
 
- 
disable
void disable(UserAccountIdentifier userAccountIdentifier)
Disables theUserAccount.- Parameters:
 userAccountIdentifier-
 
- 
changePassword
void changePassword(UserAccount userAccount, Password.UnencryptedPassword password)
Changes the password of theUserAccount.- Parameters:
 userAccount-password- must not be null.
 
- 
contains
boolean contains(UserAccountIdentifier userAccountIdentifier)
Checks if anUserAccountexists.- Parameters:
 userAccountIdentifier-- Returns:
 
 
- 
findAll
org.springframework.data.util.Streamable<UserAccount> findAll()
Finds allUserAccounts.- Returns:
 
 
- 
findEnabled
org.springframework.data.util.Streamable<UserAccount> findEnabled()
Finds only enabledUserAccounts.- Returns:
 
 
- 
findDisabled
org.springframework.data.util.Streamable<UserAccount> findDisabled()
Finds only disabledUserAccounts.- Returns:
 
 
- 
findByUsername
Optional<UserAccount> findByUsername(String username)
Returns the user with the given user name.- Parameters:
 username- must not be null or empty.- Returns:
 
 
- 
delete
UserAccount delete(UserAccount account)
Deletes the givenUserAccount. Note, that other aggregates that keep references to aUserAccounthave to be deleted before aUserAccountcan be deleted in the first place.- Parameters:
 account- must not be null.- Returns:
 - the deleted 
UserAccount - Since:
 - 7.1
 
 
 - 
 
 -