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.getUserByLogin(String login) Retrieves aUserby their login identifier.getUserCheckedOutDocuments(String login) Retrieves a list of documents currently checked out by a user.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.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.
-
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 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
-