Package africa.absa.inception.security
Class InternalUserDirectory
- java.lang.Object
-
- africa.absa.inception.security.UserDirectoryBase
-
- africa.absa.inception.security.InternalUserDirectory
-
public class InternalUserDirectory extends UserDirectoryBase
The InternalUserDirectory class provides the internal user directory implementation.- Author:
- Marcus Portmann
-
-
Constructor Summary
Constructors Constructor Description InternalUserDirectory(UUID userDirectoryId, List<UserDirectoryParameter> parameters, GroupRepository groupRepository, UserRepository userRepository, RoleRepository roleRepository)Constructs a new InternalUserDirectory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMemberToGroup(String groupName, GroupMemberType memberType, String memberName)voidaddRoleToGroup(String groupName, String roleCode)voidaddUserToGroup(String groupName, String username)voidadminChangePassword(String username, String newPassword, boolean expirePassword, boolean lockUser, boolean resetPasswordHistory, PasswordChangeReason reason)voidauthenticate(String username, String password)voidchangePassword(String username, String password, String newPassword)voidcreateGroup(Group group)voidcreateUser(User user, boolean expiredPassword, boolean userLocked)voiddeleteGroup(String groupName)voiddeleteUser(String username)List<User>findUsers(List<UserAttribute> userAttributes)UserDirectoryCapabilitiesgetCapabilities()List<String>getFunctionCodesForUser(String username)GroupgetGroup(String groupName)List<String>getGroupNames()List<String>getGroupNamesForUser(String username)List<Group>getGroups()GroupsgetGroups(String filter, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize)List<Group>getGroupsForUser(String username)List<GroupMember>getMembersForGroup(String groupName)GroupMembersgetMembersForGroup(String groupName, String filter, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize)List<String>getRoleCodesForGroup(String groupName)List<String>getRoleCodesForUser(String username)List<GroupRole>getRolesForGroup(String groupName)UsergetUser(String username)StringgetUserName(String username)List<User>getUsers()UsersgetUsers(String filter, UserSortBy sortBy, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize)booleanisExistingUser(String username)booleanisUserInGroup(String groupName, String username)voidremoveMemberFromGroup(String groupName, GroupMemberType memberType, String memberName)voidremoveRoleFromGroup(String groupName, String roleCode)voidremoveUserFromGroup(String groupName, String username)voidresetPassword(String username, String newPassword)voidupdateGroup(Group group)voidupdateUser(User user, boolean expirePassword, boolean lockUser)-
Methods inherited from class africa.absa.inception.security.UserDirectoryBase
getGroupRepository, getParameters, getRoleRepository, getUserDirectoryId, getUserRepository, isNullOrEmpty
-
-
-
-
Constructor Detail
-
InternalUserDirectory
public InternalUserDirectory(UUID userDirectoryId, List<UserDirectoryParameter> parameters, GroupRepository groupRepository, UserRepository userRepository, RoleRepository roleRepository) throws africa.absa.inception.core.service.ServiceUnavailableException
Constructs a new InternalUserDirectory.- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directoryparameters- the parameters for the user directorygroupRepository- the Group RepositoryuserRepository- the User RepositoryroleRepository- the Role Repository- Throws:
africa.absa.inception.core.service.ServiceUnavailableException- if the internal user directory could not be initialized
-
-
Method Detail
-
addMemberToGroup
public void addMemberToGroup(String groupName, GroupMemberType memberType, String memberName) throws GroupNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
GroupNotFoundExceptionUserNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
addRoleToGroup
public void addRoleToGroup(String groupName, String roleCode) throws GroupNotFoundException, RoleNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
GroupNotFoundExceptionRoleNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
addUserToGroup
public void addUserToGroup(String groupName, String username) throws GroupNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
GroupNotFoundExceptionUserNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
adminChangePassword
public void adminChangePassword(String username, String newPassword, boolean expirePassword, boolean lockUser, boolean resetPasswordHistory, PasswordChangeReason reason) throws UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
UserNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
authenticate
public void authenticate(String username, String password) throws AuthenticationFailedException, UserLockedException, ExpiredPasswordException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
AuthenticationFailedExceptionUserLockedExceptionExpiredPasswordExceptionUserNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
changePassword
public void changePassword(String username, String password, String newPassword) throws AuthenticationFailedException, UserLockedException, ExistingPasswordException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
AuthenticationFailedExceptionUserLockedExceptionExistingPasswordExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
createGroup
public void createGroup(Group group) throws DuplicateGroupException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
DuplicateGroupExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
createUser
public void createUser(User user, boolean expiredPassword, boolean userLocked) throws DuplicateUserException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
DuplicateUserExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
deleteGroup
public void deleteGroup(String groupName) throws GroupNotFoundException, ExistingGroupMembersException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
GroupNotFoundExceptionExistingGroupMembersExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
deleteUser
public void deleteUser(String username) throws UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
UserNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
findUsers
public List<User> findUsers(List<UserAttribute> userAttributes) throws InvalidAttributeException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
InvalidAttributeExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
getCapabilities
public UserDirectoryCapabilities getCapabilities()
-
getFunctionCodesForUser
public List<String> getFunctionCodesForUser(String username) throws UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
UserNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
getGroup
public Group getGroup(String groupName) throws GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
GroupNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
getGroupNames
public List<String> getGroupNames() throws africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
africa.absa.inception.core.service.ServiceUnavailableException
-
getGroupNamesForUser
public List<String> getGroupNamesForUser(String username) throws UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
UserNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
getGroups
public List<Group> getGroups() throws africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
africa.absa.inception.core.service.ServiceUnavailableException
-
getGroups
public Groups getGroups(String filter, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize) throws africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
africa.absa.inception.core.service.ServiceUnavailableException
-
getGroupsForUser
public List<Group> getGroupsForUser(String username) throws UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
UserNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
getMembersForGroup
public List<GroupMember> getMembersForGroup(String groupName) throws GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
GroupNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
getMembersForGroup
public GroupMembers getMembersForGroup(String groupName, String filter, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize) throws GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
GroupNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
getRoleCodesForGroup
public List<String> getRoleCodesForGroup(String groupName) throws GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
GroupNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
getRoleCodesForUser
public List<String> getRoleCodesForUser(String username) throws UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
UserNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
getRolesForGroup
public List<GroupRole> getRolesForGroup(String groupName) throws GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
GroupNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
getUser
public User getUser(String username) throws UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
UserNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
getUserName
public String getUserName(String username) throws UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
UserNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
getUsers
public List<User> getUsers() throws africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
africa.absa.inception.core.service.ServiceUnavailableException
-
getUsers
public Users getUsers(String filter, UserSortBy sortBy, africa.absa.inception.core.sorting.SortDirection sortDirection, Integer pageIndex, Integer pageSize) throws africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
africa.absa.inception.core.service.ServiceUnavailableException
-
isExistingUser
public boolean isExistingUser(String username) throws africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
africa.absa.inception.core.service.ServiceUnavailableException
-
isUserInGroup
public boolean isUserInGroup(String groupName, String username) throws UserNotFoundException, GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
UserNotFoundExceptionGroupNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
removeMemberFromGroup
public void removeMemberFromGroup(String groupName, GroupMemberType memberType, String memberName) throws GroupNotFoundException, GroupMemberNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
GroupNotFoundExceptionGroupMemberNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
removeRoleFromGroup
public void removeRoleFromGroup(String groupName, String roleCode) throws GroupNotFoundException, GroupRoleNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
GroupNotFoundExceptionGroupRoleNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
removeUserFromGroup
public void removeUserFromGroup(String groupName, String username) throws GroupNotFoundException, UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
GroupNotFoundExceptionUserNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
resetPassword
public void resetPassword(String username, String newPassword) throws UserNotFoundException, UserLockedException, ExistingPasswordException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
UserNotFoundExceptionUserLockedExceptionExistingPasswordExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
updateGroup
public void updateGroup(Group group) throws GroupNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
GroupNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
updateUser
public void updateUser(User user, boolean expirePassword, boolean lockUser) throws UserNotFoundException, africa.absa.inception.core.service.ServiceUnavailableException
- Throws:
UserNotFoundExceptionafrica.absa.inception.core.service.ServiceUnavailableException
-
-