Package org.openiam.srvc.am
Class OrganizationDataServiceImpl
- java.lang.Object
-
- org.openiam.srvc.AbstractApiService
-
- org.openiam.srvc.am.OrganizationDataServiceImpl
-
- All Implemented Interfaces:
OrganizationDataService
@Service("orgManager") public class OrganizationDataServiceImpl extends AbstractApiService implements OrganizationDataServiceOrganizationManagerprovides a service level interface to the Organization components and its dependant objects as well as search capability.
- Version:
- 2
- Author:
- OpenIAm
-
-
Field Summary
-
Fields inherited from class org.openiam.srvc.AbstractApiService
applicationContext, log, rabbitMQSender
-
-
Constructor Summary
Constructors Constructor Description OrganizationDataServiceImpl(OrganizationQueue queue)
-
Method Summary
-
Methods inherited from class org.openiam.srvc.AbstractApiService
broadcast, crudRequest, getBooleanValue, getIntValue, getIntValue, getRabbitMqQueue, getResponse, getResponse, getValue, getValue, getValueList, getValueList, idRequest, manageApiRequest, manageApiRequest, manageCrudApiRequest, manageCrudApiRequest, manageCrudApiRequest, manageCrudApiRequest, membershipRequestProcessing, membershipRequestProcessing, publish, publish, sendAsync, sendAsync
-
-
-
-
Constructor Detail
-
OrganizationDataServiceImpl
@Autowired public OrganizationDataServiceImpl(OrganizationQueue queue)
-
-
Method Detail
-
getOrganization
public Organization getOrganization(String orgId)
- Specified by:
getOrganizationin interfaceOrganizationDataService
-
suggestById
public Organization suggestById(String id)
Description copied from interface:OrganizationDataServiceFind a organization in Elasticsearch. Significantly faster than going to the database. Use this method when performance is important and/or data integrity is not 100% required, as the database and ES may be out of sync for a period of time- Specified by:
suggestByIdin interfaceOrganizationDataService- Parameters:
id- the role id- Returns:
- group
-
findBeans
public OrganizationListResponse findBeans(OrganizationSearchBean searchBean, int from, int size)
- Specified by:
findBeansin interfaceOrganizationDataService
-
getParentOrganizations
@Deprecated public List<Organization> getParentOrganizations(String orgId, int from, int size)
Deprecated.- Specified by:
getParentOrganizationsin interfaceOrganizationDataService
-
getChildOrganizations
public List<Organization> getChildOrganizations(String orgId, int from, int size)
- Specified by:
getChildOrganizationsin interfaceOrganizationDataService
-
getNumOfParentOrganizations
@Deprecated public int getNumOfParentOrganizations(String orgId)
Deprecated.- Specified by:
getNumOfParentOrganizationsin interfaceOrganizationDataService
-
getNumOfChildOrganizations
@Deprecated public int getNumOfChildOrganizations(String orgId)
Deprecated.- Specified by:
getNumOfChildOrganizationsin interfaceOrganizationDataService
-
count
public int count(OrganizationSearchBean searchBean)
- Specified by:
countin interfaceOrganizationDataService
-
getAllowedParentOrganizationsForType
public List<Organization> getAllowedParentOrganizationsForType(String orgTypeId)
- Specified by:
getAllowedParentOrganizationsForTypein interfaceOrganizationDataService
-
getOrganizationsForUserByType
public List<Organization> getOrganizationsForUserByType(String userId, String organizationTypeId)
- Specified by:
getOrganizationsForUserByTypein interfaceOrganizationDataService
-
saveOrganization
public Response saveOrganization(Organization organization)
- Specified by:
saveOrganizationin interfaceOrganizationDataService
-
saveOrganizationWithSkipPrePostProcessors
public Response saveOrganizationWithSkipPrePostProcessors(Organization organization, boolean skipPrePostProcessors)
- Specified by:
saveOrganizationWithSkipPrePostProcessorsin interfaceOrganizationDataService
-
removeChildOrganization
public Response removeChildOrganization(String organizationId, String childOrganizationId)
- Specified by:
removeChildOrganizationin interfaceOrganizationDataService
-
addChildOrganization
public Response addChildOrganization(String organizationId, String childOrganizationId, Set<String> rightIds, Date startDate, Date endDate)
- Specified by:
addChildOrganizationin interfaceOrganizationDataService
-
addRoleToOrganization
public Response addRoleToOrganization(String organizationId, String roleId, Set<String> rightIds, Date startDate, Date endDate)
- Specified by:
addRoleToOrganizationin interfaceOrganizationDataService
-
removeRoleFromOrganization
public Response removeRoleFromOrganization(String organizationId, String roleId)
- Specified by:
removeRoleFromOrganizationin interfaceOrganizationDataService
-
addResourceToOrganization
public Response addResourceToOrganization(String organizationId, String resourceId, Set<String> rightIds, Date startDate, Date endDate)
- Specified by:
addResourceToOrganizationin interfaceOrganizationDataService
-
removeResourceFromOrganization
public Response removeResourceFromOrganization(String organizationId, String resourceId)
- Specified by:
removeResourceFromOrganizationin interfaceOrganizationDataService
-
addGroupToOrganization
public Response addGroupToOrganization(String organizationId, String groupId, Set<String> rightIds, Date startDate, Date endDate)
- Specified by:
addGroupToOrganizationin interfaceOrganizationDataService
-
removeGroupFromOrganization
public Response removeGroupFromOrganization(String organizationId, String groupId)
- Specified by:
removeGroupFromOrganizationin interfaceOrganizationDataService
-
deleteOrganization
public Response deleteOrganization(String orgId)
- Specified by:
deleteOrganizationin interfaceOrganizationDataService
-
deleteOrganizationWithSkipPrePostProcessors
public Response deleteOrganizationWithSkipPrePostProcessors(String orgId, boolean skipPrePostProcessors)
- Specified by:
deleteOrganizationWithSkipPrePostProcessorsin interfaceOrganizationDataService
-
validateEdit
public Response validateEdit(Organization organization)
- Specified by:
validateEditin interfaceOrganizationDataService
-
validateDelete
public Response validateDelete(String id)
- Specified by:
validateDeletein interfaceOrganizationDataService
-
canAddUserToOrganization
public Response canAddUserToOrganization(String organizationId, String userId, Date startDate, Date endDate)
- Specified by:
canAddUserToOrganizationin interfaceOrganizationDataService
-
canRemoveUserToOrganization
public Response canRemoveUserToOrganization(String organizationId, String userId)
- Specified by:
canRemoveUserToOrganizationin interfaceOrganizationDataService
-
addLocation
public Response addLocation(Location val)
- Specified by:
addLocationin interfaceOrganizationDataService
-
updateLocation
public Response updateLocation(Location location)
- Specified by:
updateLocationin interfaceOrganizationDataService
-
removeLocation
public Response removeLocation(String locationId)
- Specified by:
removeLocationin interfaceOrganizationDataService
-
getLocationById
public Location getLocationById(String locationId)
- Specified by:
getLocationByIdin interfaceOrganizationDataService
-
findLocationBeans
public List<Location> findLocationBeans(LocationSearchBean searchBean, int from, int size)
- Specified by:
findLocationBeansin interfaceOrganizationDataService
-
getNumOfLocations
public int getNumOfLocations(LocationSearchBean searchBean)
- Specified by:
getNumOfLocationsin interfaceOrganizationDataService
-
getLocationListByPageForUser
@Transactional(readOnly=true) public List<Location> getLocationListByPageForUser(String userId, int from, int size)
- Specified by:
getLocationListByPageForUserin interfaceOrganizationDataService
-
getOrganizationAttributes
public List<OrganizationAttribute> getOrganizationAttributes(String orgId)
- Specified by:
getOrganizationAttributesin interfaceOrganizationDataService
-
isIndexed
public boolean isIndexed(String organizationId)
Description copied from interface:OrganizationDataServiceChecks if a Organization has been indexed in the search engine (currently ElasticSearch)- Specified by:
isIndexedin interfaceOrganizationDataService- Returns:
-
getDetachedForUser
public OrganizationListResponse getDetachedForUser(String userId, String name, int from, int size)
Description copied from interface:OrganizationDataServicemethod is used to detect all user's organizations that are not linked with any resources.- Specified by:
getDetachedForUserin interfaceOrganizationDataService- Parameters:
userId- - id of User to check detached groupsname- - name for case INSENSITIVE CONTAINS match search.from- - zero based very first result- Returns:
- -
OrganizationListResponse
-
getWithResources
public OrganizationListResponse getWithResources(String userId, OrganizationSearchBean searchBean, Set<String> resourceTypeIds, int from, int size)
Description copied from interface:OrganizationDataServicemethod is used to get user's organizaiotn with entitled resources. filter #resourceTypeIds - does't work for organization due to global restrictions. need to refactor.- Specified by:
getWithResourcesin interfaceOrganizationDataService- Parameters:
userId- - user idsearchBean- - searchBean for objectsresourceTypeIds- - types of resources to fetchfrom- - zero based very first resultsize- - total size of page.- Returns:
GroupListResponsewith requested objects
-
reindexOrganization
public Response reindexOrganization(String id)
- Specified by:
reindexOrganizationin interfaceOrganizationDataService
-
-