Interface OrganizationDataService

    • Method Detail

      • suggestById

        Organization suggestById​(String id)
        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
        Parameters:
        id - the role id
        Returns:
        group
      • getNumOfParentOrganizations

        @Deprecated
        int getNumOfParentOrganizations​(String orgId)
        Deprecated.
      • getNumOfChildOrganizations

        @Deprecated
        int getNumOfChildOrganizations​(String orgId)
        Deprecated.
      • saveOrganizationWithSkipPrePostProcessors

        Response saveOrganizationWithSkipPrePostProcessors​(Organization organization,
                                                           boolean skipPrePostProcessors)
      • removeGroupFromOrganization

        Response removeGroupFromOrganization​(String organizationId,
                                             String groupId)
      • removeRoleFromOrganization

        Response removeRoleFromOrganization​(String organizationId,
                                            String roleId)
      • removeResourceFromOrganization

        Response removeResourceFromOrganization​(String organizationId,
                                                String resourceId)
      • deleteOrganizationWithSkipPrePostProcessors

        Response deleteOrganizationWithSkipPrePostProcessors​(String orgId,
                                                             boolean skipPrePostProcessors)
      • removeChildOrganization

        Response removeChildOrganization​(String organizationId,
                                         String childOrganizationId)
      • canRemoveUserToOrganization

        Response canRemoveUserToOrganization​(String organizationId,
                                             String userId)
      • getAllowedParentOrganizationsForType

        List<Organization> getAllowedParentOrganizationsForType​(String orgTypeId)
      • getLocationListByPageForUser

        List<Location> getLocationListByPageForUser​(String organizationId,
                                                    int from,
                                                    int size)
      • isIndexed

        boolean isIndexed​(String organizationId)
        Checks if a Organization has been indexed in the search engine (currently ElasticSearch)
        Parameters:
        organizationId -
        Returns:
      • getDetachedForUser

        OrganizationListResponse getDetachedForUser​(String userId,
                                                    String name,
                                                    int from,
                                                    int size)
        method is used to detect all user's organizations that are not linked with any resources.
        Parameters:
        userId - - id of User to check detached groups
        name - - name for case INSENSITIVE CONTAINS match search.
        from - - zero based very first result
        Returns:
        - OrganizationListResponse
      • getWithResources

        OrganizationListResponse getWithResources​(String userId,
                                                  OrganizationSearchBean searchBean,
                                                  Set<String> resourceTypeIds,
                                                  int from,
                                                  int size)
        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.
        Parameters:
        userId - - user id
        searchBean - - searchBean for objects
        resourceTypeIds - - types of resources to fetch
        from - - zero based very first result
        size - - total size of page.
        Returns:
        GroupListResponse with requested objects