Package com.priint.pubserverapi.user
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 Summary
Modifier and TypeMethodDescriptionvoidassignToProjects(String login, List<String> projectNames) Assigns a user to multiple projects.voidassignToRoles(String login, List<String> roleNames) Assigns a user to multiple roles.Creates a newUser.Creates a newUserQueryfor querying user information.voiddeleteByLogin(String login) Deletes a user by their login identifier.getUserAvatar(String login) Retrieves the file name of the avatar associated with the user.getUserByLogin(String login) Retrieves aUserby their login identifier.getUserCheckedOutDocuments(String login) Retrieves a set of documents currently checked out by a user and their locks.getUserProjects(String login) Retrieves a list of projects assigned to a user.getUserProjects(String login, boolean isActive) Retrieves a list of projects assigned to a user.voidresetPassword(String login, String newPassword, boolean shouldChangePasswordAtNextLogin) Resets the password for a user with the given login.voidsynchronizeUser(User remoteUser, Set<String> remoteRoles, Set<String> remoteTeams, String defaultProject, String defaultRole, String defaultTeam) Synchronizes the user's information with the remote system.default voidsynchronizeUser(User remoteUser, Set<String> projects, Set<String> remoteRoles, Set<String> remoteTeams, String defaultProject, String defaultRole, String defaultTeam) Synchronizes the user's information with the remote system.voidunassignFromProjects(String login, List<String> projectNames) Unassigns a user from multiple projects.voidunassignFromRoles(String login, List<String> roleNames) Unassigns a user from multiple roles.voidUpdates an existingUser.voidUpdates a list of users.voidupdateAvatar(String login, String fileName, byte[] fileData) Updates the avatar image for the specified user.
-
Method Details
-
createUserQuery
UserQuery createUserQuery()Creates a newUserQueryfor querying user information.- Returns:
- a new
UserQueryinstance
-
getUserByLogin
Retrieves aUserby their login identifier.- Parameters:
login- the login identifier of the user- Returns:
- an
Optionalcontaining theUserif found, or an emptyOptionalif not - Throws:
UserServiceException- if an error occurs during retrieval
-
create
Creates a newUser.- Parameters:
user- the user entity to create- Throws:
UserServiceException- if an error occurs during creation (e.g., duplicate username, validation failure)
-
update
Updates an existingUser.- Parameters:
user- the user entity to update- Throws:
UserServiceException- if an error occurs during the update (e.g., user not found, validation failure)
-
update
Updates a list of users.- Parameters:
users- the list of users to update- Throws:
UserServiceException- if an error occurs during the update process
-
deleteByLogin
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
Assigns a user to multiple projects.- Parameters:
login- the login identifier of the userprojectNames- the list of project names to assign the user to- Throws:
UserServiceException- if an error occurs during assignment
-
unassignFromProjects
Unassigns a user from multiple projects.- Parameters:
login- the login identifier of the userprojectNames- the list of project names to remove the user from- Throws:
UserServiceException- if an error occurs during unassignment
-
getUserProjects
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
Projectassigned to the user - Throws:
UserServiceException- if an error occurs during dataset retrieval
-
getUserProjects
Retrieves a list of projects assigned to a user.- Parameters:
login- the login identifier of the userisActive- the flag indicating whether the dataset is active- Returns:
- the list of
Projectassigned to the user - Throws:
UserServiceException- if an error occurs during dataset retrieval
-
assignToRoles
Assigns a user to multiple roles.- Parameters:
login- the login identifier of the userroleNames- the list of roles to assign to the user- Throws:
UserServiceException- if an error occurs during role assignment
-
unassignFromRoles
Unassigns a user from multiple roles.- Parameters:
login- the login identifier of the userroleNames- the list of role names to remove from the user- Throws:
UserServiceException- if an error occurs during role unassignment
-
getUserCheckedOutDocuments
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 usernewPassword- the new password to setshouldChangePasswordAtNextLogin- 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 informationremoteRoles- the set of roles associated with the userremoteTeams- the set of teams associated with the userdefaultProject- the default project assigned to the userdefaultRole- the default role assigned to the userdefaultTeam- 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 informationprojects- the set of projects associated with the userremoteRoles- the set of roles associated with the userremoteTeams- the set of teams associated with the userdefaultProject- the default project assigned to the userdefaultRole- the default role assigned to the userdefaultTeam- the default team assigned to the user- Throws:
UserServiceException- if an error occurs during synchronization
-
updateAvatar
Updates the avatar image for the specified user.- Parameters:
login- the login identifier of the userfileName- the name of the avatar filefileData- the binary data of the avatar image- Throws:
UserServiceException- if an error occurs while updating the avatar
-
getUserAvatar
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
-