Interface ISecurityService

All Known Implementing Classes:
SecurityService

public interface ISecurityService
The ISecurityService interface defines the functionality provided by a Security Service implementation, which manages the security related information for an application.
Author:
Marcus Portmann
  • Field Details

    • ADMINISTRATORS_GROUP_ID

      static final UUID ADMINISTRATORS_GROUP_ID
      The ID for the Administrators group.
    • ADMINISTRATORS_GROUP_NAME

      static final String ADMINISTRATORS_GROUP_NAME
      The name of the Administrators group.
      See Also:
    • ADMINISTRATOR_ROLE_CODE

      static final String ADMINISTRATOR_ROLE_CODE
      The code for the Administrator role.
      See Also:
    • ADMINISTRATOR_USERNAME

      static final String ADMINISTRATOR_USERNAME
      The username for the Administrator user.
      See Also:
    • DEFAULT_TENANT_ID

      static final UUID DEFAULT_TENANT_ID
      The ID for the default tenant.
    • DEFAULT_USER_DIRECTORY_ID

      static final UUID DEFAULT_USER_DIRECTORY_ID
      The ID for the default internal user directory.
    • INTERNAL_USER_DIRECTORY_TYPE

      static final String INTERNAL_USER_DIRECTORY_TYPE
      The code for the internal user directory type.
      See Also:
    • LDAP_USER_DIRECTORY_TYPE

      static final String LDAP_USER_DIRECTORY_TYPE
      The code for the LDAP user directory type.
      See Also:
    • PASSWORD_RESETTER_ROLE_CODE

      static final String PASSWORD_RESETTER_ROLE_CODE
      The code for the Password Resetter role.
      See Also:
    • TENANT_ADMINISTRATOR_ROLE_CODE

      static final String TENANT_ADMINISTRATOR_ROLE_CODE
      The code for the Tenant Administrator role.
      See Also:
  • Method Details

    • addMemberToGroup

      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
      Add the group member to the group.
      Parameters:
      userDirectoryId - the ID for the user directory
      groupName - the name of the group
      memberType - the group member type
      memberName - the group member name
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      GroupNotFoundException - if the group could not be found
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the group member could not be added to the group
    • addRoleToGroup

      void addRoleToGroup(UUID userDirectoryId, String groupName, String roleCode) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, RoleNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Add the role to the group.
      Parameters:
      userDirectoryId - the ID for the user directory
      groupName - the name of the group
      roleCode - the code for the role
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      GroupNotFoundException - if the group could not be found
      RoleNotFoundException - if the role could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the role could not be added to the group
    • addUserDirectoryToTenant

      void addUserDirectoryToTenant(UUID tenantId, UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Add the user directory to the tenant.
      Parameters:
      tenantId - the ID for the tenant
      userDirectoryId - the ID for the user directory
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      TenantNotFoundException - if the tenant could not be found
      UserDirectoryNotFoundException - if the user directory could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directory could not be added to the tenant
    • addUserToGroup

      void addUserToGroup(UUID userDirectoryId, String groupName, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Add the user to the group.
      Parameters:
      userDirectoryId - the ID for the user directory
      groupName - the name of the group
      username - the username for the user
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      GroupNotFoundException - if the group could not be found
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user could not be added to the group
    • adminChangePassword

      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
      Administratively change the password for the user.
      Parameters:
      userDirectoryId - the ID for the user directory
      username - the username for the user
      newPassword - the new password
      expirePassword - expire the user's password
      lockUser - lock the user
      resetPasswordHistory - reset the user's password history
      reason - the reason for changing the password
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the password could not be administratively changed
    • authenticate

      UUID authenticate(String username, String password) throws africa.absa.inception.core.service.InvalidArgumentException, AuthenticationFailedException, UserLockedException, ExpiredPasswordException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Authenticate the user.
      Parameters:
      username - the username for the user
      password - the password being used to authenticate
      Returns:
      the ID for the user directory
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      AuthenticationFailedException - if the authentication failed
      UserLockedException - if the user is locked
      ExpiredPasswordException - if the password for the user has expired
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user could not be authenticated
    • changePassword

      UUID changePassword(String username, String password, String newPassword) throws africa.absa.inception.core.service.InvalidArgumentException, AuthenticationFailedException, UserLockedException, ExistingPasswordException, africa.absa.inception.core.service.ServiceUnavailableException
      Change the password for the user.
      Parameters:
      username - the username for the user
      password - the password for the user that is used to authorise the operation
      newPassword - the new password
      Returns:
      the ID for the user directory
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      AuthenticationFailedException - if the authentication failed
      UserLockedException - if the user is locked
      ExistingPasswordException - if the user has previously used the new password
      africa.absa.inception.core.service.ServiceUnavailableException - if the password could not be changed
    • createFunction

      void createFunction(Function function) throws africa.absa.inception.core.service.InvalidArgumentException, DuplicateFunctionException, africa.absa.inception.core.service.ServiceUnavailableException
      Create the new function.
      Parameters:
      function - the function
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      DuplicateFunctionException - if the function already exists
      africa.absa.inception.core.service.ServiceUnavailableException - if the function could not be created
    • createGroup

      void createGroup(Group group) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, DuplicateGroupException, africa.absa.inception.core.service.ServiceUnavailableException
      Create the new group.
      Parameters:
      group - the group
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      DuplicateGroupException - if the group already exists
      africa.absa.inception.core.service.ServiceUnavailableException - if the group could not be created
    • createTenant

      Optional<UserDirectory> createTenant(Tenant tenant, boolean createUserDirectory) throws africa.absa.inception.core.service.InvalidArgumentException, DuplicateTenantException, africa.absa.inception.core.service.ServiceUnavailableException
      Create the new tenant.
      Parameters:
      tenant - the tenant
      createUserDirectory - 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 invalid
      DuplicateTenantException - if the tenant already exists
      africa.absa.inception.core.service.ServiceUnavailableException - if the tenant could not be created
    • createUser

      void createUser(User user, boolean expiredPassword, boolean userLocked) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, DuplicateUserException, africa.absa.inception.core.service.ServiceUnavailableException
      Create the new user.
      Parameters:
      user - the user
      expiredPassword - create the user with its password expired
      userLocked - create the user locked
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      DuplicateUserException - if the user already exists
      africa.absa.inception.core.service.ServiceUnavailableException - if the user could not be created
    • createUserDirectory

      void createUserDirectory(UserDirectory userDirectory) throws africa.absa.inception.core.service.InvalidArgumentException, DuplicateUserDirectoryException, africa.absa.inception.core.service.ServiceUnavailableException
      Create the new user directory.
      Parameters:
      userDirectory - the user directory
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      DuplicateUserDirectoryException - if the user directory already exists
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directory could not be created
    • deleteFunction

      void deleteFunction(String functionCode) throws africa.absa.inception.core.service.InvalidArgumentException, FunctionNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Delete the function.
      Parameters:
      functionCode - the code for the function
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      FunctionNotFoundException - if the function could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the function could not be created
    • deleteGroup

      void deleteGroup(UUID userDirectoryId, String groupName) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, ExistingGroupMembersException, africa.absa.inception.core.service.ServiceUnavailableException
      Delete the group.
      Parameters:
      userDirectoryId - the ID for the user directory
      groupName - the name of the group
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      GroupNotFoundException - if the group could not be found
      ExistingGroupMembersException - if the group has existing members
      africa.absa.inception.core.service.ServiceUnavailableException - if the group could not be deleted
    • deleteTenant

      void deleteTenant(UUID tenantId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Delete the tenant.
      Parameters:
      tenantId - the ID for the tenant
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      TenantNotFoundException - if the tenant could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the tenant could not be deleted
    • deleteUser

      void deleteUser(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Delete the user.
      Parameters:
      userDirectoryId - the ID for the user directory
      username - the username for the user
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user could not be deleted
    • deleteUserDirectory

      void deleteUserDirectory(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Delete the user directory.
      Parameters:
      userDirectoryId - the ID for the user directory
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directory could not be deleted
    • findUsers

      List<User> findUsers(UUID userDirectoryId, List<UserAttribute> userAttributes) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, InvalidAttributeException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the users matching the user attribute criteria.
      Parameters:
      userDirectoryId - the ID for the user directory
      userAttributes - 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 invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      InvalidAttributeException - if an attribute is invalid
      africa.absa.inception.core.service.ServiceUnavailableException - if the users matching the user attribute criteria could not be found
    • getFunction

      Function getFunction(String functionCode) throws africa.absa.inception.core.service.InvalidArgumentException, FunctionNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the function.
      Parameters:
      functionCode - the code for the function
      Returns:
      the function
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      FunctionNotFoundException - if the function could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the function could not be retrieved
    • getFunctionCodesForUser

      List<String> getFunctionCodesForUser(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the function codes for the user.
      Parameters:
      userDirectoryId - the ID for the user directory
      username - the username for the user
      Returns:
      the function codes for the user
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the function codes could not be retrieved for the user
    • getFunctions

      List<Function> getFunctions() throws africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve all the functions.
      Returns:
      the functions
      Throws:
      africa.absa.inception.core.service.ServiceUnavailableException - if the functions could not be retrieved
    • getGroup

      Group getGroup(UUID userDirectoryId, String groupName) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the group.
      Parameters:
      userDirectoryId - the ID for the user directory
      groupName - the name of the group
      Returns:
      the group
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      GroupNotFoundException - if the group could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the group could not be retrieved
    • getGroupNames

      List<String> getGroupNames(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve all the group names.
      Parameters:
      userDirectoryId - the ID for the user directory
      Returns:
      the group names
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the group names could not be retrieved
    • getGroupNamesForUser

      List<String> getGroupNamesForUser(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the names of the groups the user is a member of.
      Parameters:
      userDirectoryId - the ID for the user directory
      username - 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 invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the names of the groups the user is a member of could not be retrieved
    • getGroups

      List<Group> getGroups(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve all the groups.
      Parameters:
      userDirectoryId - the ID for the user directory
      Returns:
      the groups
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the groups could not be retrieved
    • getGroups

      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
      Retrieve the groups.
      Parameters:
      userDirectoryId - the ID for the user directory
      filter - the optional filter to apply to the groups
      sortDirection - the optional sort direction to apply to the groups
      pageIndex - the optional page index
      pageSize - the optional page size
      Returns:
      the groups
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the groups could not be retrieved
    • getGroupsForUser

      List<Group> getGroupsForUser(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the groups the user is a member of.
      Parameters:
      userDirectoryId - the ID for the user directory
      username - 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 invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the groups the user is a member of could not be retrieved
    • getMembersForGroup

      List<GroupMember> getMembersForGroup(UUID userDirectoryId, String groupName) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the group members for the group.
      Parameters:
      userDirectoryId - the ID for the user directory
      groupName - the name of the group
      Returns:
      the group members for the group
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      GroupNotFoundException - if the group could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the group members could not be retrieved for the group
    • getMembersForGroup

      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
      Retrieve the group members for the group.
      Parameters:
      userDirectoryId - the ID for the user directory
      groupName - the name of the group
      filter - the optional filter to apply to the group members
      sortDirection - the optional sort direction to apply to the group members
      pageIndex - the optional page index
      pageSize - the optional page size
      Returns:
      the group members for the group
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      GroupNotFoundException - if the group could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the group members could not be retrieved for the group
    • getRoleCodesForGroup

      List<String> getRoleCodesForGroup(UUID userDirectoryId, String groupName) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the codes for the roles that have been assigned to the group.
      Parameters:
      userDirectoryId - the ID for the user directory
      groupName - 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 invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      GroupNotFoundException - if the group could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the codes for the roles assigned to the group could not be retrieved
    • getRoleCodesForUser

      List<String> getRoleCodesForUser(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the codes for the roles that have been assigned to the user.
      Parameters:
      userDirectoryId - the ID for the user directory
      username - 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 invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the codes for the roles assigned to the user could not be retrieved
    • getRoles

      List<Role> getRoles() throws africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve all the roles.
      Returns:
      the roles
      Throws:
      africa.absa.inception.core.service.ServiceUnavailableException - if the roles could not be retrieved
    • getRolesForGroup

      List<GroupRole> getRolesForGroup(UUID userDirectoryId, String groupName) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the roles that have been assigned to the group.
      Parameters:
      userDirectoryId - the ID for the user directory
      groupName - 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 invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      GroupNotFoundException - if the group could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the codes for the roles assigned to the group could not be retrieved
    • getTenant

      Tenant getTenant(UUID tenantId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the tenant.
      Parameters:
      tenantId - the ID for the tenant
      Returns:
      the tenant
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      TenantNotFoundException - if the tenant could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the tenant could not be retrieved
    • getTenantIdsForUserDirectory

      List<UUID> getTenantIdsForUserDirectory(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the IDs for the tenants the user directory is associated with.
      Parameters:
      userDirectoryId - the ID for the user directory
      Returns:
      the IDs for the tenants the user directory is associated with
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the tenant IDs could not be retrieved for the user directory
    • getTenantName

      String getTenantName(UUID tenantId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the name of the tenant.
      Parameters:
      tenantId - the ID for the tenant
      Returns:
      the name of the tenant
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      TenantNotFoundException - if the tenant could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the name of the tenant could not be retrieved
    • getTenants

      List<Tenant> getTenants() throws africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the tenants.
      Returns:
      the tenants
      Throws:
      africa.absa.inception.core.service.ServiceUnavailableException - if the tenants could not be retrieved
    • getTenants

      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
      Retrieve the tenants.
      Parameters:
      filter - the optional filter to apply to the tenants
      sortDirection - the optional sort direction to apply to the tenants
      pageIndex - the optional page index
      pageSize - the optional page size
      Returns:
      the tenants
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      africa.absa.inception.core.service.ServiceUnavailableException - if the tenants could not be retrieved
    • getTenantsForUserDirectory

      List<Tenant> getTenantsForUserDirectory(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the tenants the user directory is associated with.
      Parameters:
      userDirectoryId - the ID for the user directory
      Returns:
      the tenants the user directory is associated with
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the tenants could not be retrieved for the user directory
    • getUser

      User getUser(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the user.
      Parameters:
      userDirectoryId - the ID for the user directory
      username - the username for the user
      Returns:
      the user
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user could not be retrieved
    • getUserDirectories

      List<UserDirectory> getUserDirectories() throws africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the user directories.
      Returns:
      the user directories
      Throws:
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directories could not be retrieved
    • getUserDirectories

      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
      Retrieve the user directories.
      Parameters:
      filter - the optional filter to apply to the user directories
      sortDirection - the optional sort direction to apply to the user directories
      pageIndex - the optional page index
      pageSize - the optional page size
      Returns:
      the user directories
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directories could not be retrieved
    • getUserDirectoriesForTenant

      List<UserDirectory> getUserDirectoriesForTenant(UUID tenantId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the user directories the tenant is associated with.
      Parameters:
      tenantId - the ID for the tenant
      Returns:
      the user directories the tenant is associated with
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      TenantNotFoundException - if the tenant could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directories could not be retrieved for the tenant
    • getUserDirectory

      UserDirectory getUserDirectory(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the user directory.
      Parameters:
      userDirectoryId - the ID for the user directory
      Returns:
      the user directory
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directory could not be retrieved
    • getUserDirectoryCapabilities

      UserDirectoryCapabilities getUserDirectoryCapabilities(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the capabilities the user directory supports.
      Parameters:
      userDirectoryId - the ID for the user directory
      Returns:
      the capabilities the user directory supports
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directory capabilities could not be retrieved
    • getUserDirectoryIdForUser

      Optional<UUID> getUserDirectoryIdForUser(String username) throws africa.absa.inception.core.service.InvalidArgumentException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the ID for the user directory that the user with the specified username is associated with.
      Parameters:
      username - the username for the user
      Returns:
      an Optional containing the ID 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 invalid
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directory ID could not be retrieved for the user
    • getUserDirectoryIdsForTenant

      List<UUID> getUserDirectoryIdsForTenant(UUID tenantId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the IDs for the user directories the tenant is associated with.
      Parameters:
      tenantId - the ID for the tenant
      Returns:
      the IDs for the user directories the tenant is associated with
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      TenantNotFoundException - if the tenant could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directory IDs could not be retrieved for the tenant
    • getUserDirectoryIdsForUser

      List<UUID> getUserDirectoryIdsForUser(String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the IDs 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.
      Parameters:
      username - the username for the user
      Returns:
      the IDs for the user directories the user is associated with
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directory IDs could not be retrieved for the user
    • getUserDirectoryName

      String getUserDirectoryName(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the name of the user directory.
      Parameters:
      userDirectoryId - the ID for the user directory
      Returns:
      the name of the user directory
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the name of the user directory could not be retrieved
    • getUserDirectorySummaries

      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
      Retrieve the summaries for the user directories.
      Parameters:
      filter - the optional filter to apply to the user directories
      sortDirection - the optional sort direction to apply to the user directories
      pageIndex - the optional page index
      pageSize - the optional page size
      Returns:
      the summaries for the user directories
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directory summaries could not be retrieved
    • getUserDirectorySummariesForTenant

      List<UserDirectorySummary> getUserDirectorySummariesForTenant(UUID tenantId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the summaries for the user directories the tenant is associated with.
      Parameters:
      tenantId - the ID 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 invalid
      TenantNotFoundException - if the tenant could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directory summaries could not be retrieved for the tenant
    • getUserDirectoryTypeForUserDirectory

      UserDirectoryType getUserDirectoryTypeForUserDirectory(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserDirectoryTypeNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the user directory type for the user directory.
      Parameters:
      userDirectoryId - the ID for the user directory
      Returns:
      the user directory type for the user directory
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      UserDirectoryTypeNotFoundException - if the user directory type could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directory type could not be retrieved for the user directory
    • getUserDirectoryTypes

      List<UserDirectoryType> getUserDirectoryTypes() throws africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the user directory types.
      Returns:
      the user directory types
      Throws:
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directory types could not be retrieved
    • getUserName

      String getUserName(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve the name of the user.
      Parameters:
      userDirectoryId - the ID for the user directory
      username - the username for the user
      Returns:
      the name of the user
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the name of the user could not be retrieved
    • getUsers

      List<User> getUsers(UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Retrieve all the users.
      Parameters:
      userDirectoryId - the ID for the user directory
      Returns:
      the users
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the users could not be retrieved
    • getUsers

      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
      Retrieve the users.
      Parameters:
      userDirectoryId - the ID for the user directory
      filter - the optional filter to apply to the users
      sortBy - the optional method used to sort the users e.g. by name
      sortDirection - the optional sort direction to apply to the users
      pageIndex - the optional page index
      pageSize - the optional page size
      Returns:
      the users
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the users could not be retrieved
    • initiatePasswordReset

      void initiatePasswordReset(String username, String resetPasswordUrl, boolean sendEmail) throws africa.absa.inception.core.service.InvalidArgumentException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Initiate the password reset process for the user.
      Parameters:
      username - the username for the user
      resetPasswordUrl - the reset password URL
      sendEmail - should the password reset e-mail be sent to the user
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the password reset could not be initiated
    • initiatePasswordReset

      void initiatePasswordReset(String username, String resetPasswordUrl, boolean sendEmail, String securityCode) throws africa.absa.inception.core.service.InvalidArgumentException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Initiate the password reset process for the user.
      Parameters:
      username - the username for the user
      resetPasswordUrl - the reset password URL
      sendEmail - should the password reset e-mail be sent to the user
      securityCode - the pre-generated security code to use
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the password reset could not be initiated
    • isExistingUser

      boolean isExistingUser(UUID userDirectoryId, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Does the user with the specified username exist?
      Parameters:
      userDirectoryId - the ID for the user directory
      username - 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 invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the check for the existing user failed
    • isUserInGroup

      boolean isUserInGroup(UUID userDirectoryId, String groupName, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Is the user in the group?
      Parameters:
      userDirectoryId - the ID for the user directory
      groupName - the name of the group
      username - 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 invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      UserNotFoundException - if the user could not be found
      GroupNotFoundException - if the group could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the check to confirm if the user is a member of the group failed
    • reloadUserDirectories

      void reloadUserDirectories() throws africa.absa.inception.core.service.ServiceUnavailableException
      Reload the user directories.
      Throws:
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directories could not be realoded
    • removeMemberFromGroup

      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
      Remove the group member from the group.
      Parameters:
      userDirectoryId - the ID for the user directory
      groupName - the name of the group
      memberType - the group member type
      memberName - the group member name
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      GroupNotFoundException - if the group could not be found
      GroupMemberNotFoundException - if the group member could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the group member could not be removed from the group
    • removeRoleFromGroup

      void removeRoleFromGroup(UUID userDirectoryId, String groupName, String roleCode) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, GroupRoleNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Remove the role from the group.
      Parameters:
      userDirectoryId - the ID for the user directory
      groupName - the name of the group
      roleCode - the code for the role
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      GroupNotFoundException - if the group could not be found
      GroupRoleNotFoundException - if the group role could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the role could not be removed from the group
    • removeUserDirectoryFromTenant

      void removeUserDirectoryFromTenant(UUID tenantId, UUID userDirectoryId) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, TenantUserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Remove the user directory from the tenant.
      Parameters:
      tenantId - the ID for the tenant
      userDirectoryId - the ID for the user directory
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      TenantNotFoundException - if the tenant could not be found
      TenantUserDirectoryNotFoundException - if the tenant user directory could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directory could not be removed from the tenant
    • removeUserFromGroup

      void removeUserFromGroup(UUID userDirectoryId, String groupName, String username) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Remove the user from the group.
      Parameters:
      userDirectoryId - the ID for the user directory
      groupName - the name of the group
      username - the username for the user
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      GroupNotFoundException - if the group could not be found
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user could not be removed from the group
    • resetPassword

      void resetPassword(String username, String newPassword, String securityCode) throws africa.absa.inception.core.service.InvalidArgumentException, InvalidSecurityCodeException, UserLockedException, ExistingPasswordException, africa.absa.inception.core.service.ServiceUnavailableException
      Reset the password for the user.
      Parameters:
      username - the username for the user
      newPassword - the new password
      securityCode - the security code
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      InvalidSecurityCodeException - if the security code is invalid
      UserLockedException - if the user is locked
      ExistingPasswordException - if the user has previously used the new password
      africa.absa.inception.core.service.ServiceUnavailableException - if the password for the user could not be reset
    • updateFunction

      void updateFunction(Function function) throws africa.absa.inception.core.service.InvalidArgumentException, FunctionNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Update the function.
      Parameters:
      function - the function
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      FunctionNotFoundException - if the function could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the function could not be updated
    • updateGroup

      void updateGroup(Group group) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Update the group.
      Parameters:
      group - the group
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      GroupNotFoundException - if the group could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the group could not be updated
    • updateTenant

      void updateTenant(Tenant tenant) throws africa.absa.inception.core.service.InvalidArgumentException, TenantNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Update the tenant.
      Parameters:
      tenant - the tenant
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      TenantNotFoundException - if the tenant could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the tenant could not be updated
    • updateUser

      void updateUser(User user, boolean expirePassword, boolean lockUser) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Update the user.
      Parameters:
      user - the user
      expirePassword - expire the user's password as part of the update
      lockUser - lock the user as part of the update
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      UserNotFoundException - if the user could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user could not be updated
    • updateUserDirectory

      void updateUserDirectory(UserDirectory userDirectory) throws africa.absa.inception.core.service.InvalidArgumentException, UserDirectoryNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
      Update the user directory.
      Parameters:
      userDirectory - the user directory
      Throws:
      africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
      UserDirectoryNotFoundException - if the user directory could not be found
      africa.absa.inception.core.service.ServiceUnavailableException - if the user directory could not be updated