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 OrganizationDataService
OrganizationManager
provides 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:
getOrganization
in interfaceOrganizationDataService
-
suggestById
public Organization suggestById(String id)
Description copied from interface:OrganizationDataService
Find 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:
suggestById
in interfaceOrganizationDataService
- Parameters:
id
- the role id- Returns:
- group
-
findBeans
public OrganizationListResponse findBeans(OrganizationSearchBean searchBean, int from, int size)
- Specified by:
findBeans
in interfaceOrganizationDataService
-
getParentOrganizations
@Deprecated public List<Organization> getParentOrganizations(String orgId, int from, int size)
Deprecated.- Specified by:
getParentOrganizations
in interfaceOrganizationDataService
-
getChildOrganizations
public List<Organization> getChildOrganizations(String orgId, int from, int size)
- Specified by:
getChildOrganizations
in interfaceOrganizationDataService
-
getNumOfParentOrganizations
@Deprecated public int getNumOfParentOrganizations(String orgId)
Deprecated.- Specified by:
getNumOfParentOrganizations
in interfaceOrganizationDataService
-
getNumOfChildOrganizations
@Deprecated public int getNumOfChildOrganizations(String orgId)
Deprecated.- Specified by:
getNumOfChildOrganizations
in interfaceOrganizationDataService
-
count
public int count(OrganizationSearchBean searchBean)
- Specified by:
count
in interfaceOrganizationDataService
-
getAllowedParentOrganizationsForType
public List<Organization> getAllowedParentOrganizationsForType(String orgTypeId)
- Specified by:
getAllowedParentOrganizationsForType
in interfaceOrganizationDataService
-
getOrganizationsForUserByType
public List<Organization> getOrganizationsForUserByType(String userId, String organizationTypeId)
- Specified by:
getOrganizationsForUserByType
in interfaceOrganizationDataService
-
saveOrganization
public Response saveOrganization(Organization organization)
- Specified by:
saveOrganization
in interfaceOrganizationDataService
-
saveOrganizationWithSkipPrePostProcessors
public Response saveOrganizationWithSkipPrePostProcessors(Organization organization, boolean skipPrePostProcessors)
- Specified by:
saveOrganizationWithSkipPrePostProcessors
in interfaceOrganizationDataService
-
removeChildOrganization
public Response removeChildOrganization(String organizationId, String childOrganizationId)
- Specified by:
removeChildOrganization
in interfaceOrganizationDataService
-
addChildOrganization
public Response addChildOrganization(String organizationId, String childOrganizationId, Set<String> rightIds, Date startDate, Date endDate)
- Specified by:
addChildOrganization
in interfaceOrganizationDataService
-
addRoleToOrganization
public Response addRoleToOrganization(String organizationId, String roleId, Set<String> rightIds, Date startDate, Date endDate)
- Specified by:
addRoleToOrganization
in interfaceOrganizationDataService
-
removeRoleFromOrganization
public Response removeRoleFromOrganization(String organizationId, String roleId)
- Specified by:
removeRoleFromOrganization
in interfaceOrganizationDataService
-
addResourceToOrganization
public Response addResourceToOrganization(String organizationId, String resourceId, Set<String> rightIds, Date startDate, Date endDate)
- Specified by:
addResourceToOrganization
in interfaceOrganizationDataService
-
removeResourceFromOrganization
public Response removeResourceFromOrganization(String organizationId, String resourceId)
- Specified by:
removeResourceFromOrganization
in interfaceOrganizationDataService
-
addGroupToOrganization
public Response addGroupToOrganization(String organizationId, String groupId, Set<String> rightIds, Date startDate, Date endDate)
- Specified by:
addGroupToOrganization
in interfaceOrganizationDataService
-
removeGroupFromOrganization
public Response removeGroupFromOrganization(String organizationId, String groupId)
- Specified by:
removeGroupFromOrganization
in interfaceOrganizationDataService
-
deleteOrganization
public Response deleteOrganization(String orgId)
- Specified by:
deleteOrganization
in interfaceOrganizationDataService
-
deleteOrganizationWithSkipPrePostProcessors
public Response deleteOrganizationWithSkipPrePostProcessors(String orgId, boolean skipPrePostProcessors)
- Specified by:
deleteOrganizationWithSkipPrePostProcessors
in interfaceOrganizationDataService
-
validateEdit
public Response validateEdit(Organization organization)
- Specified by:
validateEdit
in interfaceOrganizationDataService
-
validateDelete
public Response validateDelete(String id)
- Specified by:
validateDelete
in interfaceOrganizationDataService
-
canAddUserToOrganization
public Response canAddUserToOrganization(String organizationId, String userId, Date startDate, Date endDate)
- Specified by:
canAddUserToOrganization
in interfaceOrganizationDataService
-
canRemoveUserToOrganization
public Response canRemoveUserToOrganization(String organizationId, String userId)
- Specified by:
canRemoveUserToOrganization
in interfaceOrganizationDataService
-
addLocation
public Response addLocation(Location val)
- Specified by:
addLocation
in interfaceOrganizationDataService
-
updateLocation
public Response updateLocation(Location location)
- Specified by:
updateLocation
in interfaceOrganizationDataService
-
removeLocation
public Response removeLocation(String locationId)
- Specified by:
removeLocation
in interfaceOrganizationDataService
-
getLocationById
public Location getLocationById(String locationId)
- Specified by:
getLocationById
in interfaceOrganizationDataService
-
findLocationBeans
public List<Location> findLocationBeans(LocationSearchBean searchBean, int from, int size)
- Specified by:
findLocationBeans
in interfaceOrganizationDataService
-
getNumOfLocations
public int getNumOfLocations(LocationSearchBean searchBean)
- Specified by:
getNumOfLocations
in interfaceOrganizationDataService
-
getLocationListByPageForUser
@Transactional(readOnly=true) public List<Location> getLocationListByPageForUser(String userId, int from, int size)
- Specified by:
getLocationListByPageForUser
in interfaceOrganizationDataService
-
getOrganizationAttributes
public List<OrganizationAttribute> getOrganizationAttributes(String orgId)
- Specified by:
getOrganizationAttributes
in interfaceOrganizationDataService
-
isIndexed
public boolean isIndexed(String organizationId)
Description copied from interface:OrganizationDataService
Checks if a Organization has been indexed in the search engine (currently ElasticSearch)- Specified by:
isIndexed
in interfaceOrganizationDataService
- Returns:
-
getDetachedForUser
public OrganizationListResponse getDetachedForUser(String userId, String name, int from, int size)
Description copied from interface:OrganizationDataService
method is used to detect all user's organizations that are not linked with any resources.- Specified by:
getDetachedForUser
in 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:OrganizationDataService
method 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:
getWithResources
in interfaceOrganizationDataService
- Parameters:
userId
- - user idsearchBean
- - searchBean for objectsresourceTypeIds
- - types of resources to fetchfrom
- - zero based very first resultsize
- - total size of page.- Returns:
GroupListResponse
with requested objects
-
reindexOrganization
public Response reindexOrganization(String id)
- Specified by:
reindexOrganization
in interfaceOrganizationDataService
-
-