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)
    • assignToDatasets

      void assignToDatasets(String login, List<String> datasetNames) throws UserServiceException
      Assigns a user to multiple datasets.
      Parameters:
      login - the login identifier of the user
      datasetNames - the list of dataset names to assign the user to
      Throws:
      UserServiceException - if an error occurs during assignment
    • unassignFromDatasets

      void unassignFromDatasets(String login, List<String> datasetNames) throws UserServiceException
      Unassigns a user from multiple datasets.
      Parameters:
      login - the login identifier of the user
      datasetNames - the list of dataset names to remove the user from
      Throws:
      UserServiceException - if an error occurs during unassignment
    • getUserDatasets

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

      default List<Dataset> getUserDatasets(String login, boolean isActive) throws UserServiceException
      Retrieves a list of datasets 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 Dataset 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

      List<CheckedOutDocument> getUserCheckedOutDocuments(String login)
      Retrieves a list of documents currently checked out by a user.
      Parameters:
      login - the login identifier of the user
      Returns:
      the list of CheckedOutDocument
      Throws:
      UserServiceException - if an error occurs while retrieving documents