Interface DomainUserManagementApi


  • @Validated
    public interface DomainUserManagementApi
    The domain user management api.
    Author:
    Christian Bremer
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      org.springframework.http.ResponseEntity<org.bremersee.dccon.model.DomainUser> addUser​(Boolean email, org.bremersee.common.model.TwoLetterLanguageCode language, @Valid org.bremersee.dccon.model.DomainUser domainUser)
      Add a domain user.
      org.springframework.http.ResponseEntity<Boolean> deleteUser​(String userName)
      Delete domain user.
      org.springframework.http.ResponseEntity<org.bremersee.dccon.model.DomainUser> getUser​(String userName)
      Get domain user.
      org.springframework.http.ResponseEntity<byte[]> getUserAvatar​(String userName, org.bremersee.dccon.model.AvatarDefault avatarDefault, Integer size)
      Get avatar of domain user.
      org.springframework.http.ResponseEntity<List<org.bremersee.dccon.model.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<org.bremersee.dccon.model.DomainUser> updateUser​(String userName, Boolean updateGroups, @Valid org.bremersee.dccon.model.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 org.bremersee.dccon.model.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<org.bremersee.dccon.model.DomainUser>> getUsers​(@RequestParam(value="sort",defaultValue="userName")
                                                                                                     String sort,
                                                                                                     @RequestParam(name="q",required=false)
                                                                                                     String query)
        Get domain users.
        Parameters:
        sort - the sort
        query - the query
        Returns:
        the domain users
      • addUser

        @RequestMapping(value="/api/users",
                        produces="application/json",
                        consumes="application/json",
                        method=POST)
        org.springframework.http.ResponseEntity<org.bremersee.dccon.model.DomainUser> addUser​(@RequestParam(name="email",defaultValue="false")
                                                                                              Boolean email,
                                                                                              @RequestParam(name="lang",defaultValue="en")
                                                                                              org.bremersee.common.model.TwoLetterLanguageCode language,
                                                                                              @Valid @RequestBody
                                                                                              @Valid org.bremersee.dccon.model.DomainUser domainUser)
        Add a domain user.
        Parameters:
        email - specifies whether to send an email or not (default is false)
        language - the language of the email
        domainUser - 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<org.bremersee.dccon.model.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")
                                                                      org.bremersee.dccon.model.AvatarDefault avatarDefault,
                                                                      @RequestParam(name="s",defaultValue="80")
                                                                      Integer size)
        Get avatar of domain user.
        Parameters:
        userName - the user name
        avatarDefault - the default avatar
        size - 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<org.bremersee.dccon.model.DomainUser> updateUser​(@PathVariable("userName")
                                                                                                 String userName,
                                                                                                 @RequestParam(name="updateGroups",defaultValue="false")
                                                                                                 Boolean updateGroups,
                                                                                                 @Valid @RequestBody
                                                                                                 @Valid org.bremersee.dccon.model.DomainUser domainUser)
        Update domain user.
        Parameters:
        userName - the user name
        updateGroups - 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 org.bremersee.dccon.model.Password newPassword)
        Update user password.
        Parameters:
        userName - the user name
        email - specifies whether to send an email or not (default is false)
        language - the language of the email
        newPassword - 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 name
        avatar - 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:
        true if the domain user was deleted, otherwise false