Interface UserServiceLocal


public interface UserServiceLocal
Local service interface for managing users, their roles, datasets, and access rights.

This interface defines methods for user management operations, including user retrieval, creation, updates, and assignment to roles and datasets.

  • Method Details

    • createUserQuery

      UserQuery createUserQuery()
      Creates a new UserQuery for querying user information.
      Returns:
      a new UserQuery instance
    • getUserByLogin

      Optional<User> getUserByLogin(String login)
      Retrieves a User by their login identifier.
      Parameters:
      login - the login identifier of the user
      Returns:
      an Optional containing the User if found, or an empty Optional if not
      Throws:
      UserServiceException - if an error occurs during retrieval
    • create

      UserId create(User user) throws UserServiceException
      Creates a new User.
      Parameters:
      user - the user entity to create
      Throws:
      UserServiceException - if an error occurs during creation (e.g., duplicate username, validation failure)
    • update

      void update(User user) throws UserServiceException
      Updates an existing User.
      Parameters:
      user - the user entity to update
      Throws:
      UserServiceException - if an error occurs during the update (e.g., user not found, validation failure)
    • update

      void update(List<User> users) throws UserServiceException
      Updates a list of users.
      Parameters:
      users - the list of users to update
      Throws:
      UserServiceException - if an error occurs during the update process
    • deleteByLogin

      void deleteByLogin(String login) throws UserServiceException
      Deletes a user by their login identifier.
      Parameters:
      login - the login identifier of the user to delete
      Throws:
      UserServiceException - if an error occurs during deletion (e.g., user not found, integrity constraints)
    • assignToProjects

      void assignToProjects(String login, List<String> projectNames) throws UserServiceException
      Assigns a user to multiple projects.
      Parameters:
      login - the login identifier of the user
      projectNames - the list of project names to assign the user to
      Throws:
      UserServiceException - if an error occurs during assignment
    • unassignFromProjects

      void unassignFromProjects(String login, List<String> projectNames) throws UserServiceException
      Unassigns a user from multiple projects.
      Parameters:
      login - the login identifier of the user
      projectNames - the list of project names to remove the user from
      Throws:
      UserServiceException - if an error occurs during unassignment
    • getUserProjects

      default List<Project> getUserProjects(String login) throws UserServiceException
      Retrieves a list of projects assigned to a user. The list includes both active and inactive datasets.
      Parameters:
      login - the login identifier of the user
      Returns:
      the list of Project assigned to the user
      Throws:
      UserServiceException - if an error occurs during dataset retrieval
    • getUserProjects

      default List<Project> getUserProjects(String login, boolean isActive) throws UserServiceException
      Retrieves a list of projects assigned to a user.
      Parameters:
      login - the login identifier of the user
      isActive - the flag indicating whether the dataset is active
      Returns:
      the list of Project assigned to the user
      Throws:
      UserServiceException - if an error occurs during dataset retrieval
    • assignToRoles

      void assignToRoles(String login, List<String> roleNames) throws UserServiceException
      Assigns a user to multiple roles.
      Parameters:
      login - the login identifier of the user
      roleNames - the list of roles to assign to the user
      Throws:
      UserServiceException - if an error occurs during role assignment
    • unassignFromRoles

      void unassignFromRoles(String login, List<String> roleNames) throws UserServiceException
      Unassigns a user from multiple roles.
      Parameters:
      login - the login identifier of the user
      roleNames - the list of role names to remove from the user
      Throws:
      UserServiceException - if an error occurs during role unassignment
    • getUserCheckedOutDocuments

      Set<DocumentLocks> getUserCheckedOutDocuments(String login)
      Retrieves a set of documents currently checked out by a user and their locks.
      Parameters:
      login - the login identifier of the user
      Returns:
      the set of DocumentLocks
      Throws:
      UserServiceException - if an error occurs while retrieving documents
    • resetPassword

      void resetPassword(String login, String newPassword, boolean shouldChangePasswordAtNextLogin) throws UserServiceException
      Resets the password for a user with the given login.
      Parameters:
      login - the login identifier of the user
      newPassword - the new password to set
      shouldChangePasswordAtNextLogin - flat to force uset to change password at next login
      Throws:
      UserServiceException - if an error occurs while resetting the password
    • synchronizeUser

      void synchronizeUser(User remoteUser, Set<String> remoteRoles, Set<String> remoteTeams, String defaultProject, String defaultRole, String defaultTeam) throws UserServiceException
      Synchronizes the user's information with the remote system.
      Parameters:
      remoteUser - the user object containing updated information
      remoteRoles - the set of roles associated with the user
      remoteTeams - the set of teams associated with the user
      defaultProject - the default project assigned to the user
      defaultRole - the default role assigned to the user
      defaultTeam - the default team assigned to the user
      Throws:
      UserServiceException - if an error occurs during synchronization
    • synchronizeUser

      default void synchronizeUser(User remoteUser, Set<String> projects, Set<String> remoteRoles, Set<String> remoteTeams, String defaultProject, String defaultRole, String defaultTeam) throws UserServiceException
      Synchronizes the user's information with the remote system.
      Parameters:
      remoteUser - the user object containing updated information
      projects - the set of projects associated with the user
      remoteRoles - the set of roles associated with the user
      remoteTeams - the set of teams associated with the user
      defaultProject - the default project assigned to the user
      defaultRole - the default role assigned to the user
      defaultTeam - the default team assigned to the user
      Throws:
      UserServiceException - if an error occurs during synchronization
    • updateAvatar

      void updateAvatar(String login, String fileName, byte[] fileData) throws UserServiceException
      Updates the avatar image for the specified user.
      Parameters:
      login - the login identifier of the user
      fileName - the name of the avatar file
      fileData - the binary data of the avatar image
      Throws:
      UserServiceException - if an error occurs while updating the avatar
    • getUserAvatar

      Optional<String> getUserAvatar(String login) throws UserServiceException
      Retrieves the file name of the avatar associated with the user.
      Parameters:
      login - the login identifier of the user
      Returns:
      the name of the avatar file
      Throws:
      UserServiceException - if an error occurs while retrieving the avatar