Interface UserService

All Superinterfaces:
org.ameba.integration.FindOperations<User,Long>, org.ameba.integration.SaveOperations<User,Long>
All Known Implementing Classes:
UserServiceImpl

public interface UserService extends org.ameba.integration.FindOperations<User,Long>, org.ameba.integration.SaveOperations<User,Long>
An UserService offers functionality according to the handling with Users.
Author:
Heiko Scherrer
  • Method Details

    • save

      @NotNull @NotNull User save(@NotNull(groups=Modify.class) @Valid @NotNull(groups=Modify.class) @Valid User user, List<String> roleNames)
      Save or update an already existing User.
      Parameters:
      user - The instance to save
      roleNames - A list of Role names to assign the User to
      Returns:
      The saved instance
    • uploadImageFile

      void uploadImageFile(@NotBlank @NotBlank String pKey, @NotNull @jakarta.validation.constraints.NotNull byte[] image)
      Attach and save an image to an User with id.
      Parameters:
      pKey - The persistent key of the User
      image - Image to be stored
    • createSystemUser

      @NotNull @NotNull SystemUser createSystemUser()
      Create and return the SystemUser without persisting this user.
      Returns:
      the SystemUser instance
    • create

      @NotNull @NotNull User create(@NotNull(groups=Create.class) @Valid @NotNull(groups=Create.class) @Valid User user, List<String> roleNames)
      Create a non-existing User.
      Parameters:
      user - The User instance to create
      roleNames - A list of Role names to assign the User to
      Returns:
      The created instance
    • findByUsername

      @NotNull @NotNull Optional<User> findByUsername(@NotBlank @NotBlank String username)
      Find and return an User instance.
      Parameters:
      username - The unique name of the User to search for
      Returns:
      The instance
    • findByPKey

      @NotNull @NotNull User findByPKey(@NotBlank @NotBlank String pKey)
      Find and return an User instance.
      Parameters:
      pKey - The persistent identifier of the User to search for
      Returns:
      The instance
    • delete

      void delete(@NotBlank @NotBlank String pKey)
      Delete an User.
      Parameters:
      pKey - The identifiable persistent key
    • updatePassword

      @NotNull @NotNull UserVO updatePassword(@NotBlank @NotBlank String pKey, @NotNull @NotNull CharSequence newPassword) throws InvalidPasswordException
      Update the password of the User.
      Parameters:
      pKey - The identifiable persistent key
      newPassword - The new password
      Returns:
      The updated instance
      Throws:
      InvalidPasswordException