Package africa.absa.inception.security
Class SecurityService
- java.lang.Object
-
- africa.absa.inception.security.SecurityService
-
- All Implemented Interfaces:
ISecurityService,org.springframework.beans.factory.InitializingBean
@Service public class SecurityService extends Object implements ISecurityService, org.springframework.beans.factory.InitializingBean
The SecurityService class provides the Security Service implementation.- Author:
- Marcus Portmann
-
-
Field Summary
-
Fields inherited from interface africa.absa.inception.security.ISecurityService
ADMINISTRATOR_ROLE_CODE, ADMINISTRATOR_USERNAME, ADMINISTRATORS_GROUP_ID, ADMINISTRATORS_GROUP_NAME, DEFAULT_TENANT_ID, DEFAULT_USER_DIRECTORY_ID, INTERNAL_USER_DIRECTORY_TYPE, LDAP_USER_DIRECTORY_TYPE, PASSWORD_RESETTER_ROLE_CODE, TENANT_ADMINISTRATOR_ROLE_CODE
-
-
Constructor Summary
Constructors Constructor Description SecurityService(org.springframework.context.ApplicationContext applicationContext, javax.validation.Validator validator, IMailService mailService, FunctionRepository functionRepository, GroupRepository groupRepository, TenantRepository tenantRepository, PasswordResetRepository passwordResetRepository, RoleRepository roleRepository, UserDirectoryRepository userDirectoryRepository, UserDirectorySummaryRepository userDirectorySummaryRepository, UserDirectoryTypeRepository userDirectoryTypeRepository, UserRepository userRepository)Constructs a new SecurityService.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMemberToGroup(UUID userDirectoryId, String groupName, GroupMemberType memberType, String memberName)Add the group member to the group.voidaddRoleToGroup(UUID userDirectoryId, String groupName, String roleCode)Add the role to the group.voidaddUserDirectoryToTenant(UUID tenantId, UUID userDirectoryId)Add the user directory to the tenant.voidaddUserToGroup(UUID userDirectoryId, String groupName, String username)Add the user to the group.voidadminChangePassword(UUID userDirectoryId, String username, String newPassword, boolean expirePassword, boolean lockUser, boolean resetPasswordHistory, PasswordChangeReason reason)Administratively change the password for the user.voidafterPropertiesSet()UUIDauthenticate(String username, String password)Authenticate the user.UUIDchangePassword(String username, String password, String newPassword)Change the password for the user.voidcreateFunction(Function function)Create the new function.voidcreateGroup(Group group)Create the new group.Optional<UserDirectory>createTenant(Tenant tenant, boolean createUserDirectory)Create the new tenant.voidcreateUser(User user, boolean expiredPassword, boolean userLocked)Create the new user.voidcreateUserDirectory(UserDirectory userDirectory)Create the new user directory.voiddeleteFunction(String functionCode)Delete the function.voiddeleteGroup(UUID userDirectoryId, String groupName)Delete the group.voiddeleteTenant(UUID tenantId)Delete the tenant.voiddeleteUser(UUID userDirectoryId, String username)Delete the user.voiddeleteUserDirectory(UUID userDirectoryId)Delete the user directory.List<User>findUsers(UUID userDirectoryId, List<UserAttribute> userAttributes)Retrieve the users matching the user attribute criteria.FunctiongetFunction(String functionCode)Retrieve the function.List<String>getFunctionCodesForUser(UUID userDirectoryId, String username)Retrieve the function codes for the user.List<Function>getFunctions()Retrieve all the functions.GroupgetGroup(UUID userDirectoryId, String groupName)Retrieve the group.List<String>getGroupNames(UUID userDirectoryId)Retrieve all the group names.List<String>getGroupNamesForUser(UUID userDirectoryId, String username)Retrieve the names of the groups the user is a member of.List<Group>getGroups(UUID userDirectoryId)Retrieve all the groups.GroupsgetGroups(UUID userDirectoryId, String filter, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize)Retrieve the groups.List<Group>getGroupsForUser(UUID userDirectoryId, String username)Retrieve the groups the user is a member of.List<GroupMember>getMembersForGroup(UUID userDirectoryId, String groupName)Retrieve the group members for the group.GroupMembersgetMembersForGroup(UUID userDirectoryId, String groupName, String filter, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize)Retrieve the group members for the group.List<String>getRoleCodesForGroup(UUID userDirectoryId, String groupName)Retrieve the codes for the roles that have been assigned to the group.List<String>getRoleCodesForUser(UUID userDirectoryId, String username)Retrieve the codes for the roles that have been assigned to the user.List<Role>getRoles()Retrieve all the roles.List<GroupRole>getRolesForGroup(UUID userDirectoryId, String groupName)Retrieve the roles that have been assigned to the group.TenantgetTenant(UUID tenantId)Retrieve the tenant.List<UUID>getTenantIdsForUserDirectory(UUID userDirectoryId)Retrieve the Universally Unique Identifiers (UUIDs) for the tenants the user directory is associated with.StringgetTenantName(UUID tenantId)Retrieve the name of the tenant.List<Tenant>getTenants()Retrieve the tenants.TenantsgetTenants(String filter, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize)Retrieve the tenants.List<Tenant>getTenantsForUserDirectory(UUID userDirectoryId)Retrieve the tenants the user directory is associated with.UsergetUser(UUID userDirectoryId, String username)Retrieve the user.List<UserDirectory>getUserDirectories()Retrieve the user directories.UserDirectoriesgetUserDirectories(String filter, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize)Retrieve the user directories.List<UserDirectory>getUserDirectoriesForTenant(UUID tenantId)Retrieve the user directories the tenant is associated with.UserDirectorygetUserDirectory(UUID userDirectoryId)Retrieve the user directory.UserDirectoryCapabilitiesgetUserDirectoryCapabilities(UUID userDirectoryId)Retrieve the capabilities the user directory supports.Optional<UUID>getUserDirectoryIdForUser(String username)Retrieve the Universally Unique Identifier (UUID) for the user directory that the user with the specified username is associated with.List<UUID>getUserDirectoryIdsForTenant(UUID tenantId)Retrieve the Universally Unique Identifiers (UUIDs) for the user directories the tenant is associated with.List<UUID>getUserDirectoryIdsForUser(String username)Retrieve the Universally Unique Identifiers (UUIDs) for the user directories the user is associated with.StringgetUserDirectoryName(UUID userDirectoryId)Retrieve the name of the user directory.UserDirectorySummariesgetUserDirectorySummaries(String filter, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize)Retrieve the summaries for the user directories.List<UserDirectorySummary>getUserDirectorySummariesForTenant(UUID tenantId)Retrieve the summaries for the user directories the tenant is associated with.UserDirectoryTypegetUserDirectoryTypeForUserDirectory(UUID userDirectoryId)Retrieve the user directory type for the user directory.List<UserDirectoryType>getUserDirectoryTypes()Retrieve the user directory types.StringgetUserName(UUID userDirectoryId, String username)Retrieve the name of the user.List<User>getUsers(UUID userDirectoryId)Retrieve all the users.UsersgetUsers(UUID userDirectoryId, String filter, UserSortBy sortBy, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize)Retrieve the users.voidinitiatePasswordReset(String username, String resetPasswordUrl, boolean sendEmail)Initiate the password reset process for the user.voidinitiatePasswordReset(String username, String resetPasswordUrl, boolean sendEmail, String securityCode)Initiate the password reset process for the user.booleanisExistingUser(UUID userDirectoryId, String username)Does the user with the specified username exist?booleanisUserInGroup(UUID userDirectoryId, String groupName, String username)Is the user in the group?voidreloadUserDirectories()Reload the user directories.voidremoveMemberFromGroup(UUID userDirectoryId, String groupName, GroupMemberType memberType, String memberName)Remove the group member from the group.voidremoveRoleFromGroup(UUID userDirectoryId, String groupName, String roleCode)Remove the role from the group.voidremoveUserDirectoryFromTenant(UUID tenantId, UUID userDirectoryId)Remove the user directory from the tenant.voidremoveUserFromGroup(UUID userDirectoryId, String groupName, String username)Remove the user from the group.voidresetPassword(String username, String newPassword, String securityCode)Reset the password for the user.voidupdateFunction(Function function)Update the function.voidupdateGroup(Group group)Update the group.voidupdateTenant(Tenant tenant)Update the tenant.voidupdateUser(User user, boolean expirePassword, boolean lockUser)Update the user.voidupdateUserDirectory(UserDirectory userDirectory)Update the user directory.
-
-
-
Constructor Detail
-
SecurityService
public SecurityService(org.springframework.context.ApplicationContext applicationContext, javax.validation.Validator validator, IMailService mailService, FunctionRepository functionRepository, GroupRepository groupRepository, TenantRepository tenantRepository, PasswordResetRepository passwordResetRepository, RoleRepository roleRepository, UserDirectoryRepository userDirectoryRepository, UserDirectorySummaryRepository userDirectorySummaryRepository, UserDirectoryTypeRepository userDirectoryTypeRepository, UserRepository userRepository)Constructs a new SecurityService.- Parameters:
applicationContext- the Spring application contextvalidator- the JSR-303 validatormailService- the Mail ServicefunctionRepository- the Function RepositorygroupRepository- the Group RepositorytenantRepository- the Tenant RepositorypasswordResetRepository- the Password Reset RepositoryroleRepository- the Role RepositoryuserDirectoryRepository- the User Directory RepositoryuserDirectorySummaryRepository- the User Directory Summary RepositoryuserDirectoryTypeRepository- the User Directory Type RepositoryuserRepository- the User Repository
-
-
Method Detail
-
addMemberToGroup
@Transactional public void addMemberToGroup(UUID userDirectoryId, String groupName, GroupMemberType memberType, String memberName) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceAdd the group member to the group.- Specified by:
addMemberToGroupin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directorygroupName- the name of the groupmemberType- the group member typememberName- the group member name- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundGroupNotFoundException- if the group could not be foundUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the group member could not be added to the group
-
addRoleToGroup
@Transactional public void addRoleToGroup(UUID userDirectoryId, String groupName, String roleCode) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, RoleNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceAdd the role to the group.- Specified by:
addRoleToGroupin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directorygroupName- the name of the grouproleCode- the code for the role- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundGroupNotFoundException- if the group could not be foundRoleNotFoundException- if the role could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the role could not be added to the group
-
addUserDirectoryToTenant
@Transactional public void addUserDirectoryToTenant(UUID tenantId, UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceAdd the user directory to the tenant.- Specified by:
addUserDirectoryToTenantin interfaceISecurityService- Parameters:
tenantId- the Universally Unique Identifier (UUID) for the tenantuserDirectoryId- the Universally Unique Identifier (UUID) for the user directory- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidTenantNotFoundException- if the tenant could not be foundUserDirectoryNotFoundException- if the user directory could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user directory could not be added to the tenant
-
addUserToGroup
@Transactional public void addUserToGroup(UUID userDirectoryId, String groupName, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceAdd the user to the group.- Specified by:
addUserToGroupin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directorygroupName- the name of the groupusername- the username for the user- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundGroupNotFoundException- if the group could not be foundUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user could not be added to the group
-
adminChangePassword
@Transactional public void adminChangePassword(UUID userDirectoryId, String username, String newPassword, boolean expirePassword, boolean lockUser, boolean resetPasswordHistory, PasswordChangeReason reason) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceAdministratively change the password for the user.- Specified by:
adminChangePasswordin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directoryusername- the username for the usernewPassword- the new passwordexpirePassword- expire the user's passwordlockUser- lock the userresetPasswordHistory- reset the user's password historyreason- the reason for changing the password- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the password could not be administratively changed
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
authenticate
@Transactional public UUID authenticate(String username, String password) throws africa.absa.inception.core.service.InvalidArgumentException, AuthenticationFailedException, UserLockedException, ExpiredPasswordException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceAuthenticate the user.- Specified by:
authenticatein interfaceISecurityService- Parameters:
username- the username for the userpassword- the password being used to authenticate- Returns:
- the Universally Unique Identifier (UUID) for the user directory
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidAuthenticationFailedException- if the authentication failedUserLockedException- if the user is lockedExpiredPasswordException- if the password for the user has expiredUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user could not be authenticated
-
changePassword
@Transactional public UUID changePassword(String username, String password, String newPassword) throws africa.absa.inception.core.service.InvalidArgumentException, AuthenticationFailedException, UserLockedException, ExistingPasswordException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceChange the password for the user.- Specified by:
changePasswordin interfaceISecurityService- Parameters:
username- the username for the userpassword- the password for the user that is used to authorise the operationnewPassword- the new password- Returns:
- the Universally Unique Identifier (UUID) for the user directory
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidAuthenticationFailedException- if the authentication failedUserLockedException- if the user is lockedExistingPasswordException- if the user has previously used the new passwordafrica.absa.inception.core.service.ServiceUnavailableException- if the password could not be changed
-
createFunction
@Transactional public void createFunction(Function function) throws africa.absa.inception.core.service.InvalidArgumentException, DuplicateFunctionException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceCreate the new function.- Specified by:
createFunctionin interfaceISecurityService- Parameters:
function- the function- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidDuplicateFunctionException- if the function already existsafrica.absa.inception.core.service.ServiceUnavailableException- if the function could not be created
-
createGroup
@Transactional public void createGroup(Group group) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, DuplicateGroupException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceCreate the new group.- Specified by:
createGroupin interfaceISecurityService- Parameters:
group- the group- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundDuplicateGroupException- if the group already existsafrica.absa.inception.core.service.ServiceUnavailableException- if the group could not be created
-
createTenant
@Transactional public Optional<UserDirectory> createTenant(Tenant tenant, boolean createUserDirectory) throws africa.absa.inception.core.service.InvalidArgumentException, DuplicateTenantException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceCreate the new tenant.- Specified by:
createTenantin interfaceISecurityService- Parameters:
tenant- the tenantcreateUserDirectory- should a new internal user directory be created for the tenant- Returns:
- an Optional containing the new internal user directory that was created for the tenant or an empty Optional if no user directory was created
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidDuplicateTenantException- if the tenant already existsafrica.absa.inception.core.service.ServiceUnavailableException- if the tenant could not be created
-
createUser
@Transactional public void createUser(User user, boolean expiredPassword, boolean userLocked) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, DuplicateUserException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceCreate the new user.- Specified by:
createUserin interfaceISecurityService- Parameters:
user- the userexpiredPassword- create the user with its password expireduserLocked- create the user locked- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundDuplicateUserException- if the user already existsafrica.absa.inception.core.service.ServiceUnavailableException- if the user could not be created
-
createUserDirectory
@Transactional public void createUserDirectory(UserDirectory userDirectory) throws africa.absa.inception.core.service.InvalidArgumentException, DuplicateUserDirectoryException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceCreate the new user directory.- Specified by:
createUserDirectoryin interfaceISecurityService- Parameters:
userDirectory- the user directory- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidDuplicateUserDirectoryException- if the user directory already existsafrica.absa.inception.core.service.ServiceUnavailableException- if the user directory could not be created
-
deleteFunction
@Transactional public void deleteFunction(String functionCode) throws africa.absa.inception.core.service.InvalidArgumentException, FunctionNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceDelete the function.- Specified by:
deleteFunctionin interfaceISecurityService- Parameters:
functionCode- the code for the function- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidFunctionNotFoundException- if the function could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the function could not be created
-
deleteGroup
@Transactional public void deleteGroup(UUID userDirectoryId, String groupName) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, ExistingGroupMembersException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceDelete the group.- Specified by:
deleteGroupin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directorygroupName- the name of the group- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundGroupNotFoundException- if the group could not be foundExistingGroupMembersException- if the group has existing membersafrica.absa.inception.core.service.ServiceUnavailableException- if the group could not be deleted
-
deleteTenant
@Transactional public void deleteTenant(UUID tenantId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceDelete the tenant.- Specified by:
deleteTenantin interfaceISecurityService- Parameters:
tenantId- the Universally Unique Identifier (UUID) for the tenant- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidTenantNotFoundException- if the tenant could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the tenant could not be deleted
-
deleteUser
@Transactional public void deleteUser(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceDelete the user.- Specified by:
deleteUserin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directoryusername- the username for the user- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user could not be deleted
-
deleteUserDirectory
@Transactional public void deleteUserDirectory(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceDelete the user directory.- Specified by:
deleteUserDirectoryin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directory- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user directory could not be deleted
-
findUsers
public List<User> findUsers(UUID userDirectoryId, List<UserAttribute> userAttributes) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, InvalidAttributeException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the users matching the user attribute criteria.- Specified by:
findUsersin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directoryuserAttributes- the user attribute criteria used to select the users- Returns:
- the users whose attributes match the user attribute criteria
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundInvalidAttributeException- if an attribute is invalidafrica.absa.inception.core.service.ServiceUnavailableException- if the users matching the user attribute criteria could not be found
-
getFunction
public Function getFunction(String functionCode) throws africa.absa.inception.core.service.InvalidArgumentException, FunctionNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the function.- Specified by:
getFunctionin interfaceISecurityService- Parameters:
functionCode- the code for the function- Returns:
- the function
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidFunctionNotFoundException- if the function could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the function could not be retrieved
-
getFunctionCodesForUser
public List<String> getFunctionCodesForUser(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the function codes for the user.- Specified by:
getFunctionCodesForUserin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directoryusername- the username for the user- Returns:
- the function codes for the user
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the function codes could not be retrieved for the user
-
getFunctions
public List<Function> getFunctions() throws africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve all the functions.- Specified by:
getFunctionsin interfaceISecurityService- Returns:
- the functions
- Throws:
africa.absa.inception.core.service.ServiceUnavailableException- if the functions could not be retrieved
-
getGroup
public Group getGroup(UUID userDirectoryId, String groupName) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the group.- Specified by:
getGroupin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directorygroupName- the name of the group- Returns:
- the group
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundGroupNotFoundException- if the group could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the group could not be retrieved
-
getGroupNames
public List<String> getGroupNames(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve all the group names.- Specified by:
getGroupNamesin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directory- Returns:
- the group names
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the group names could not be retrieved
-
getGroupNamesForUser
public List<String> getGroupNamesForUser(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the names of the groups the user is a member of.- Specified by:
getGroupNamesForUserin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directoryusername- the username for the user- Returns:
- the names of the groups the user is a member of
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the names of the groups the user is a member of could not be retrieved
-
getGroups
public List<Group> getGroups(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve all the groups.- Specified by:
getGroupsin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directory- Returns:
- the groups
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the groups could not be retrieved
-
getGroups
public Groups getGroups(UUID userDirectoryId, String filter, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the groups.- Specified by:
getGroupsin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directoryfilter- the optional filter to apply to the groupssortDirection- the optional sort direction to apply to the groupspageIndex- the optional page indexpageSize- the optional page size- Returns:
- the groups
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the groups could not be retrieved
-
getGroupsForUser
public List<Group> getGroupsForUser(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the groups the user is a member of.- Specified by:
getGroupsForUserin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directoryusername- the username for the user- Returns:
- the groups the user is a member of
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the groups the user is a member of could not be retrieved
-
getMembersForGroup
public List<GroupMember> getMembersForGroup(UUID userDirectoryId, String groupName) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the group members for the group.- Specified by:
getMembersForGroupin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directorygroupName- the name of the group- Returns:
- the group members for the group
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundGroupNotFoundException- if the group could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the group members could not be retrieved for the group
-
getMembersForGroup
@Transactional public GroupMembers getMembersForGroup(UUID userDirectoryId, String groupName, String filter, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the group members for the group.- Specified by:
getMembersForGroupin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directorygroupName- the name of the groupfilter- the optional filter to apply to the group memberssortDirection- the optional sort direction to apply to the group memberspageIndex- the optional page indexpageSize- the optional page size- Returns:
- the group members for the group
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundGroupNotFoundException- if the group could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the group members could not be retrieved for the group
-
getRoleCodesForGroup
public List<String> getRoleCodesForGroup(UUID userDirectoryId, String groupName) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the codes for the roles that have been assigned to the group.- Specified by:
getRoleCodesForGroupin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directorygroupName- the name of the group- Returns:
- the codes for the roles that have been assigned to the group
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundGroupNotFoundException- if the group could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the codes for the roles assigned to the group could not be retrieved
-
getRoleCodesForUser
public List<String> getRoleCodesForUser(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the codes for the roles that have been assigned to the user.- Specified by:
getRoleCodesForUserin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directoryusername- the username for the user- Returns:
- the codes for the roles that have been assigned to the user
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the codes for the roles assigned to the user could not be retrieved
-
getRoles
public List<Role> getRoles() throws africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve all the roles.- Specified by:
getRolesin interfaceISecurityService- Returns:
- the roles
- Throws:
africa.absa.inception.core.service.ServiceUnavailableException- if the roles could not be retrieved
-
getRolesForGroup
public List<GroupRole> getRolesForGroup(UUID userDirectoryId, String groupName) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the roles that have been assigned to the group.- Specified by:
getRolesForGroupin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directorygroupName- the name of the group- Returns:
- the roles that have been assigned to the group
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundGroupNotFoundException- if the group could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the codes for the roles assigned to the group could not be retrieved
-
getTenant
public Tenant getTenant(UUID tenantId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the tenant.- Specified by:
getTenantin interfaceISecurityService- Parameters:
tenantId- the Universally Unique Identifier (UUID) for the tenant- Returns:
- the tenant
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidTenantNotFoundException- if the tenant could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the tenant could not be retrieved
-
getTenantIdsForUserDirectory
public List<UUID> getTenantIdsForUserDirectory(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the Universally Unique Identifiers (UUIDs) for the tenants the user directory is associated with.- Specified by:
getTenantIdsForUserDirectoryin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directory- Returns:
- the Universally Unique Identifiers (UUIDs) for the tenants the user directory is associated with
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the tenant IDs could not be retrieved for the user directory
-
getTenantName
public String getTenantName(UUID tenantId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the name of the tenant.- Specified by:
getTenantNamein interfaceISecurityService- Parameters:
tenantId- the Universally Unique Identifier (UUID) for the tenant- Returns:
- the name of the tenant
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidTenantNotFoundException- if the tenant could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the name of the tenant could not be retrieved
-
getTenants
public List<Tenant> getTenants() throws africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the tenants.- Specified by:
getTenantsin interfaceISecurityService- Returns:
- the tenants
- Throws:
africa.absa.inception.core.service.ServiceUnavailableException- if the tenants could not be retrieved
-
getTenants
public Tenants getTenants(String filter, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize) throws africa.absa.inception.core.service.InvalidArgumentException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the tenants.- Specified by:
getTenantsin interfaceISecurityService- Parameters:
filter- the optional filter to apply to the tenantssortDirection- the optional sort direction to apply to the tenantspageIndex- the optional page indexpageSize- the optional page size- Returns:
- the tenants
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidafrica.absa.inception.core.service.ServiceUnavailableException- if the tenants could not be retrieved
-
getTenantsForUserDirectory
public List<Tenant> getTenantsForUserDirectory(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the tenants the user directory is associated with.- Specified by:
getTenantsForUserDirectoryin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directory- Returns:
- the tenants the user directory is associated with
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the tenants could not be retrieved for the user directory
-
getUser
public User getUser(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the user.- Specified by:
getUserin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directoryusername- the username for the user- Returns:
- the user
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user could not be retrieved
-
getUserDirectories
public List<UserDirectory> getUserDirectories() throws africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the user directories.- Specified by:
getUserDirectoriesin interfaceISecurityService- Returns:
- the user directories
- Throws:
africa.absa.inception.core.service.ServiceUnavailableException- if the user directories could not be retrieved
-
getUserDirectories
public UserDirectories getUserDirectories(String filter, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize) throws africa.absa.inception.core.service.InvalidArgumentException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the user directories.- Specified by:
getUserDirectoriesin interfaceISecurityService- Parameters:
filter- the optional filter to apply to the user directoriessortDirection- the optional sort direction to apply to the user directoriespageIndex- the optional page indexpageSize- the optional page size- Returns:
- the user directories
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidafrica.absa.inception.core.service.ServiceUnavailableException- if the user directories could not be retrieved
-
getUserDirectoriesForTenant
public List<UserDirectory> getUserDirectoriesForTenant(UUID tenantId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the user directories the tenant is associated with.- Specified by:
getUserDirectoriesForTenantin interfaceISecurityService- Parameters:
tenantId- the Universally Unique Identifier (UUID) for the tenant- Returns:
- the user directories the tenant is associated with
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidTenantNotFoundException- if the tenant could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user directories could not be retrieved for the tenant
-
getUserDirectory
public UserDirectory getUserDirectory(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the user directory.- Specified by:
getUserDirectoryin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directory- Returns:
- the user directory
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user directory could not be retrieved
-
getUserDirectoryCapabilities
public UserDirectoryCapabilities getUserDirectoryCapabilities(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the capabilities the user directory supports.- Specified by:
getUserDirectoryCapabilitiesin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directory- Returns:
- the capabilities the user directory supports
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user directory capabilities could not be retrieved
-
getUserDirectoryIdForUser
public Optional<UUID> getUserDirectoryIdForUser(String username) throws africa.absa.inception.core.service.InvalidArgumentException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the Universally Unique Identifier (UUID) for the user directory that the user with the specified username is associated with.- Specified by:
getUserDirectoryIdForUserin interfaceISecurityService- Parameters:
username- the username for the user- Returns:
- an Optional containing the Universally Unique Identifier (UUID) for the user directory that the user with the specified username is associated with or an empty Optional if the user cannot be found
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidafrica.absa.inception.core.service.ServiceUnavailableException- if the user directory ID could not be retrieved for the user
-
getUserDirectoryIdsForTenant
public List<UUID> getUserDirectoryIdsForTenant(UUID tenantId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the Universally Unique Identifiers (UUIDs) for the user directories the tenant is associated with.- Specified by:
getUserDirectoryIdsForTenantin interfaceISecurityService- Parameters:
tenantId- the Universally Unique Identifier (UUID) for the tenant- Returns:
- the Universally Unique Identifiers (UUIDs) for the user directories the tenant is associated with
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidTenantNotFoundException- if the tenant could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user directory IDs could not be retrieved for the tenant
-
getUserDirectoryIdsForUser
public List<UUID> getUserDirectoryIdsForUser(String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the Universally Unique Identifiers (UUIDs) for the user directories the user is associated with. Every user is associated with a user directory, which is in turn associated with one or more tenants, which are in turn associated with one or more user directories. The user is therefore associated indirectly with all these user directories.- Specified by:
getUserDirectoryIdsForUserin interfaceISecurityService- Parameters:
username- the username for the user- Returns:
- the Universally Unique Identifiers (UUIDs) for the user directories the user is associated with
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user directory IDs could not be retrieved for the user
-
getUserDirectoryName
public String getUserDirectoryName(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the name of the user directory.- Specified by:
getUserDirectoryNamein interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directory- Returns:
- the name of the user directory
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the name of the user directory could not be retrieved
-
getUserDirectorySummaries
public UserDirectorySummaries getUserDirectorySummaries(String filter, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize) throws africa.absa.inception.core.service.InvalidArgumentException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the summaries for the user directories.- Specified by:
getUserDirectorySummariesin interfaceISecurityService- Parameters:
filter- the optional filter to apply to the user directoriessortDirection- the optional sort direction to apply to the user directoriespageIndex- the optional page indexpageSize- the optional page size- Returns:
- the summaries for the user directories
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidafrica.absa.inception.core.service.ServiceUnavailableException- if the user directory summaries could not be retrieved
-
getUserDirectorySummariesForTenant
public List<UserDirectorySummary> getUserDirectorySummariesForTenant(UUID tenantId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the summaries for the user directories the tenant is associated with.- Specified by:
getUserDirectorySummariesForTenantin interfaceISecurityService- Parameters:
tenantId- the Universally Unique Identifier (UUID) for the tenant- Returns:
- the summaries for the user directories the tenant is associated with
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidTenantNotFoundException- if the tenant could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user directory summaries could not be retrieved for the tenant
-
getUserDirectoryTypeForUserDirectory
public UserDirectoryType getUserDirectoryTypeForUserDirectory(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserDirectoryTypeNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the user directory type for the user directory.- Specified by:
getUserDirectoryTypeForUserDirectoryin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directory- Returns:
- the user directory type for the user directory
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundUserDirectoryTypeNotFoundException- if the user directory type could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user directory type could not be retrieved for the user directory
-
getUserDirectoryTypes
public List<UserDirectoryType> getUserDirectoryTypes() throws africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the user directory types.- Specified by:
getUserDirectoryTypesin interfaceISecurityService- Returns:
- the user directory types
- Throws:
africa.absa.inception.core.service.ServiceUnavailableException- if the user directory types could not be retrieved
-
getUserName
public String getUserName(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the name of the user.- Specified by:
getUserNamein interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directoryusername- the username for the user- Returns:
- the name of the user
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the name of the user could not be retrieved
-
getUsers
public List<User> getUsers(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve all the users.- Specified by:
getUsersin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directory- Returns:
- the users
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the users could not be retrieved
-
getUsers
public Users getUsers(UUID userDirectoryId, String filter, UserSortBy sortBy, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRetrieve the users.- Specified by:
getUsersin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directoryfilter- the optional filter to apply to the userssortBy- the optional method used to sort the users e.g. by namesortDirection- the optional sort direction to apply to the userspageIndex- the optional page indexpageSize- the optional page size- Returns:
- the users
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the users could not be retrieved
-
initiatePasswordReset
@Transactional public void initiatePasswordReset(String username, String resetPasswordUrl, boolean sendEmail) throws africa.absa.inception.core.service.InvalidArgumentException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceInitiate the password reset process for the user.- Specified by:
initiatePasswordResetin interfaceISecurityService- Parameters:
username- the username for the userresetPasswordUrl- the reset password URLsendEmail- should the password reset e-mail be sent to the user- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the password reset could not be initiated
-
initiatePasswordReset
@Transactional public void initiatePasswordReset(String username, String resetPasswordUrl, boolean sendEmail, String securityCode) throws africa.absa.inception.core.service.InvalidArgumentException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceInitiate the password reset process for the user.- Specified by:
initiatePasswordResetin interfaceISecurityService- Parameters:
username- the username for the userresetPasswordUrl- the reset password URLsendEmail- should the password reset e-mail be sent to the usersecurityCode- the pre-generated security code to use- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the password reset could not be initiated
-
isExistingUser
public boolean isExistingUser(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceDoes the user with the specified username exist?- Specified by:
isExistingUserin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directoryusername- the username for the user- Returns:
- true if a user with specified username exists or false otherwise
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the check for the existing user failed
-
isUserInGroup
public boolean isUserInGroup(UUID userDirectoryId, String groupName, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceIs the user in the group?- Specified by:
isUserInGroupin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directorygroupName- the name of the groupusername- the username for the user- Returns:
- true if the user is a member of the group or false otherwise
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundUserNotFoundException- if the user could not be foundGroupNotFoundException- if the group could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the check to confirm if the user is a member of the group failed
-
reloadUserDirectories
public void reloadUserDirectories() throws africa.absa.inception.core.service.ServiceUnavailableExceptionDescription copied from interface:ISecurityServiceReload the user directories.- Specified by:
reloadUserDirectoriesin interfaceISecurityService- Throws:
africa.absa.inception.core.service.ServiceUnavailableException- if the user directories could not be realoded
-
removeMemberFromGroup
@Transactional public void removeMemberFromGroup(UUID userDirectoryId, String groupName, GroupMemberType memberType, String memberName) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, GroupMemberNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRemove the group member from the group.- Specified by:
removeMemberFromGroupin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directorygroupName- the name of the groupmemberType- the group member typememberName- the group member name- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundGroupNotFoundException- if the group could not be foundGroupMemberNotFoundException- if the group member could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the group member could not be removed from the group
-
removeRoleFromGroup
@Transactional public void removeRoleFromGroup(UUID userDirectoryId, String groupName, String roleCode) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, GroupRoleNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRemove the role from the group.- Specified by:
removeRoleFromGroupin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directorygroupName- the name of the grouproleCode- the code for the role- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundGroupNotFoundException- if the group could not be foundGroupRoleNotFoundException- if the group role could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the role could not be removed from the group
-
removeUserDirectoryFromTenant
@Transactional public void removeUserDirectoryFromTenant(UUID tenantId, UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, TenantUserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRemove the user directory from the tenant.- Specified by:
removeUserDirectoryFromTenantin interfaceISecurityService- Parameters:
tenantId- the Universally Unique Identifier (UUID) for the tenantuserDirectoryId- the Universally Unique Identifier (UUID) for the user directory- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidTenantNotFoundException- if the tenant could not be foundTenantUserDirectoryNotFoundException- if the tenant user directory could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user directory could not be removed from the tenant
-
removeUserFromGroup
@Transactional public void removeUserFromGroup(UUID userDirectoryId, String groupName, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceRemove the user from the group.- Specified by:
removeUserFromGroupin interfaceISecurityService- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directorygroupName- the name of the groupusername- the username for the user- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundGroupNotFoundException- if the group could not be foundUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user could not be removed from the group
-
resetPassword
@Transactional public void resetPassword(String username, String newPassword, String securityCode) throws africa.absa.inception.core.service.InvalidArgumentException, InvalidSecurityCodeException, UserLockedException, ExistingPasswordException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceReset the password for the user.- Specified by:
resetPasswordin interfaceISecurityService- Parameters:
username- the username for the usernewPassword- the new passwordsecurityCode- the security code- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidInvalidSecurityCodeException- if the security code is invalidUserLockedException- if the user is lockedExistingPasswordException- if the user has previously used the new passwordafrica.absa.inception.core.service.ServiceUnavailableException- if the password for the user could not be reset
-
updateFunction
@Transactional public void updateFunction(Function function) throws africa.absa.inception.core.service.InvalidArgumentException, FunctionNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceUpdate the function.- Specified by:
updateFunctionin interfaceISecurityService- Parameters:
function- the function- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidFunctionNotFoundException- if the function could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the function could not be updated
-
updateGroup
@Transactional public void updateGroup(Group group) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceUpdate the group.- Specified by:
updateGroupin interfaceISecurityService- Parameters:
group- the group- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundGroupNotFoundException- if the group could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the group could not be updated
-
updateTenant
@Transactional public void updateTenant(Tenant tenant) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceUpdate the tenant.- Specified by:
updateTenantin interfaceISecurityService- Parameters:
tenant- the tenant- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidTenantNotFoundException- if the tenant could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the tenant could not be updated
-
updateUser
@Transactional public void updateUser(User user, boolean expirePassword, boolean lockUser) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceUpdate the user.- Specified by:
updateUserin interfaceISecurityService- Parameters:
user- the userexpirePassword- expire the user's password as part of the updatelockUser- lock the user as part of the update- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundUserNotFoundException- if the user could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user could not be updated
-
updateUserDirectory
@Transactional public void updateUserDirectory(UserDirectory userDirectory) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
Description copied from interface:ISecurityServiceUpdate the user directory.- Specified by:
updateUserDirectoryin interfaceISecurityService- Parameters:
userDirectory- the user directory- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidUserDirectoryNotFoundException- if the user directory could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the user directory could not be updated
-
-