Package org.openiam.esb.core.service
Interface ResourceService
-
- All Superinterfaces:
GetBeansElasticsearchService<Resource,ResourceEntity,String,ResourceSearchBean>
,GetBeansService<Resource,ResourceEntity,String,ResourceSearchBean>
,GetEntitlementBeansService<Resource,ResourceEntity,String,ResourceSearchBean>
- All Known Implementing Classes:
ResourceServiceImpl
public interface ResourceService extends GetEntitlementBeansService<Resource,ResourceEntity,String,ResourceSearchBean>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addChildResource(String parentResourceId, String childResourceId, Set<String> rights, Date startDate, Date endDate)
void
addRequiredAttributes(ResourceEntity resource)
void
addResourceGroup(String resourceId, String groupId, Set<String> rightIds, Date startDate, Date endDate)
void
addResourceToRole(String resourceId, String roleId, Set<String> rightIds, Date startDate, Date endDate)
void
bulkEntitlementsRequest(MembershipsRequest request)
void
canAddUserToResource(String resourceId, String userId)
void
canRemoveUserFromResource(String resourceId, String userId)
int
countResourceTypes(ResourceTypeSearchBean searchBean)
void
deleteChildResource(String resourceId, String childResourceId)
void
deleteQuestionnaire(String id)
void
deleteResource(String resourceId)
void
deleteResourceGroup(String resourceId, String groupId)
void
deleteResourceRole(String resourceId, String roleId)
void
deleteResourceType(String resourceTypeId)
void
deleteWorkflowResourceByReferenceId(List<String> referenceIdList)
Set<String>
findAllScopesByName(Set<String> names)
Method is used to get Resource Ids with type OAUTH_SCOPE by Names.List<Resource>
findBeans(SynchronizationRequestSearchBean searchBean)
List<ResourcePropEntity>
findBeans(ResourceAttributeSearchBean sb, int from, int size)
List<ResourceProp>
findBeansDTO(ResourceAttributeSearchBean sb, int from, int size)
ResourceEntity
findResourceById(String resourceId)
Resource
findResourceDtoById(String resourceId)
List<ResourceEntity>
findResourcesByIds(Collection<String> resourceIdCollection)
ResourceTypeEntity
findResourceTypeById(String id)
ResourceType
findResourceTypeDTOById(String id)
List<ResourceTypeEntity>
findResourceTypes(ResourceTypeSearchBean searchBean, int from, int size)
List<ResourceType>
findResourceTypesDto(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<ResourceTypeEntity>
getAllResourceTypes()
List<ResourceType>
getAllResourceTypesDto()
ResourceEntitlementsListResponse
getBulkUserCommonOneLevelAccess(List<String> userIds, String resourceName, UserCollection[] accessTypes, int from, int size)
Method is used to retrieve common applications for bulk users (content provider, managed systems, manual managed systems, auth providers) with User's roles/groups/organizations/resources (based on accessTypes param)List<Questionnaire>
getQuestionnaire(String resourceId)
List<Questionnaire>
getQuestionnaireList(List<String> resourceIds, boolean deepCopy)
Search for questionnaires by using resources Ids list.Resource
getResourceDTO(String resourceId, boolean isDeepCopy)
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.ResourceEntitlementsListResponse
getUserOneLevelAccess(String userId, String resourceName, 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/resources (based on accessTypes param)ResourceEntitlementsListResponse
getUserOneLevelAccessWithTypes(String userId, String resourceName, UserCollection[] accessTypes, Set<String> includeResourceTypes, Set<String> excludeResourceTypes, 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)boolean
isIndexed(String id)
boolean
isMemberOfAnyEntity(String resourceId)
void
reindexResource(String id)
Force reindex of a resource.void
save(ResourceEntity resource)
String
save(ResourceType dto)
void
saveAttribute(ResourcePropEntity attribute)
void
saveQuestionnaire(Questionnaire questionnaire)
String
saveResource(Resource resource)
ResourceSelectAccess
selectAccess(Set<String> resourceIds, String entitlementsSearchFilter, int size)
Resource
suggestById(String resourceId)
Searches for the given DTO in Elasticsearch.void
validate(Resource resource)
void
validateResource2ResourceAddition(String parentId, String memberId, Set<String> rights, Date startDate, Date endDate)
void
validateResourceDeletion(String resourceId)
-
Methods inherited from interface org.openiam.esb.core.service.GetBeansElasticsearchService
reindex, reindex
-
Methods inherited from interface org.openiam.esb.core.service.GetBeansService
countBeans, find, findBeans, findBeans, get
-
Methods inherited from interface org.openiam.esb.core.service.GetEntitlementBeansService
findBeans
-
-
-
-
Method Detail
-
deleteResource
void deleteResource(String resourceId) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
deleteWorkflowResourceByReferenceId
void deleteWorkflowResourceByReferenceId(List<String> referenceIdList) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
suggestById
Resource suggestById(String resourceId)
Description copied from interface:GetBeansElasticsearchService
Searches for the given DTO in Elasticsearch.- Specified by:
suggestById
in interfaceGetBeansElasticsearchService<Resource,ResourceEntity,String,ResourceSearchBean>
- Parameters:
resourceId
- - id used for search criteria.- Returns:
- DTO Object or null if not found
-
save
void save(ResourceEntity resource)
-
addRequiredAttributes
void addRequiredAttributes(ResourceEntity resource)
-
findBeansDTO
List<ResourceProp> findBeansDTO(ResourceAttributeSearchBean sb, int from, int size)
-
findBeans
List<ResourcePropEntity> findBeans(ResourceAttributeSearchBean sb, int from, int size)
-
findResourceById
ResourceEntity findResourceById(String resourceId)
-
findResourcesByIds
List<ResourceEntity> findResourcesByIds(Collection<String> resourceIdCollection)
-
save
String save(ResourceType dto) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
findResourceTypeById
ResourceTypeEntity findResourceTypeById(String id)
-
findResourceTypeDTOById
ResourceType findResourceTypeDTOById(String id)
-
getAllResourceTypes
List<ResourceTypeEntity> getAllResourceTypes()
-
getAllResourceTypesDto
List<ResourceType> getAllResourceTypesDto()
-
addResourceGroup
void addResourceGroup(String resourceId, String groupId, Set<String> rightIds, Date startDate, Date endDate) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
deleteResourceGroup
void deleteResourceGroup(String resourceId, String groupId) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
deleteResourceRole
void deleteResourceRole(String resourceId, String roleId) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
addResourceToRole
void addResourceToRole(String resourceId, String roleId, Set<String> rightIds, Date startDate, Date endDate) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
validateResource2ResourceAddition
void validateResource2ResourceAddition(String parentId, String memberId, Set<String> rights, Date startDate, Date endDate) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
isMemberOfAnyEntity
boolean isMemberOfAnyEntity(String resourceId)
-
validateResourceDeletion
void validateResourceDeletion(String resourceId) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
findResourceTypes
List<ResourceTypeEntity> findResourceTypes(ResourceTypeSearchBean searchBean, int from, int size)
-
findResourceTypesDto
List<ResourceType> findResourceTypesDto(ResourceTypeSearchBean searchBean, int from, int size)
-
countResourceTypes
int countResourceTypes(ResourceTypeSearchBean searchBean)
-
deleteResourceType
void deleteResourceType(String resourceTypeId) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
validate
void validate(Resource resource) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
saveResource
String saveResource(Resource resource) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
saveAttribute
void saveAttribute(ResourcePropEntity attribute)
-
addChildResource
void addChildResource(String parentResourceId, String childResourceId, Set<String> rights, Date startDate, Date endDate) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
deleteChildResource
void deleteChildResource(String resourceId, String childResourceId) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
isIndexed
boolean isIndexed(String id)
-
canAddUserToResource
void canAddUserToResource(String resourceId, String userId) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
canRemoveUserFromResource
void canRemoveUserFromResource(String resourceId, String userId) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
deleteQuestionnaire
void deleteQuestionnaire(String id)
-
saveQuestionnaire
void saveQuestionnaire(Questionnaire questionnaire)
-
getQuestionnaire
List<Questionnaire> getQuestionnaire(String resourceId)
-
bulkEntitlementsRequest
void bulkEntitlementsRequest(MembershipsRequest request) throws BasicDataServiceException
- Throws:
BasicDataServiceException
-
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 IdrootResourceId
- - Id of root resource (it helps to find subgategories that user entitled to).- Returns:
- List Of resouces with type "APPLICATION CATEGORY";
-
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:
-
getQuestionnaireList
List<Questionnaire> getQuestionnaireList(List<String> resourceIds, boolean deepCopy) throws ScriptEngineException, ClassCastException
Search for questionnaires by using resources Ids list.- Parameters:
resourceIds
- Id list of resourcesdeepCopy
- if true answers are fetched- Returns:
- list of questionnaires that related to given resources
- Throws:
ScriptEngineException
ClassCastException
-
reindexResource
void reindexResource(String id)
Force reindex of a resource.- Parameters:
id
-
-
selectAccess
ResourceSelectAccess selectAccess(Set<String> resourceIds, String entitlementsSearchFilter, int size)
-
findBeans
List<Resource> findBeans(SynchronizationRequestSearchBean searchBean)
-
findAllScopesByName
Set<String> findAllScopesByName(Set<String> names)
Method is used to get Resource Ids with type OAUTH_SCOPE by Names.- Parameters:
names
- - the set of Ouath scope names- Returns:
- - the Ids of the corresponding resources
-
getUserOneLevelAccess
ResourceEntitlementsListResponse getUserOneLevelAccess(String userId, String resourceName, 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/resources (based on accessTypes param)- Parameters:
userId
- - userId of user for whom we are looking the appsresourceName
- - 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)from
- - paging - index of 1st resultsize
- - max results size- Returns:
ResourceEntitlementsListResponse
response withResourceEntitlementsListResponse#getList()
where all apps are listed usingResourceAccess
object.
-
getUserOneLevelAccessWithTypes
ResourceEntitlementsListResponse getUserOneLevelAccessWithTypes(String userId, String resourceName, UserCollection[] accessTypes, Set<String> includeResourceTypes, Set<String> excludeResourceTypes, 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 appsresourceName
- - 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)includeResourceTypes
- - resource Types that have to be included in the searchexcludeResourceTypes
- - 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.
-
getBulkUserCommonOneLevelAccess
ResourceEntitlementsListResponse getBulkUserCommonOneLevelAccess(List<String> userIds, String resourceName, UserCollection[] accessTypes, int from, int size)
Method is used to retrieve common applications for bulk users (content provider, managed systems, manual managed systems, auth providers) with User's roles/groups/organizations/resources (based on accessTypes param)- Parameters:
userIds
- - List of userId for whom we are looking the appsresourceName
- - 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)from
- - paging - index of 1st resultsize
- - max results size- Returns:
ResourceEntitlementsListResponse
response withResourceEntitlementsListResponse#getList()
where all apps are listed usingResourceAccess
object.
-
-