@Override public User execute() throws IdentityStoreException, UserNotFoundException { return identityStore.getUser(claim); } }).pushEvent(IdentityStoreInterceptorConstants.POST_GET_USER_BY_CLAIM, (eventProperties) -> {
@Override public Void execute() throws IdentityStoreException, UserNotFoundException { identityStore.updateUserClaims(uniqueUserId, claimsToAdd, claimsToRemove); return null; } }).pushEvent(IdentityStoreInterceptorConstants.POST_UPDATE_USER_CLAIMS_PATCH, (eventProperties) -> {
@Override public User execute() throws IdentityStoreException { return identityStore.addUser(userBean); } }).pushEvent(IdentityStoreInterceptorConstants.POST_ADD_USER, (eventProperties) -> {
@Override public List<User> listUsers(List<Claim> claims, int offset, int length, String domainName) throws IdentityStoreException { return identityStore.listUsers(claims, offset, length, domainName); }
@Override public List<Claim> execute() throws IdentityStoreException, UserNotFoundException { return identityStore.getClaimsOfUser(uniqueUserId); } }).pushEvent(IdentityStoreInterceptorConstants.POST_GET_CLAIMS_OF_USER_BY_ID, (eventProperties) -> {
@Override public User getUser(String uniqueUserId) throws IdentityStoreException, UserNotFoundException { if (cacheStatus.get(UNIQUE_USER_CACHE) && isNullOrEmpty(uniqueUserId)) { return doGetUser(uniqueUserId, identityStore.getPrimaryDomainName()); } User user = identityStore.getUser(uniqueUserId); user.setIdentityStore(this); return user; }
if (identityStore.isUserExist(userBean.getClaims(), userStoreDomain)) { throw new ConflictException("User with the name: " + user.getUserName() + " already exists in the system."); userBean.setCredentials(callbackList); org.wso2.carbon.identity.mgt.User userStoreUser = identityStore.addUser(userBean, userStoreDomain); identityStore.updateGroupsOfUser(userStoreUser.getUniqueUserId(), groupIds);
List<Claim> claimsList = identityStore.getClaimsOfUser(user.getUniqueUserId()); claim.setDialectUri(dialectUri); claimsList.add(claim); identityStore.updateUserClaims(user.getUniqueUserId(), claimsList);
@Override public Void execute() throws IdentityStoreException, UserNotFoundException { identityStore.updateUserCredentials(uniqueUserId, credentialsToAdd, credentialsToRemove); return null; } }).pushEvent(IdentityStoreInterceptorConstants.POST_UPDATE_USER_CREDENTIALS_PATCH, (eventProperties) -> {
@Override public List<String> execute() throws IdentityStoreException { return identityStore.isUserExist(userClaims); } }).pushEvent(IdentityStoreInterceptorConstants.POST_IS_USER_EXIST, (eventProperties) -> {
@Override public void deleteUser(String userId) throws NotFoundException, CharonException, NotImplementedException, BadRequestException { if (log.isDebugEnabled()) { log.debug("Deleting user: " + userId); } try { org.wso2.carbon.identity.mgt.User user = identityStore.getUser(userId); List<Claim> claims = user.getClaims(); boolean isAdminUser = claims.stream().anyMatch(claim -> USERNAME_CLAIM.equals(claim.getClaimUri()) && ADMIN_USERNAME.equals(claim.getValue())); if (isAdminUser) { throw new BadRequestException("Cannot Delete admin user from the System"); } identityStore.deleteUser(userId); if (log.isDebugEnabled()) { log.debug("User with the id : " + userId + " is deleted through SCIM."); } } catch (UserNotFoundException e) { throw new NotFoundException("User with the user id : " + userId + " does not exists."); } catch (IdentityStoreException e) { throw new CharonException("Error in deleting the user with the id: " + userId, e); } }
@Override public void deleteUser(String uniqueUserId) throws IdentityStoreException, UserNotFoundException { identityStore.deleteUser(uniqueUserId); doDeleteUser(uniqueUserId, identityStore.getPrimaryDomainName()); }
@Override public void deleteGroup(String uniqueGroupId) throws IdentityStoreException, GroupNotFoundException { identityStore.deleteGroup(uniqueGroupId); doDeleteGroup(uniqueGroupId, identityStore.getPrimaryDomainName()); }
if (identityStore.isGroupExist(groupBean.getClaims(), userStoreDomain)) { throw new ConflictException("Group with the name: " + group.getDisplayName() + " already exists in the system."); userStoreGroup = identityStore.addGroup(groupBean, userStoreDomain); identityStore.updateUsersOfGroup(userStoreGroup.getUniqueGroupId(), userIds);
@Override public Group getGroup(String uniqueGroupId) throws IdentityStoreException, GroupNotFoundException { if (cacheStatus.get(UNIQUE_GROUP_CACHE) && !isNullOrEmpty(uniqueGroupId)) { return doGetGroup(uniqueGroupId, identityStore.getPrimaryDomainName()); } Group group = identityStore.getGroup(uniqueGroupId); group.setIdentityStore(this); return group; }
@Override public String execute() throws IdentityStoreException { return identityStore.getPrimaryDomainName(); } }).pushEvent(IdentityStoreInterceptorConstants.POST_GET_PRIMARY_DOMAIN_NAME, (eventProperties) -> {
@Override public Group execute() throws IdentityStoreException { return identityStore.addGroup(groupBean); } }).pushEvent(IdentityStoreInterceptorConstants.POST_ADD_GROUP_BY_DOMAIN, (eventProperties) -> {
@Override public AuthenticationContext authenticate(Claim claim, Callback[] credentials, String domainName) throws AuthenticationFailure, IdentityStoreException { return identityStore.authenticate(claim, credentials, domainName); }
@Override public List<User> execute() throws IdentityStoreException { return identityStore.listUsers(metaClaim, filterPattern, offset, length, domainName); } }).pushEvent(IdentityStoreInterceptorConstants.POST_LIST_USERS_BY_META_CLAIM_DOMAIN, (eventProperties) -> {
@Override public List<Claim> getClaimsOfUser(String uniqueUserId, List<MetaClaim> metaClaims) throws IdentityStoreException, UserNotFoundException { return identityStore.getClaimsOfUser(uniqueUserId, metaClaims); }