Package org.openiam.srvc.am
Interface ResourceDataService
-
- All Known Implementing Classes:
ResourceDataServiceImpl
public interface ResourceDataService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Response
addChildResource(String resourceId, String memberResourceId, Set<String> rights, Date startDate, Date endDate)
add a child resource to a parentResponse
addGroupToResource(String resourceId, String groupId, Set<String> rightIds, Date startDate, Date endDate)
Entitles a Group to a ResourceResponse
addRoleToResource(String resourceId, String roleId, Set<String> rightIds, Date startDate, Date endDate)
entitle a Role to a ResourceResponse
bulkEntitlementsRequest(MembershipsRequest request)
entitle a Groups / Roles / Child resources to a ResourceResponse
canAddUserToResource(String userId, String resourceId)
Tells the caller if the user can be entitled to this resourceResponse
canRemoveUserFromResource(String userId, String resourceId)
Tells the caller if the user can be disentitled from this resourceint
count(ResourceSearchBean searchBean)
count the number of resources based on the searchBeanint
countResourceTypes(ResourceTypeSearchBean searchBean)
Response
deleteChildResource(String resourceId, String memberResourceIdd)
Removes a child resource from a parentResponse
deleteQuestionnaire(String questionnaireId)
Response
deleteResource(String resourceId)
Deletes a ResoruceResponse
deleteResourceType(String resourceTypeId)
ResourceListResponse
findBeans(ResourceSearchBean searchBean, EntitlementsCollection[] dependants, int from, int size)
Search a ResourceList<ResourceProp>
findResourceProps(ResourceAttributeSearchBean sb, int from, int size)
List<ResourceType>
findResourceTypes(ResourceTypeSearchBean searchBean, int from, int size)
List<String>
getAllResourceIds()
Method to get all Resource IDs This method should not be called at run-time.List<ResourceType>
getAllResourceTypes()
Find all resource types.ResourceEntitlementsListResponse
getBulkUsersCommonOneLevelAccess(List<String> userIds, String resourceSearchQuery, UserCollection[] accessTypes, int from, int size)
Method is used to retrieve bulk users common applications (content provider, managed systems, manual managed systems, auth providers) with User's roles/groups/organizations (based on accessTypes param)ResourceEntitlementsListResponse
getOneLevelAccess(String userId, String resourceSearchQuery, UserCollection[] accessTypes, int from, int size)
Method is used to retrieve all user's applications (content provider, managed systems, manual managed systems, auth providers) with User's roles/groups/organizations (based on accessTypes param)ResourceEntitlementsListResponse
getOneLevelAccessWithResourceTypes(String userId, String resourceSearchQuery, UserCollection[] accessTypes, Set<String> includeResourceTypeIds, Set<String> excludeResourceTypeIds, int from, int size)
Method is used to retrieve all user's resources based on resource types defined as #includeResourceTypes and #excludeResourceTypes with User's roles/groups/organizations/resources (based on accessTypes param)QuestionnairesResponse
getQuestionnaireForResource(String resourceId)
QuestionnairesResponse
getQuestionnairesForResources(List<String> resourceIdList, boolean isDeepCopy)
Search for questionnaires by using resources Ids list.Resource
getResource(String resourceId)
Find a resource.List<Resource>
getUserApplicationCategories(String userId, String rootResourceId)
Method is user to get Application categories for given user id. since v4.1.8 users should be authorized to see categories.boolean
isIndexed(String resourceId)
Checks if a Reource has been indexed in the search engine (currently ElasticSearch)boolean
isMemberOfAnyEntity(String resourceId)
Response
reindexResource(String id)
Response
removeGroupToResource(String resourceId, String groupId)
Disentitles a Group from a ResourceResponse
removeRoleToResource(String resourceId, String roleId)
Disentitles a Resource from a RoleResponse
saveQuestionnaire(Questionnaire questionnaire)
Response
saveResource(Resource resource)
Add a new resource from a transient resource object and sets resourceId in the returned object.Response
saveResourceType(ResourceType resourceType)
ResourceSelectAccess
selectAccess(Set<String> resourceIds, String searchFilter, int size)
Method will return the list of resource for given resource ids.Resource
suggestById(String resourceId)
Find a resource in Elasticsearch.Response
validateAddChildResource(String resourceId, String childResourceId, Set<String> rights, Date startDate, Date endDate)
Response
validateDelete(String resourceId)
Response
validateEdit(Resource resource)
Validate if the resource can be created
-
-
-
Method Detail
-
isMemberOfAnyEntity
boolean isMemberOfAnyEntity(String resourceId)
-
validateEdit
Response validateEdit(Resource resource)
Validate if the resource can be created- Parameters:
resource
- - the Resource- Returns:
-
deleteResource
Response deleteResource(String resourceId)
Deletes a Resoruce- Parameters:
resourceId
- - the resource id- Returns:
-
saveResource
Response saveResource(Resource resource)
Add a new resource from a transient resource object and sets resourceId in the returned object.- Parameters:
resource
-- Returns:
-
getResource
Resource getResource(String resourceId)
Find a resource.- Parameters:
resourceId
- the resource id- Returns:
- resource
-
suggestById
Resource suggestById(String resourceId)
Find a resource 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:
resourceId
- the resource id- Returns:
- resource
-
isIndexed
boolean isIndexed(String resourceId)
Checks if a Reource has been indexed in the search engine (currently ElasticSearch)- Parameters:
resourceId
-- Returns:
-
findResourceProps
List<ResourceProp> findResourceProps(ResourceAttributeSearchBean sb, int from, int size)
-
getAllResourceTypes
List<ResourceType> getAllResourceTypes()
Find all resource types.- Returns:
- the all resource types
-
findResourceTypes
List<ResourceType> findResourceTypes(ResourceTypeSearchBean searchBean, int from, int size)
-
findBeans
ResourceListResponse findBeans(ResourceSearchBean searchBean, EntitlementsCollection[] dependants, int from, int size)
Search a Resource- Parameters:
searchBean
- - search bean, containing search parametersdependants
- - collection instead of deep copy flagfrom
- - where to startsize
- - how many to return- Returns:
- - the search results
-
getUserApplicationCategories
List<Resource> getUserApplicationCategories(String userId, String rootResourceId)
Method is user to get Application categories for given user id. since v4.1.8 users should be authorized to see categories. If in PROPERTY_FILE_VALUES PROPERTY 'org.openiam.authorization.create.request.disabled' is set to 'true' (default) the old behavior should be expected. All categories will be visible. otherwise User will see categories that he is authorized to. The common OpenIAM RBAC approach is used.- Parameters:
userId
- - User Id- Returns:
- List Of resouces with type "APPLICATION CATEGORY";
-
count
int count(ResourceSearchBean searchBean)
count the number of resources based on the searchBean- Parameters:
searchBean
-- Returns:
-
addChildResource
Response addChildResource(String resourceId, String memberResourceId, Set<String> rights, Date startDate, Date endDate)
add a child resource to a parent- Parameters:
resourceId
- - the parent resource IDmemberResourceId
- - the child resource ID- Returns:
- a Response Object, with details about the result of the operation
-
validateAddChildResource
Response validateAddChildResource(String resourceId, String childResourceId, Set<String> rights, Date startDate, Date endDate)
-
deleteChildResource
Response deleteChildResource(String resourceId, String memberResourceIdd)
Removes a child resource from a parent- Parameters:
resourceId
- - the parent resource IDmemberResourceId
-- Returns:
- a Response Object, with details about the result of the operation
-
addGroupToResource
Response addGroupToResource(String resourceId, String groupId, Set<String> rightIds, Date startDate, Date endDate)
Entitles a Group to a Resource- Parameters:
resourceId
- - the resource IDgroupId
- - the group ID- Returns:
- a Response Object, with details about the result of the operation
-
removeGroupToResource
Response removeGroupToResource(String resourceId, String groupId)
Disentitles a Group from a Resource- Parameters:
resourceId
- - the resource IDgroupId
- - the group ID- Returns:
- a Response Object, with details about the result of the operation
-
addRoleToResource
Response addRoleToResource(String resourceId, String roleId, Set<String> rightIds, Date startDate, Date endDate)
entitle a Role to a Resource- Parameters:
resourceId
- - the resource IDroleId
- - the role ID- Returns:
- a Response Object, with details about the result of the operation
-
bulkEntitlementsRequest
Response bulkEntitlementsRequest(MembershipsRequest request)
entitle a Groups / Roles / Child resources to a Resource- Parameters:
request
- - the MembershipsRequest object with resource and group/roles/childs ids- Returns:
- a Response Object, with details about the result of the operation
-
removeRoleToResource
Response removeRoleToResource(String resourceId, String roleId)
Disentitles a Resource from a Role- Parameters:
resourceId
- - the Resource IDroleId
- - the Role ID- Returns:
- a Response Object, with details about the result of the operation
-
canAddUserToResource
Response canAddUserToResource(String userId, String resourceId)
Tells the caller if the user can be entitled to this resource- Parameters:
userId
- - the User IDresourceId
- - the Resource ID- Returns:
- a Response Object, with details about the result of the operation
-
canRemoveUserFromResource
Response canRemoveUserFromResource(String userId, String resourceId)
Tells the caller if the user can be disentitled from this resource- Parameters:
userId
- - the User IDresourceId
- - the Resource ID- Returns:
- a Response Object, with details about the result of the operation
-
countResourceTypes
int countResourceTypes(ResourceTypeSearchBean searchBean)
-
saveResourceType
Response saveResourceType(ResourceType resourceType)
-
saveQuestionnaire
Response saveQuestionnaire(Questionnaire questionnaire)
-
getQuestionnaireForResource
QuestionnairesResponse getQuestionnaireForResource(String resourceId)
-
getQuestionnairesForResources
QuestionnairesResponse getQuestionnairesForResources(List<String> resourceIdList, boolean isDeepCopy)
Search for questionnaires by using resources Ids list.- Parameters:
resourceIdList
- Id list of resourcesisDeepCopy
- if true answers are fetched- Returns:
- Response with questionnaires that related to given resources
-
getAllResourceIds
List<String> getAllResourceIds()
Method to get all Resource IDs This method should not be called at run-time. It is here only for testing purpose.At the time of writing, this method is called by the ui-test/stress-test module.
- Returns:
-
reindexResource
Response reindexResource(String id)
- Parameters:
id
- - Resource id for reindex- Returns:
-
selectAccess
ResourceSelectAccess selectAccess(Set<String> resourceIds, String searchFilter, int size)
Method will return the list of resource for given resource ids. as a separate objects it will return roles mapped by role id and groups mapped by group id. roles and groups are filtered by entitlementsSearchFilter, if it not empty.- Parameters:
resourceIds
- - set if requested resource idssearchFilter
- - filter roles and groups by name (contains match type)- Returns:
- ResourceSelectAccess
-
getOneLevelAccess
ResourceEntitlementsListResponse getOneLevelAccess(String userId, String resourceSearchQuery, UserCollection[] accessTypes, int from, int size)
Method is used to retrieve all user's applications (content provider, managed systems, manual managed systems, auth providers) with User's roles/groups/organizations (based on accessTypes param)- Parameters:
userId
- - userId of user for whom we are looking the appsresourceSearchQuery
- - search byKeyNameDTO.getName()
, IMPORTANT, notResource#getCoorelatedName()
accessTypes
- - arrays of entitlement types that bring access to enduser (so if ROLES are set that it will return all apps that are linked to user only based on user's roles). Values that are lister: ROLES,GROUPS,ORGANIZATINSfrom
- - paging - index of 1st resultsize
- - max results size- Returns:
ResourceEntitlementsListResponse
response withResourceEntitlementsListResponse#getList()
where all apps are listed usingResourceAccess
object.
-
getOneLevelAccessWithResourceTypes
ResourceEntitlementsListResponse getOneLevelAccessWithResourceTypes(String userId, String resourceSearchQuery, UserCollection[] accessTypes, Set<String> includeResourceTypeIds, Set<String> excludeResourceTypeIds, int from, int size)
Method is used to retrieve all user's resources based on resource types defined as #includeResourceTypes and #excludeResourceTypes with User's roles/groups/organizations/resources (based on accessTypes param)- Parameters:
userId
- - userId of user for whom we are looking the appsresourceSearchQuery
- - filter for resources (MatchType is Contains)accessTypes
- - arrays of entitlement types that bring access to enduser (so if ROLES are set that it will return all apps that are linked to user only based on user's roles). Values that are lister:UserCollection.ROLES
,UserCollection.GROUPS
,UserCollection.ORGANIZATIONS
,UserCollection.RESOURCES
(UserCollection.RESOURCES
- is used to show Direct User's resources)includeResourceTypeIds
- - resource Types that have to be included in the searchexcludeResourceTypeIds
- - resource Types that have to be excluded from the searchfrom
- - paging - index of 1st resultsize
- - max results size- Returns:
ResourceEntitlementsListResponse
response withResourceEntitlementsListResponse#getList()
where all apps are listed usingResourceAccess
object.
-
getBulkUsersCommonOneLevelAccess
ResourceEntitlementsListResponse getBulkUsersCommonOneLevelAccess(List<String> userIds, String resourceSearchQuery, UserCollection[] accessTypes, int from, int size)
Method is used to retrieve bulk users common applications (content provider, managed systems, manual managed systems, auth providers) with User's roles/groups/organizations (based on accessTypes param)- Parameters:
userIds
- - List of userId of users for whom we are looking the appsresourceSearchQuery
- - search byKeyNameDTO.getName()
, IMPORTANT, notResource#getCoorelatedName()
accessTypes
- - arrays of entitlement types that bring access to enduser (so if ROLES are set that it will return all apps that are linked to user only based on user's roles). Values that are lister: ROLES,GROUPS,ORGANIZATINSfrom
- - paging - index of 1st resultsize
- - max results size- Returns:
ResourceEntitlementsListResponse
response withResourceEntitlementsListResponse#getList()
where all apps are listed usingResourceAccess
object.
-
-