Interface ResourcesManagerImplApi
- All Known Implementing Classes:
ResourcesManagerImpl
public interface ResourcesManagerImplApi
Manages resources.
- Author:
- Slavek Licehammer
-
Method Summary
Modifier and TypeMethodDescriptionvoid
assignAutomaticGroupToResource
(PerunSession perunSession, Group group, Resource resource, Group sourceGroup) Assign group to a resource (automatic subgroup assignment).void
assignGroupToResource
(PerunSession perunSession, Group group, Resource resource, boolean autoAssignSubgroups) Assign group to a resource.void
assignGroupToResourceState
(PerunSession perunSession, Group group, Resource resource, GroupResourceStatus status) Set initial status to group-resource assignment.void
assignResourceTagToResource
(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Assign existing ResourceTag on existing Resource.void
assignService
(PerunSession perunSession, Resource resource, Service service) Assign service to resource.boolean
banExists
(PerunSession sess, int banId) Get true if any band defined by id exists for any member and resource.boolean
banExists
(PerunSession sess, int memberId, int resourceId) Get true if any ban for member and resource exists.void
checkResourceExists
(PerunSession perunSession, Resource resource) Check if resource exists in underlaying data source.void
checkResourceTagExists
(PerunSession sess, ResourceTag resourceTag) Check if resource tag exists in underlaying data source.createResource
(PerunSession perunSession, Vo vo, Resource resource, Facility facility) Creates the resource.createResourceTag
(PerunSession perunSession, ResourceTag resourceTag, Vo vo) Create new Resource tag.void
deleteAllResourcesTagsForVo
(PerunSession perunSession, Vo vo) Delete all ResourcesTags for specific VO.void
deleteResource
(PerunSession perunSession, Vo vo, Resource resource) Deletes resource by id.void
deleteResourceTag
(PerunSession perunSession, ResourceTag resourceTag) Delete existing Resource tag.getAdminGroups
(PerunSession sess, Resource resource) Gets list of all group administrators of the Resource.getAdmins
(PerunSession sess, Resource resource) Gets list of all user administrators of the Resource.Get all expired bans on any resource to now dategetAllowedMembers
(PerunSession sess, Resource resource) Returns all members who are "allowed" on the resource disregarding their possible expired status in a group.getAllowedMembersNotExpiredInGroup
(PerunSession sess, Resource resource) Returns all members which are allowed on the resource and are not expired within their assigned groups.getAllowedResources
(PerunSession sess, Facility facility, User user) Return all resources through which user is allowed on facility.getAllowedUsers
(PerunSession sess, Resource resource) Returns all users who are allowed on the defined resource.getAllowedUsersNotExpiredInGroup
(PerunSession sess, Resource resource) Returns all users which are allowed on the resource and are not expired within their assigned groups.getAllResources
(PerunSession sess) Get all resources from database.getAllResourcesByResourceTag
(PerunSession perunSession, ResourceTag resourceTag) Get all resources in specific Vo (specific by resourceTag.getVoId) for existing resourceTaggetAllResourcesTagsForResource
(PerunSession perunSession, Resource resource) Get all resourcesTags for existing ResourcegetAllResourcesTagsForVo
(PerunSession perunSession, Vo vo) Get all resourcesTags for existing Vo.getAssignedMembers
(PerunSession sess, Resource resource) Returns all members who are assigned on the defined resource.getAssignedMembersWithStatus
(PerunSession sess, Resource resource) Returns members of groups assigned to resource with status of group-resource assignment.getAssignedResources
(PerunSession perunSession, Group group) List all resources to which the group is assigned.getAssignedResources
(PerunSession sess, Member member) Returns all resources where the member is assigned through the groups.getAssignedResources
(PerunSession sess, Member member, Service service) Returns all resources where member and service are assigned together.getAssignedResources
(PerunSession sess, User user, Vo vo) Returns all resources where the user is assigned through the specified vo and its groups.getAssignedResourcesWithStatus
(PerunSession sess, Member member) Returns all assigned resources where member is assigned through the groups.getAssignedRichResources
(PerunSession perunSession, Group group) List of all rich resources associated with the group.getAssignedRichResources
(PerunSession sess, Member member) Returns all rich resources where the member is assigned through the groups.getAssignedRichResources
(PerunSession sess, Member member, Service service) Returns all rich resources where the service and the member are assigned through the groups.getAssignedServices
(PerunSession perunSession, Resource resource) List all services' id associated with the resource.getAssignedUsers
(PerunSession perunSession, Resource resource) Returns all user assigned to the resource.getAssociatedMembers
(PerunSession sess, Resource resource) Returns all members who are associated with the resource.getAssociatedResources
(PerunSession perunSession, Group group) List all resources associated with the group.getAssociatedResources
(PerunSession sess, Member member) Returns all resources with which the member is associated through the groups.getAssociatedUsers
(PerunSession sess, Resource resource) Returns all users who are associated with the defined resource.getBan
(PerunSession sess, int memberId, int resourceId) Get specific resource ban.getBanById
(PerunSession sess, int banId) Get Ban for member on resource by it's idgetBansForMember
(PerunSession sess, int memberId) Get all resources bans for member.getBansForResource
(PerunSession sess, int resourceId) Get all members bans for resourcegetDirectAdmins
(PerunSession perunSession, Resource resource) Gets list of direct user administrators of the Resource.int
getFacilityId
(PerunSession perunSession, Resource resource) Get facility id which belongs to the concrete resource.getFailedGroupResourceAssignmentCause
(PerunSession sess, Group group, Resource resource) Gets the current cause of failed group-resource assignment.getGroupAssignments
(PerunSession sess, Resource resource) Lists all of the assigned groups for the given resource without the groups' attributes.getGroupResourceAssignments
(PerunSession sess, List<GroupResourceStatus> statuses) Lists all group-resource assignments with given statuses.getGroupResourceStatus
(PerunSession sess, Group group, Resource resource) Gets status of given group-resource assignment.getResourceAssignments
(PerunSession sess, Group group) Lists all of the resource assignments for the given group without the resources' attributes.getResourceById
(PerunSession perunSession, int id) Searches for the Resource with specified id.getResourceByName
(PerunSession sess, Vo vo, Facility facility, String name) Return resource by its name.getResources
(PerunSession sess) Get all resources.getResources
(PerunSession sess, User user, List<Status> memberStatuses, List<MemberGroupStatus> memberGroupStatuses, List<GroupResourceStatus> groupResourceStatuses) Return all resources where user is assigned.getResources
(PerunSession perunSession, Vo vo) Get all VO resources.getResourcesByAttribute
(PerunSession sess, Attribute attribute) Returns all resources which have set the attribute with the value.getResourcesByIds
(PerunSession perunSession, List<Integer> ids) Gets resources by their ids.int
getResourcesCount
(PerunSession perunSession) Get count of all resources.int
getResourcesCount
(PerunSession perunSession, Vo vo) Get all VO resources count.getResourcesWhereGroupIsAdmin
(PerunSession sess, Facility facility, Vo vo, Group authorizedGroup) Return all resources for the facility and the vo where the group is authorized as resource manager.getResourcesWhereUserIsAdmin
(PerunSession sess, Facility facility, Vo vo, User authorizedUser) Return all resources for the facility and the vo where user is authorized as resource manager.getResourcesWhereUserIsAdmin
(PerunSession sess, User user) Returns list of resources, where the user is an admin.getResourcesWhereUserIsAdmin
(PerunSession sess, Vo vo, User authorizedUser) Return all resources for the vo where user is authorized as resource manager.getRichResourceById
(PerunSession perunSession, int id) Searches for the Rich Resource with specified id.getRichResources
(PerunSession perunSession, Vo vo) Get all VO rich resources.getRichResourcesByIds
(PerunSession perunSession, List<Integer> ids) Gets rich resources by their ids.getRichResourcesWithMemberAndAttribute
(PerunSession perunSession, Member member, AttributeDefinition ad) Return all rich resources with given attribute where given member is assigned.boolean
groupResourceAssignmentExists
(PerunSession sess, Resource resource, Group group) Returns true if the group is assigned to the current resource with any status, false otherwise.boolean
isGroupAssigned
(PerunSession sess, Resource resource, Group group) Returns true if the group is assigned to the current resource with ACTIVE status, false otherwise.boolean
isGroupManuallyAssigned
(PerunSession sess, Group group, Resource resource) Returns true if the group is assigned to the given resource manually, false otherwise.boolean
isUserAllowed
(PerunSession sess, User user, Resource resource) Check if the user is allowed as a member on the selected resource.boolean
isUserAssigned
(PerunSession sess, User user, Resource resource) Check if the user is assigned as a member on the selected resource.void
removeAllResourcesTagFromResource
(PerunSession perunSession, Resource resource) Remove all existing Resource tags for specific resource.void
removeAutomaticGroupFromResource
(PerunSession perunSession, Group group, Resource resource, int sourceGroupId) Remove automatically assigned group from resource.void
removeBan
(PerunSession sess, int banId) Remove ban by id from resources bans.void
removeBan
(PerunSession sess, int memberId, int resourceId) Remove ban by member_id and facility_idvoid
removeGroupFromResource
(PerunSession perunSession, Group group, Resource resource) Remove group from a resource.void
removeResourceTagFromResource
(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Remove specific ResourceTag from existing Resource.void
removeService
(PerunSession perunSession, Resource resource, Service service) Remove service from resource.boolean
resourceExists
(PerunSession perunSession, Resource resource) Check if resource exists in underlaying data source.setBan
(PerunSession sess, BanOnResource banOnResource) Set ban for member on resourcevoid
setFailedGroupResourceAssignmentCause
(PerunSession sess, Group group, Resource resource, String cause) Sets the cause of failed group-resource assignmentvoid
setGroupResourceStatus
(PerunSession sess, Group group, Resource resource, GroupResourceStatus status) Sets status of given group-resource assignment to the specified status.updateBan
(PerunSession sess, BanOnResource banOnResource) Update description and validity timestamp of specific ban.updateResource
(PerunSession perunSession, Resource resource) Updates Resource.updateResourceTag
(PerunSession perunSession, ResourceTag resourceTag) Update existing Resource tag.
-
Method Details
-
assignAutomaticGroupToResource
void assignAutomaticGroupToResource(PerunSession perunSession, Group group, Resource resource, Group sourceGroup) throws GroupAlreadyAssignedException Assign group to a resource (automatic subgroup assignment).- Parameters:
perunSession
-group
-resource
-sourceGroup
-- Throws:
InternalErrorException
GroupAlreadyAssignedException
-
assignGroupToResource
void assignGroupToResource(PerunSession perunSession, Group group, Resource resource, boolean autoAssignSubgroups) throws GroupAlreadyAssignedException Assign group to a resource.- Parameters:
perunSession
-group
-resource
-autoAssignSubgroups
-- Throws:
InternalErrorException
GroupAlreadyAssignedException
-
assignGroupToResourceState
void assignGroupToResourceState(PerunSession perunSession, Group group, Resource resource, GroupResourceStatus status) Set initial status to group-resource assignment.- Parameters:
perunSession
-group
-resource
-status
- Status of the group-resource assignment
-
assignResourceTagToResource
void assignResourceTagToResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Assign existing ResourceTag on existing Resource.- Parameters:
perunSession
-resource
-- Throws:
InternalErrorException
-
assignService
void assignService(PerunSession perunSession, Resource resource, Service service) throws ServiceAlreadyAssignedException Assign service to resource.- Parameters:
perunSession
-resource
-service
-- Throws:
InternalErrorException
ServiceAlreadyAssignedException
-
banExists
Get true if any ban for member and resource exists.- Parameters:
sess
-memberId
- id of memberresourceId
- id of resource- Returns:
- true if ban exists
- Throws:
InternalErrorException
-
banExists
Get true if any band defined by id exists for any member and resource.- Parameters:
sess
-banId
- id of ban- Returns:
- true if ban exists
- Throws:
InternalErrorException
-
checkResourceExists
void checkResourceExists(PerunSession perunSession, Resource resource) throws ResourceNotExistsException Check if resource exists in underlaying data source.- Parameters:
perunSession
-resource
-- Throws:
InternalErrorException
ResourceNotExistsException
-
checkResourceTagExists
void checkResourceTagExists(PerunSession sess, ResourceTag resourceTag) throws ResourceTagNotExistsException Check if resource tag exists in underlaying data source.- Parameters:
sess
-resourceTag
-- Throws:
InternalErrorException
ResourceTagNotExistsException
-
createResource
Creates the resource. This methods sets ids and uuid to the given resource object but returns a new resource object loaded from db.- Parameters:
perunSession
-vo
-resource
-facility
-- Returns:
- newly created resource with id
- Throws:
InternalErrorException
-
createResourceTag
Create new Resource tag.- Parameters:
perunSession
-resourceTag
-vo
-- Returns:
- new created resourceTag
- Throws:
InternalErrorException
-
deleteAllResourcesTagsForVo
Delete all ResourcesTags for specific VO.- Parameters:
perunSession
-vo
-- Throws:
InternalErrorException
-
deleteResource
void deleteResource(PerunSession perunSession, Vo vo, Resource resource) throws ResourceAlreadyRemovedException Deletes resource by id.- Parameters:
perunSession
-vo
-resource
-- Throws:
InternalErrorException
ResourceAlreadyRemovedException
- if there are 0 rows affected by deleting from DB
-
deleteResourceTag
Delete existing Resource tag.- Parameters:
perunSession
-resourceTag
-- Throws:
InternalErrorException
-
getAdminGroups
Gets list of all group administrators of the Resource.- Parameters:
sess
-resource
-- Returns:
- list of groups who are admins in the resource
- Throws:
InternalErrorException
-
getAdmins
Gets list of all user administrators of the Resource. If some group is administrator of the given resource, all VALID members are included in the list.- Parameters:
sess
-resource
-- Returns:
- list of users who are admins in the resource
- Throws:
InternalErrorException
-
getAllExpiredBansOnResources
Get all expired bans on any resource to now date- Parameters:
sess
-- Returns:
- list of expired bans for any resource
- Throws:
InternalErrorException
-
getAllResources
Get all resources from database.- Parameters:
sess
- Perun session- Returns:
- list of all resources
-
getAllResourcesByResourceTag
Get all resources in specific Vo (specific by resourceTag.getVoId) for existing resourceTag- Parameters:
perunSession
-resourceTag
-- Returns:
- list of Resources
- Throws:
InternalErrorException
-
getAllResourcesTagsForResource
Get all resourcesTags for existing Resource- Parameters:
perunSession
-resource
-- Returns:
- list of ResourcesTags
- Throws:
InternalErrorException
-
getAllResourcesTagsForVo
Get all resourcesTags for existing Vo.- Parameters:
perunSession
-vo
-- Returns:
- list of all resourcesTags for existing Vo
- Throws:
InternalErrorException
-
getAllowedMembers
Returns all members who are "allowed" on the resource disregarding their possible expired status in a group. All members include all group statuses, through which they can be filtered if necessary.- Parameters:
sess
-resource
-- Returns:
- list of members
- Throws:
InternalErrorException
-
getAllowedMembersNotExpiredInGroup
Returns all members which are allowed on the resource and are not expired within their assigned groups. It means if member is allowed on the resource, but only through expired groups, it is filtered out.- Parameters:
sess
-resource
-- Returns:
- list of members
- Throws:
InternalErrorException
-
getAllowedResources
Return all resources through which user is allowed on facility.- Parameters:
sess
-facility
-user
-- Returns:
- List of allowed resources for the user on facility
- Throws:
InternalErrorException
-
getAllowedUsers
Returns all users who are allowed on the defined resource.- Parameters:
sess
-resource
-- Returns:
- list of users
- Throws:
InternalErrorException
-
getAllowedUsersNotExpiredInGroup
Returns all users which are allowed on the resource and are not expired within their assigned groups. It means if user is allowed on the resource, but only through expired groups, it is filtered out.- Parameters:
sess
-resource
-- Returns:
- list of users
- Throws:
InternalErrorException
-
getAssignedMembers
Returns all members who are assigned on the defined resource.- Parameters:
sess
-resource
-- Returns:
- list of members
- Throws:
InternalErrorException
-
getAssignedMembersWithStatus
Returns members of groups assigned to resource with status of group-resource assignment. RichMember attribute has only Member set.- Parameters:
sess
- perunSessionresource
- resource- Returns:
- list of members of groups assigned to given resource
-
getAssignedResources
List all resources to which the group is assigned.- Parameters:
perunSession
-group
-- Returns:
- list of assigned resources
- Throws:
InternalErrorException
-
getAssignedResources
Returns all resources where the member is assigned through the groups.- Parameters:
sess
-member
-- Returns:
- list of resources
- Throws:
InternalErrorException
-
getAssignedResources
Returns all resources where member and service are assigned together.- Parameters:
sess
-member
-service
-- Returns:
- list of resources
- Throws:
InternalErrorException
-
getAssignedResources
Returns all resources where the user is assigned through the specified vo and its groups.- Parameters:
sess
-user
-vo
-- Returns:
- list of resources
- Throws:
InternalErrorException
- See Also:
-
getAssignedResourcesWithStatus
Returns all assigned resources where member is assigned through the groups.- Parameters:
sess
- perun sessionmember
- member- Returns:
- list of assigned resources
-
getAssignedRichResources
List of all rich resources associated with the group.- Parameters:
perunSession
-group
-- Returns:
- list of assigned rich resources
- Throws:
InternalErrorException
-
getAssignedRichResources
Returns all rich resources where the member is assigned through the groups.- Parameters:
sess
-member
-- Returns:
- list of rich resources
- Throws:
InternalErrorException
-
getAssignedRichResources
Returns all rich resources where the service and the member are assigned through the groups.- Parameters:
sess
-member
-service
-- Returns:
- list of rich resources
- Throws:
InternalErrorException
-
getAssignedServices
List all services' id associated with the resource.- Parameters:
perunSession
-resource
-- Returns:
- list of assigned service' id
- Throws:
InternalErrorException
-
getAssignedUsers
Returns all user assigned to the resource.- Parameters:
perunSession
-resource
-- Returns:
- list of user assigned to the resource
- Throws:
InternalErrorException
-
getAssociatedMembers
Returns all members who are associated with the resource. Does not require ACTIVE group-resource status or any specific member status.- Parameters:
sess
-resource
-- Returns:
- list of members
- Throws:
InternalErrorException
-
getAssociatedResources
List all resources associated with the group. Does not require ACTIVE group-resource status.- Parameters:
perunSession
-group
-- Returns:
- list of associated resources
- Throws:
InternalErrorException
-
getAssociatedResources
Returns all resources with which the member is associated through the groups. Does not require ACTIVE group-resource status.- Parameters:
sess
-member
-- Returns:
- list of resources
- Throws:
InternalErrorException
-
getAssociatedUsers
Returns all users who are associated with the defined resource. Does not require ACTIVE group-resource status.- Parameters:
sess
-resource
-- Returns:
- list of users
- Throws:
InternalErrorException
-
getBan
Get specific resource ban.- Parameters:
sess
-memberId
- the member idresourceId
- the resource id- Returns:
- specific resource ban
- Throws:
InternalErrorException
BanNotExistsException
-
getBanById
Get Ban for member on resource by it's id- Parameters:
sess
-banId
- the ban id- Returns:
- resource ban by it's id
- Throws:
InternalErrorException
BanNotExistsException
-
getBansForMember
Get all resources bans for member.- Parameters:
sess
-memberId
- the member id- Returns:
- list of bans for member on any resource
- Throws:
InternalErrorException
-
getBansForResource
Get all members bans for resource- Parameters:
sess
-resourceId
- the resource id- Returns:
- list of all members bans on resource
- Throws:
InternalErrorException
-
getDirectAdmins
Gets list of direct user administrators of the Resource. 'Direct' means, there aren't included users, who are members of group administrators, in the returned list.- Parameters:
perunSession
-resource
-- Returns:
- list of direct admins of the resource
- Throws:
InternalErrorException
-
getFacilityId
Get facility id which belongs to the concrete resource.- Parameters:
perunSession
-resource
-- Returns:
- facility id
- Throws:
InternalErrorException
-
getFailedGroupResourceAssignmentCause
Gets the current cause of failed group-resource assignment. Returns null if there is no such group-resource assignment.- Parameters:
sess
- sessiongroup
- groupresource
- resource- Returns:
- error message
-
getGroupAssignments
Lists all of the assigned groups for the given resource without the groups' attributes.- Parameters:
sess
- sessionresource
- resource- Returns:
- list of assigned groups for given resource
- Throws:
InternalErrorException
-
getGroupResourceAssignments
List<GroupResourceAssignment> getGroupResourceAssignments(PerunSession sess, List<GroupResourceStatus> statuses) Lists all group-resource assignments with given statuses. If statuses are empty or null, lists assignments with all statuses.- Parameters:
sess
- sessionstatuses
- list of allowed statuses- Returns:
- list of group-resource assignments with given statuses
- Throws:
InternalErrorException
-
getGroupResourceStatus
GroupResourceStatus getGroupResourceStatus(PerunSession sess, Group group, Resource resource) throws GroupNotDefinedOnResourceException Gets status of given group-resource assignment.- Parameters:
sess
- sessiongroup
- groupresource
- resource- Returns:
- assignment status of the given group and resource
- Throws:
GroupNotDefinedOnResourceException
- if there is no such group-resource assignmentInternalErrorException
-
getResourceAssignments
Lists all of the resource assignments for the given group without the resources' attributes.- Parameters:
sess
- sessiongroup
- group- Returns:
- list of assigned resources for given group
- Throws:
InternalErrorException
-
getResourceById
Searches for the Resource with specified id.- Parameters:
perunSession
-id
-- Returns:
- Resource with specified id
- Throws:
ResourceNotExistsException
InternalErrorException
-
getResourceByName
Resource getResourceByName(PerunSession sess, Vo vo, Facility facility, String name) throws ResourceNotExistsException Return resource by its name.- Parameters:
sess
-vo
-facility
-name
-- Returns:
- resource
- Throws:
InternalErrorException
ResourceNotExistsException
-
getResources
Get all VO resources.- Parameters:
perunSession
-vo
-- Returns:
- list of resources
- Throws:
InternalErrorException
-
getResources
Get all resources.- Parameters:
sess
- session- Returns:
- list of resources
- Throws:
InternalErrorException
- internal error
-
getResources
List<Resource> getResources(PerunSession sess, User user, List<Status> memberStatuses, List<MemberGroupStatus> memberGroupStatuses, List<GroupResourceStatus> groupResourceStatuses) Return all resources where user is assigned. Checks member's status in VO and group and status of group-resource assignment. If statuses are null or empty all statuses are used.- Parameters:
sess
-user
-memberStatuses
- allowed member's statuses in VOmemberGroupStatuses
- allowed member's statuses in groupgroupResourceStatuses
- allowed statuses of group-resource assignment- Returns:
- List of allowed resources for the user
- Throws:
InternalErrorException
-
getResourcesByAttribute
Returns all resources which have set the attribute with the value. Searching only def and opt attributes.- Parameters:
sess
-attribute
-- Returns:
- Throws:
InternalErrorException
-
getResourcesByIds
Gets resources by their ids. Silently skips non-existing resources.- Parameters:
perunSession
-ids
-- Returns:
- List of resources with specified ids
- Throws:
InternalErrorException
-
getResourcesCount
Get all VO resources count.- Parameters:
perunSession
-vo
-- Returns:
- count of vo resources
- Throws:
InternalErrorException
-
getResourcesCount
Get count of all resources.- Parameters:
perunSession
-- Returns:
- count of all resources
- Throws:
InternalErrorException
-
getResourcesWhereGroupIsAdmin
List<Resource> getResourcesWhereGroupIsAdmin(PerunSession sess, Facility facility, Vo vo, Group authorizedGroup) Return all resources for the facility and the vo where the group is authorized as resource manager.- Parameters:
sess
-facility
- the facility to which resources should be assigned tovo
- the vo to which resources should be assigned toauthorizedGroup
- group with resource manager role for all those resources- Returns:
- list of defined resources where groups has role resource manager
- Throws:
InternalErrorException
-
getResourcesWhereUserIsAdmin
Returns list of resources, where the user is an admin. Including resources, where the user is a VALID member of authorized group.- Parameters:
sess
-user
-- Returns:
- list of resources, where the user is an admin
- Throws:
InternalErrorException
-
getResourcesWhereUserIsAdmin
List<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, Facility facility, Vo vo, User authorizedUser) Return all resources for the facility and the vo where user is authorized as resource manager. Including resources, where the user is a VALID member of authorized group.- Parameters:
sess
-facility
- the facility to which resources should be assigned tovo
- the vo to which resources should be assigned toauthorizedUser
- user with resource manager role for all those resources- Returns:
- list of defined resources where user has role resource manager
- Throws:
InternalErrorException
-
getResourcesWhereUserIsAdmin
Return all resources for the vo where user is authorized as resource manager. Including resources, where the user is a VALID member of authorized group.- Parameters:
sess
-vo
- the vo to which resources should be assigned toauthorizedUser
- user with resource manager role for all those resources- Returns:
- list of defined resources where user has role resource manager
- Throws:
InternalErrorException
-
getRichResourceById
RichResource getRichResourceById(PerunSession perunSession, int id) throws ResourceNotExistsException Searches for the Rich Resource with specified id.- Parameters:
perunSession
-id
-- Returns:
- RichResource with specified id
- Throws:
ResourceNotExistsException
InternalErrorException
-
getRichResources
Get all VO rich resources.- Parameters:
perunSession
-vo
-- Returns:
- list of rich resources
- Throws:
InternalErrorException
-
getRichResourcesByIds
Gets rich resources by their ids. Silently skips non-existing rich resources.- Parameters:
perunSession
-ids
-- Returns:
- List of rich resources with specified ids
- Throws:
InternalErrorException
-
getRichResourcesWithMemberAndAttribute
List<RichResource> getRichResourcesWithMemberAndAttribute(PerunSession perunSession, Member member, AttributeDefinition ad) Return all rich resources with given attribute where given member is assigned.- Parameters:
perunSession
- sessionmember
- memberad
- attribute definition- Returns:
- list of corresponding rich resources
-
groupResourceAssignmentExists
Returns true if the group is assigned to the current resource with any status, false otherwise.- Parameters:
sess
-resource
-group
-- Returns:
- true if the group is assigned to the current resource.
- Throws:
InternalErrorException
-
isGroupAssigned
Returns true if the group is assigned to the current resource with ACTIVE status, false otherwise.- Parameters:
sess
-resource
-group
-- Returns:
- true if the group is assigned to the current resource with active status.
- Throws:
InternalErrorException
-
isGroupManuallyAssigned
Returns true if the group is assigned to the given resource manually, false otherwise.- Parameters:
sess
-group
-resource
-- Returns:
- true if the group is assigned to the given resource manually.
- Throws:
InternalErrorException
-
isUserAllowed
Check if the user is allowed as a member on the selected resource.- Parameters:
sess
-user
-resource
-- Returns:
- true if the user is allowed as a member on the selected resource.
-
isUserAssigned
Check if the user is assigned as a member on the selected resource.- Parameters:
sess
-user
-resource
-- Returns:
- true if the user is assigned as a member on the selected resource.
- Throws:
InternalErrorException
-
removeAllResourcesTagFromResource
Remove all existing Resource tags for specific resource.- Parameters:
perunSession
-resource
-- Throws:
InternalErrorException
-
removeAutomaticGroupFromResource
void removeAutomaticGroupFromResource(PerunSession perunSession, Group group, Resource resource, int sourceGroupId) throws GroupAlreadyRemovedFromResourceException Remove automatically assigned group from resource.- Parameters:
perunSession
-group
-resource
-sourceGroupId
- id of a source group through which was the group automatically assigned- Throws:
InternalErrorException
GroupAlreadyRemovedFromResourceException
- if there are 0 rows affected by removing group from resource
-
removeBan
Remove ban by id from resources bans.- Parameters:
sess
-banId
- id of specific ban- Throws:
InternalErrorException
BanNotExistsException
-
removeBan
Remove ban by member_id and facility_id- Parameters:
sess
-memberId
- the id of memberresourceId
- the id of resource- Throws:
InternalErrorException
BanNotExistsException
-
removeGroupFromResource
void removeGroupFromResource(PerunSession perunSession, Group group, Resource resource) throws GroupAlreadyRemovedFromResourceException Remove group from a resource.- Parameters:
perunSession
-group
-resource
-- Throws:
InternalErrorException
GroupAlreadyRemovedFromResourceException
- if there are 0 rows affected by removing group from resource
-
removeResourceTagFromResource
void removeResourceTagFromResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Remove specific ResourceTag from existing Resource.- Parameters:
perunSession
-resourceTag
-resource
-- Throws:
InternalErrorException
-
removeService
void removeService(PerunSession perunSession, Resource resource, Service service) throws ServiceNotAssignedException Remove service from resource.- Parameters:
perunSession
-resource
-service
-- Throws:
InternalErrorException
ServiceNotAssignedException
-
resourceExists
Check if resource exists in underlaying data source.- Parameters:
perunSession
-resource
-- Returns:
- true if resource exists in underlaying data source, false otherwise
- Throws:
InternalErrorException
-
setBan
Set ban for member on resource- Parameters:
sess
-banOnResource
- the ban- Returns:
- ban on resource
- Throws:
InternalErrorException
-
setFailedGroupResourceAssignmentCause
void setFailedGroupResourceAssignmentCause(PerunSession sess, Group group, Resource resource, String cause) throws GroupNotDefinedOnResourceException Sets the cause of failed group-resource assignment- Parameters:
sess
- sessiongroup
- groupresource
- resourcecause
- the cause of assignment failure- Throws:
GroupNotDefinedOnResourceException
- if there is no such group-resource assignment
-
setGroupResourceStatus
void setGroupResourceStatus(PerunSession sess, Group group, Resource resource, GroupResourceStatus status) throws GroupNotDefinedOnResourceException Sets status of given group-resource assignment to the specified status.- Parameters:
sess
- sessiongroup
- groupresource
- resourcestatus
- new status of the group-resource assignment- Throws:
GroupNotDefinedOnResourceException
- if there is no such group-resource assignmentInternalErrorException
-
updateBan
Update description and validity timestamp of specific ban.- Parameters:
sess
-banOnResource
- ban to be updated- Returns:
- updated ban
- Throws:
InternalErrorException
-
updateResource
Updates Resource.- Parameters:
perunSession
-resource
-- Returns:
- returns updated Resource
- Throws:
InternalErrorException
-
updateResourceTag
Update existing Resource tag.- Parameters:
perunSession
-resourceTag
-- Returns:
- updated ResourceTag
- Throws:
InternalErrorException
-