Package org.openiam.common.beans.mq
Class UserRabbitMQService
- java.lang.Object
-
- org.openiam.common.beans.mq.AbstractRabbitMQService
-
- org.openiam.common.beans.mq.UserRabbitMQService
-
@Component public final class UserRabbitMQService extends AbstractRabbitMQService
The purpose of this class is to provide common read-only operations with respect to the User object, which are read by multiple Spring Boot modules
-
-
Field Summary
-
Fields inherited from class org.openiam.common.beans.mq.AbstractRabbitMQService
rabbitMQSender
-
-
Constructor Summary
Constructors Constructor Description UserRabbitMQService(UserServiceQueue userServiceQueue, UserFindBeansQueue userFindBeansQueue, OrphanQueue orphanQueue, GetUserWithDependenciesQueue getUserWithDependenciesQueue, UserSaveQueue userSaveQueue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResourceToUsers(String resourceId, Set<String> rightIds, Set<String> userIds)intcount(UserSearchBean sb)voiddeleteOrphans(List<Orphan> orphans, boolean deleteFromTarget)method deleteOrphan is used delete information from ESResponsedeleteUser(User user)List<User>findBeans(UserSearchBean sb, UserCollection[] dependants, int from, int size)UserListResponsefindBeansResponse(UserSearchBean sb, UserCollection[] dependants, int from, int size)OrphanListResponsefindOrphans(UserSearchBean userSearchBean, int from, int size)List<Supervisor>getSupervisors(String id, UserCollection[] dependants, int from, int size)List<Supervisor>getSupervisorsWithTypes(String id, UserCollection[] dependants, int from, int size)UsergetUser(String principal, String managedSystemId, UserCollection[] dependants)UsergetUser(String userId, UserCollection[] dependants)Fetches a user by id from the database.List<UserSshKey>getUserSshKeys(UserSshKeySearchBean searchBean, int from, int size)ResponsemovePrincipalToOrphans(String loginId)ProvisionUserResponsesave(ProvisionUser pUser, UserCollection[] dependants)Save a ProvisionUser object, without calling Provisioning, sync callProvisionUserResponsesave(ProvisionUser pUser, UserCollection[] dependants, boolean isCalledByProvisioning)Save a ProvisionUser object, without calling ProvisioningResponsesaveAlternateContact(String userId, String alternateId, Date alternateStartDate, Date alternateEndDate)method saveAlternateContact is used to set up alternate contact independently from save operation.voidsaveAsyncMode(ProvisionUser pUser, UserCollection[] dependants)Save a ProvisionUser object, without calling Provisioning, async callResponsesaveOrphans(List<Orphan> orphans)method saveOrphan is used save information in ES about accounts were detected as orphansUsersuggestById(String id)Fetches a user by id from elasticsearch.voidupdateUserEntitlementStatusRevoked(String memberEntityId, Set<String> entityIds, String type)voidvalidate(ProvisionUser pUser)-
Methods inherited from class org.openiam.common.beans.mq.AbstractRabbitMQService
crudRequest, idRequest
-
-
-
-
Constructor Detail
-
UserRabbitMQService
public UserRabbitMQService(UserServiceQueue userServiceQueue, UserFindBeansQueue userFindBeansQueue, OrphanQueue orphanQueue, GetUserWithDependenciesQueue getUserWithDependenciesQueue, UserSaveQueue userSaveQueue)
-
-
Method Detail
-
getUser
public User getUser(String userId, UserCollection[] dependants)
Fetches a user by id from the database.- Parameters:
userId- user iddependants- UserCollection that should be included in user dto- Returns:
- User dto
-
suggestById
public User suggestById(String id)
Fetches a user by id from elasticsearch. This is considerably faster than going to the database, but may contain slightly out-of-date information- Parameters:
id- user id- Returns:
- User dto
-
getUser
public User getUser(String principal, String managedSystemId, UserCollection[] dependants)
-
save
public ProvisionUserResponse save(ProvisionUser pUser, UserCollection[] dependants) throws BasicDataServiceException
Save a ProvisionUser object, without calling Provisioning, sync call- Parameters:
pUser- user to save / updatedependants- user's collections details- Returns:
- Throws:
BasicDataServiceException
-
save
public ProvisionUserResponse save(ProvisionUser pUser, UserCollection[] dependants, boolean isCalledByProvisioning) throws BasicDataServiceException
Save a ProvisionUser object, without calling Provisioning- Parameters:
pUser- user to save / updatedependants- user's collections detailsisCalledByProvisioning- indicates whether method was called by the provisioning service- Returns:
- Throws:
BasicDataServiceException
-
saveAsyncMode
public void saveAsyncMode(ProvisionUser pUser, UserCollection[] dependants)
Save a ProvisionUser object, without calling Provisioning, async call- Parameters:
pUser-- Throws:
BasicDataServiceException
-
findBeans
public List<User> findBeans(UserSearchBean sb, UserCollection[] dependants, int from, int size)
-
validate
public void validate(ProvisionUser pUser) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
getSupervisors
public List<Supervisor> getSupervisors(String id, UserCollection[] dependants, int from, int size)
-
saveAlternateContact
public Response saveAlternateContact(String userId, String alternateId, Date alternateStartDate, Date alternateEndDate)
method saveAlternateContact is used to set up alternate contact independently from save operation.- Parameters:
userId-alternateId-alternateStartDate-alternateEndDate-- Returns:
-
getSupervisorsWithTypes
public List<Supervisor> getSupervisorsWithTypes(String id, UserCollection[] dependants, int from, int size)
-
saveOrphans
public Response saveOrphans(List<Orphan> orphans)
method saveOrphan is used save information in ES about accounts were detected as orphans- Parameters:
orphans- List of orphan object collected during sync
-
deleteOrphans
public void deleteOrphans(List<Orphan> orphans, boolean deleteFromTarget)
method deleteOrphan is used delete information from ES- Parameters:
orphans- List of orphan objectdeleteFromTarget- flag to send delete operation to connector
-
findOrphans
public OrphanListResponse findOrphans(UserSearchBean userSearchBean, int from, int size)
-
addResourceToUsers
public void addResourceToUsers(String resourceId, Set<String> rightIds, Set<String> userIds)
-
updateUserEntitlementStatusRevoked
public void updateUserEntitlementStatusRevoked(String memberEntityId, Set<String> entityIds, String type)
- Parameters:
memberEntityId- user's identityIds- roles or groups idstype- could be either "ROLE" either "GROUP"
-
getUserSshKeys
public List<UserSshKey> getUserSshKeys(UserSshKeySearchBean searchBean, int from, int size)
-
count
public int count(UserSearchBean sb)
-
findBeansResponse
public UserListResponse findBeansResponse(UserSearchBean sb, UserCollection[] dependants, int from, int size)
-
-