Package org.bremersee.dccon.api
Interface DomainUserManagementApi
-
@Validated public interface DomainUserManagementApiThe domain user management api.- Author:
- Christian Bremer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<DomainUser>addUser(Boolean email, org.bremersee.common.model.TwoLetterLanguageCode language, @Valid DomainUser domainUser)Add a domain user.org.springframework.http.ResponseEntity<Boolean>deleteUser(String userName)Delete domain user.org.springframework.http.ResponseEntity<DomainUser>getUser(String userName)Get domain user.org.springframework.http.ResponseEntity<byte[]>getUserAvatar(String userName, AvatarDefault avatarDefault, Integer size)Get avatar of domain user.org.springframework.http.ResponseEntity<List<DomainUser>>getUsers(String sort, String query)Get domain users.org.springframework.http.ResponseEntity<Boolean>isUserNameInUse(String userName)Checks whether a user name is in use or not.org.springframework.http.ResponseEntity<Void>removeUserAvatar(String userName)Remove user avatar response entity.org.springframework.http.ResponseEntity<DomainUser>updateUser(String userName, Boolean updateGroups, @Valid DomainUser domainUser)Update domain user.org.springframework.http.ResponseEntity<Void>updateUserAvatar(String userName, org.springframework.web.multipart.MultipartFile avatar)Update user avatar response entity.org.springframework.http.ResponseEntity<Void>updateUserPassword(String userName, Boolean email, org.bremersee.common.model.TwoLetterLanguageCode language, @Valid Password newPassword)Update user password.org.springframework.http.ResponseEntity<Boolean>userExists(String userName)Checks whether a domain user exists.
-
-
-
Method Detail
-
getUsers
@RequestMapping(value="/api/users", produces="application/json", method=GET) org.springframework.http.ResponseEntity<List<DomainUser>> getUsers(@RequestParam(value="sort",defaultValue="userName") String sort, @RequestParam(name="q",required=false) String query)Get domain users.- Parameters:
sort- the sortquery- the query- Returns:
- the domain users
-
addUser
@RequestMapping(value="/api/users", produces="application/json", consumes="application/json", method=POST) org.springframework.http.ResponseEntity<DomainUser> addUser(@RequestParam(name="email",defaultValue="false") Boolean email, @RequestParam(name="lang",defaultValue="en") org.bremersee.common.model.TwoLetterLanguageCode language, @Valid @RequestBody @Valid DomainUser domainUser)Add a domain user.- Parameters:
email- specifies whether to send an email or not (default isfalse)language- the language of the emaildomainUser- the domain user to add- Returns:
- the added domain user
-
getUser
@RequestMapping(value="/api/users/{userName}", produces="application/json", method=GET) org.springframework.http.ResponseEntity<DomainUser> getUser(@PathVariable("userName") String userName)Get domain user.- Parameters:
userName- the user name- Returns:
- the domain user
-
getUserAvatar
@RequestMapping(value="/api/users/{userName}/avatar", produces="image/jpeg", method=GET) org.springframework.http.ResponseEntity<byte[]> getUserAvatar(@PathVariable("userName") String userName, @RequestParam(name="d",defaultValue="NOT_FOUND") AvatarDefault avatarDefault, @RequestParam(name="s",defaultValue="80") Integer size)Get avatar of domain user.- Parameters:
userName- the user nameavatarDefault- the default avatarsize- the size- Returns:
- the avatar of the domain user
-
updateUser
@RequestMapping(value="/api/users/{userName}", produces="application/json", consumes="application/json", method=PUT) org.springframework.http.ResponseEntity<DomainUser> updateUser(@PathVariable("userName") String userName, @RequestParam(name="updateGroups",defaultValue="false") Boolean updateGroups, @Valid @RequestBody @Valid DomainUser domainUser)Update domain user.- Parameters:
userName- the user nameupdateGroups- the update groups flag (default is false)domainUser- the domain user- Returns:
- the updated domain user
-
updateUserPassword
@RequestMapping(value="/api/users/{userName}/password", produces="application/json", consumes="application/json", method=PUT) org.springframework.http.ResponseEntity<Void> updateUserPassword(@PathVariable("userName") String userName, @RequestParam(name="email",defaultValue="false") Boolean email, @RequestParam(name="lang",defaultValue="en") org.bremersee.common.model.TwoLetterLanguageCode language, @Valid @RequestBody @Valid Password newPassword)Update user password.- Parameters:
userName- the user nameemail- specifies whether to send an email or not (default isfalse)language- the language of the emailnewPassword- the new password- Returns:
- void response entity
-
updateUserAvatar
@RequestMapping(value="/api/users/{userName}/avatar", consumes="multipart/form-data", method=POST) org.springframework.http.ResponseEntity<Void> updateUserAvatar(@PathVariable("userName") String userName, @RequestParam("avatar") org.springframework.web.multipart.MultipartFile avatar)Update user avatar response entity.- Parameters:
userName- the user nameavatar- the avatar- Returns:
- the response entity
-
removeUserAvatar
@RequestMapping(value="/api/users/{userName}/avatar", method=DELETE) org.springframework.http.ResponseEntity<Void> removeUserAvatar(@PathVariable("userName") String userName)Remove user avatar response entity.- Parameters:
userName- the user name- Returns:
- the response entity
-
userExists
@RequestMapping(value="/api/users/{userName}/exists", produces="application/json", method=GET) org.springframework.http.ResponseEntity<Boolean> userExists(@PathVariable("userName") String userName)Checks whether a domain user exists.- Parameters:
userName- the user name- Returns:
- true if the user exists otherwise false
-
isUserNameInUse
@RequestMapping(value="/api/users/{userName}/in-use", produces="application/json", method=GET) org.springframework.http.ResponseEntity<Boolean> isUserNameInUse(@PathVariable("userName") String userName)Checks whether a user name is in use or not.- Parameters:
userName- the user name- Returns:
- true if the user name is in use otherwise false
-
deleteUser
@RequestMapping(value="/api/users/{userName}", produces="application/json", method=DELETE) org.springframework.http.ResponseEntity<Boolean> deleteUser(@PathVariable("userName") String userName)Delete domain user.- Parameters:
userName- the user name- Returns:
trueif the domain user was deleted, otherwisefalse
-
-