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 TypeMethodDescriptionvoidassignToDatasets(String login, List<String> datasetNames) Assigns a user to multiple datasets.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.getUserDatasets(String login) Retrieves a list of datasets assigned to a user.getUserDatasets(String login, boolean isActive) Retrieves a list of datasets assigned to a user.voidunassignFromDatasets(String login, List<String> datasetNames) Unassigns a user from multiple datasets.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)
-
assignToDatasets
Assigns a user to multiple datasets.- Parameters:
login- the login identifier of the userdatasetNames- the list of dataset names to assign the user to- Throws:
UserServiceException- if an error occurs during assignment
-
unassignFromDatasets
Unassigns a user from multiple datasets.- Parameters:
login- the login identifier of the userdatasetNames- the list of dataset names to remove the user from- Throws:
UserServiceException- if an error occurs during unassignment
-
getUserDatasets
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
Datasetassigned to the user - Throws:
UserServiceException- if an error occurs during dataset retrieval
-
getUserDatasets
Retrieves a list of datasets assigned to a user.- Parameters:
login- the login identifier of the userisActive- the flag indicating whether the dataset is active- Returns:
- the list of
Datasetassigned 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
-