Interface DomainUserManagementApi


  • @Validated
    public interface DomainUserManagementApi
    The domain user management api.
    Author:
    Christian Bremer
    • 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 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<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 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<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 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<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 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 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