Package cz.metacentrum.perun.core.impl
Class ResourcesManagerImpl
java.lang.Object
cz.metacentrum.perun.core.impl.ResourcesManagerImpl
- All Implemented Interfaces:
ResourcesManagerImplApi
- Author:
- Slavek Licehammer glory@ics.muni.cz
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final RowMapper<AssignedResource> protected static final Stringprotected static final RowMapper<BanOnResource> protected static final Stringprotected static final RowMapper<GroupResourceAssignment> protected static final Stringprotected static final Stringprotected static final RowMapper<ResourceTag> protected static final Stringprotected static final RowMapper<RichResource> protected static final cz.metacentrum.perun.core.impl.ResourcesManagerImpl.RichResourceExtractor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassignAutomaticGroupToResource(PerunSession sess, Group group, Resource resource, Group sourceGroup) Assign group to a resource (automatic subgroup assignment).voidassignGroupToResource(PerunSession sess, Group group, Resource resource, boolean autoAssignSubgroups) Assign group to a resource.voidassignGroupToResourceState(PerunSession sess, Group group, Resource resource, GroupResourceStatus status) Set initial status to group-resource assignment.voidassignResourceTagToResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Assign existing ResourceTag on existing Resource.voidassignService(PerunSession sess, Resource resource, Service service) Assign service to resource.booleanbanExists(PerunSession sess, int banId) Get true if any band defined by id exists for any member and resource.booleanbanExists(PerunSession sess, int memberId, int resourceId) Get true if any ban for member and resource exists.voidcheckResourceExists(PerunSession sess, Resource resource) Check if resource exists in underlaying data source.voidcheckResourceTagExists(PerunSession sess, ResourceTag resourceTag) Check if resource tag exists in underlaying data source.createResource(PerunSession sess, Vo vo, Resource resource, Facility facility) Creates the resource.createResourceTag(PerunSession perunSession, ResourceTag resourceTag, Vo vo) Create new Resource tag.voiddeleteAllResourcesTagsForVo(PerunSession perunSession, Vo vo) Delete all ResourcesTags for specific VO.voiddeleteResource(PerunSession sess, Vo vo, Resource resource) Deletes resource by id.voiddeleteResourceTag(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 sess, 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 sess, 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 sess, Resource resource) List all services' id associated with the resource.getAssignedUsers(PerunSession sess, 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 sess, 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.intgetFacilityId(PerunSession sess, Resource resource) Deprecated.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 sess, 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 sess, Vo vo) Get all VO resources.getResourcesByAttribute(PerunSession sess, Attribute attribute) Returns all resources which have set the attribute with the value.getResourcesByIds(PerunSession sess, List<Integer> ids) Gets resources by their ids.intGet count of all resources.intgetResourcesCount(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 sess, int id) Searches for the Rich Resource with specified id.getRichResources(PerunSession sess, 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.booleangroupResourceAssignmentExists(PerunSession sess, Resource resource, Group group) Returns true if the group is assigned to the current resource with any status, false otherwise.protected voidbooleanisGroupAssigned(PerunSession sess, Resource resource, Group group) Returns true if the group is assigned to the current resource with ACTIVE status, false otherwise.booleanisGroupManuallyAssigned(PerunSession sess, Group group, Resource resource) Returns true if the group is assigned to the given resource manually, false otherwise.booleanisUserAllowed(PerunSession sess, User user, Resource resource) Check if the user is allowed as a member on the selected resource.booleanisUserAssigned(PerunSession sess, User user, Resource resource) Check if the user is assigned as a member on the selected resource.voidremoveAllResourcesTagFromResource(PerunSession perunSession, Resource resource) Remove all existing Resource tags for specific resource.voidremoveAutomaticGroupFromResource(PerunSession perunSession, Group group, Resource resource, int sourceGroupId) Remove automatically assigned group from resource.voidremoveBan(PerunSession sess, int banId) Remove ban by id from resources bans.voidremoveBan(PerunSession sess, int memberId, int resourceId) Remove ban by member_id and facility_idvoidremoveGroupFromResource(PerunSession sess, Group group, Resource resource) Remove group from a resource.voidremoveResourceTagFromResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Remove specific ResourceTag from existing Resource.voidremoveService(PerunSession sess, Resource resource, Service service) Remove service from resource.booleanresourceExists(PerunSession sess, Resource resource) Check if resource exists in underlaying data source.booleanresourceTagExists(PerunSession sess, ResourceTag resourceTag) setBan(PerunSession sess, BanOnResource banOnResource) Set ban for member on resourcevoidsetFailedGroupResourceAssignmentCause(PerunSession sess, Group group, Resource resource, String cause) Sets the cause of failed group-resource assignmentvoidsetGroupResourceStatus(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 sess, Resource resource) Updates Resource.updateResourceTag(PerunSession perunSession, ResourceTag resourceTag) Update existing Resource tag.
-
Field Details
-
RESOURCE_MAPPING_SELECT_QUERY
- See Also:
-
ASSIGNED_RESOURCE_MAPPING_SELECT_QUERY
- See Also:
-
GROUP_RESOURCE_ASSIGNMENT_MAPPING_SELECT_QUERY
- See Also:
-
RESOURCE_TAG_MAPPING_SELECT_QUERY
- See Also:
-
BAN_ON_RESOURCE_MAPPING_SELECT_QUERY
- See Also:
-
RESOURCE_MAPPER
-
ASSIGNED_RESOURCE_MAPPER
-
GROUP_RESOURCE_ASSIGNMENT_MAPPER
-
RESOURCE_TAG_MAPPER
-
RICH_RESOURCE_MAPPER
-
BAN_ON_RESOURCE_MAPPER
-
RICH_RESOURCE_WITH_TAGS_EXTRACTOR
protected static final cz.metacentrum.perun.core.impl.ResourcesManagerImpl.RichResourceExtractor RICH_RESOURCE_WITH_TAGS_EXTRACTOR
-
-
Constructor Details
-
ResourcesManagerImpl
-
-
Method Details
-
assignAutomaticGroupToResource
public void assignAutomaticGroupToResource(PerunSession sess, Group group, Resource resource, Group sourceGroup) throws GroupAlreadyAssignedException Description copied from interface:ResourcesManagerImplApiAssign group to a resource (automatic subgroup assignment).- Specified by:
assignAutomaticGroupToResourcein interfaceResourcesManagerImplApi- Parameters:
sess-group-resource-sourceGroup-- Throws:
GroupAlreadyAssignedException
-
assignGroupToResource
public void assignGroupToResource(PerunSession sess, Group group, Resource resource, boolean autoAssignSubgroups) throws GroupAlreadyAssignedException Description copied from interface:ResourcesManagerImplApiAssign group to a resource.- Specified by:
assignGroupToResourcein interfaceResourcesManagerImplApi- Parameters:
sess-group-resource-autoAssignSubgroups-- Throws:
GroupAlreadyAssignedException
-
assignGroupToResourceState
public void assignGroupToResourceState(PerunSession sess, Group group, Resource resource, GroupResourceStatus status) Description copied from interface:ResourcesManagerImplApiSet initial status to group-resource assignment.- Specified by:
assignGroupToResourceStatein interfaceResourcesManagerImplApi- Parameters:
sess-group-resource-status- Status of the group-resource assignment
-
assignResourceTagToResource
public void assignResourceTagToResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Description copied from interface:ResourcesManagerImplApiAssign existing ResourceTag on existing Resource.- Specified by:
assignResourceTagToResourcein interfaceResourcesManagerImplApi- Parameters:
perunSession-resource-
-
assignService
public void assignService(PerunSession sess, Resource resource, Service service) throws ServiceAlreadyAssignedException Description copied from interface:ResourcesManagerImplApiAssign service to resource.- Specified by:
assignServicein interfaceResourcesManagerImplApi- Parameters:
sess-resource-service-- Throws:
ServiceAlreadyAssignedException
-
banExists
Description copied from interface:ResourcesManagerImplApiGet true if any ban for member and resource exists.- Specified by:
banExistsin interfaceResourcesManagerImplApi- Parameters:
sess-memberId- id of memberresourceId- id of resource- Returns:
- true if ban exists
-
banExists
Description copied from interface:ResourcesManagerImplApiGet true if any band defined by id exists for any member and resource.- Specified by:
banExistsin interfaceResourcesManagerImplApi- Parameters:
sess-banId- id of ban- Returns:
- true if ban exists
-
checkResourceExists
public void checkResourceExists(PerunSession sess, Resource resource) throws ResourceNotExistsException Description copied from interface:ResourcesManagerImplApiCheck if resource exists in underlaying data source.- Specified by:
checkResourceExistsin interfaceResourcesManagerImplApi- Parameters:
sess-resource-- Throws:
ResourceNotExistsException
-
checkResourceTagExists
public void checkResourceTagExists(PerunSession sess, ResourceTag resourceTag) throws ResourceTagNotExistsException Description copied from interface:ResourcesManagerImplApiCheck if resource tag exists in underlaying data source.- Specified by:
checkResourceTagExistsin interfaceResourcesManagerImplApi- Parameters:
sess-resourceTag-- Throws:
ResourceTagNotExistsException
-
createResource
Description copied from interface:ResourcesManagerImplApiCreates the resource. This methods sets ids and uuid to the given resource object but returns a new resource object loaded from db.- Specified by:
createResourcein interfaceResourcesManagerImplApi- Parameters:
sess-vo-resource-facility-- Returns:
- newly created resource with id
-
createResourceTag
Description copied from interface:ResourcesManagerImplApiCreate new Resource tag.- Specified by:
createResourceTagin interfaceResourcesManagerImplApi- Parameters:
perunSession-resourceTag-vo-- Returns:
- new created resourceTag
-
deleteAllResourcesTagsForVo
Description copied from interface:ResourcesManagerImplApiDelete all ResourcesTags for specific VO.- Specified by:
deleteAllResourcesTagsForVoin interfaceResourcesManagerImplApi- Parameters:
perunSession-vo-
-
deleteResource
public void deleteResource(PerunSession sess, Vo vo, Resource resource) throws ResourceAlreadyRemovedException Description copied from interface:ResourcesManagerImplApiDeletes resource by id.- Specified by:
deleteResourcein interfaceResourcesManagerImplApi- Parameters:
sess-vo-resource-- Throws:
ResourceAlreadyRemovedException- if there are 0 rows affected by deleting from DB
-
deleteResourceTag
Description copied from interface:ResourcesManagerImplApiDelete existing Resource tag.- Specified by:
deleteResourceTagin interfaceResourcesManagerImplApi- Parameters:
perunSession-resourceTag-
-
getAdminGroups
Description copied from interface:ResourcesManagerImplApiGets list of all group administrators of the Resource.- Specified by:
getAdminGroupsin interfaceResourcesManagerImplApi- Parameters:
sess-resource-- Returns:
- list of groups who are admins in the resource
-
getAdmins
Description copied from interface:ResourcesManagerImplApiGets 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.- Specified by:
getAdminsin interfaceResourcesManagerImplApi- Parameters:
sess-resource-- Returns:
- list of users who are admins in the resource
-
getAllExpiredBansOnResources
Description copied from interface:ResourcesManagerImplApiGet all expired bans on any resource to now date- Specified by:
getAllExpiredBansOnResourcesin interfaceResourcesManagerImplApi- Parameters:
sess-- Returns:
- list of expired bans for any resource
-
getAllResources
Description copied from interface:ResourcesManagerImplApiGet all resources from database.- Specified by:
getAllResourcesin interfaceResourcesManagerImplApi- Parameters:
sess- Perun session- Returns:
- list of all resources
-
getAllResourcesByResourceTag
public List<Resource> getAllResourcesByResourceTag(PerunSession perunSession, ResourceTag resourceTag) Description copied from interface:ResourcesManagerImplApiGet all resources in specific Vo (specific by resourceTag.getVoId) for existing resourceTag- Specified by:
getAllResourcesByResourceTagin interfaceResourcesManagerImplApi- Parameters:
perunSession-resourceTag-- Returns:
- list of Resources
-
getAllResourcesTagsForResource
public List<ResourceTag> getAllResourcesTagsForResource(PerunSession perunSession, Resource resource) Description copied from interface:ResourcesManagerImplApiGet all resourcesTags for existing Resource- Specified by:
getAllResourcesTagsForResourcein interfaceResourcesManagerImplApi- Parameters:
perunSession-resource-- Returns:
- list of ResourcesTags
-
getAllResourcesTagsForVo
Description copied from interface:ResourcesManagerImplApiGet all resourcesTags for existing Vo.- Specified by:
getAllResourcesTagsForVoin interfaceResourcesManagerImplApi- Parameters:
perunSession-vo-- Returns:
- list of all resourcesTags for existing Vo
-
getAllowedMembers
Description copied from interface:ResourcesManagerImplApiReturns 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.- Specified by:
getAllowedMembersin interfaceResourcesManagerImplApi- Parameters:
sess-resource-- Returns:
- list of members
-
getAllowedMembersNotExpiredInGroup
Description copied from interface:ResourcesManagerImplApiReturns 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.- Specified by:
getAllowedMembersNotExpiredInGroupin interfaceResourcesManagerImplApi- Parameters:
sess-resource-- Returns:
- list of members
-
getAllowedResources
Description copied from interface:ResourcesManagerImplApiReturn all resources through which user is allowed on facility.- Specified by:
getAllowedResourcesin interfaceResourcesManagerImplApi- Parameters:
sess-facility-user-- Returns:
- List of allowed resources for the user on facility
-
getAllowedUsers
Description copied from interface:ResourcesManagerImplApiReturns all users who are allowed on the defined resource.- Specified by:
getAllowedUsersin interfaceResourcesManagerImplApi- Parameters:
sess-resource-- Returns:
- list of users
-
getAllowedUsersNotExpiredInGroup
Description copied from interface:ResourcesManagerImplApiReturns 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.- Specified by:
getAllowedUsersNotExpiredInGroupin interfaceResourcesManagerImplApi- Parameters:
sess-resource-- Returns:
- list of users
-
getAssignedMembers
Description copied from interface:ResourcesManagerImplApiReturns all members who are assigned on the defined resource.- Specified by:
getAssignedMembersin interfaceResourcesManagerImplApi- Parameters:
sess-resource-- Returns:
- list of members
-
getAssignedMembersWithStatus
Description copied from interface:ResourcesManagerImplApiReturns members of groups assigned to resource with status of group-resource assignment. RichMember attribute has only Member set.- Specified by:
getAssignedMembersWithStatusin interfaceResourcesManagerImplApi- Parameters:
sess- perunSessionresource- resource- Returns:
- list of members of groups assigned to given resource
-
getAssignedResources
Description copied from interface:ResourcesManagerImplApiList all resources to which the group is assigned.- Specified by:
getAssignedResourcesin interfaceResourcesManagerImplApi- Parameters:
sess-group-- Returns:
- list of assigned resources
-
getAssignedResources
Description copied from interface:ResourcesManagerImplApiReturns all resources where the member is assigned through the groups.- Specified by:
getAssignedResourcesin interfaceResourcesManagerImplApi- Parameters:
sess-member-- Returns:
- list of resources
-
getAssignedResources
Description copied from interface:ResourcesManagerImplApiReturns all resources where member and service are assigned together.- Specified by:
getAssignedResourcesin interfaceResourcesManagerImplApi- Parameters:
sess-member-service-- Returns:
- list of resources
-
getAssignedResources
Description copied from interface:ResourcesManagerImplApiReturns all resources where the user is assigned through the specified vo and its groups.- Specified by:
getAssignedResourcesin interfaceResourcesManagerImplApi- Parameters:
sess-user-vo-- Returns:
- list of resources
- See Also:
-
getAssignedResourcesWithStatus
Description copied from interface:ResourcesManagerImplApiReturns all assigned resources where member is assigned through the groups.- Specified by:
getAssignedResourcesWithStatusin interfaceResourcesManagerImplApi- Parameters:
sess- perun sessionmember- member- Returns:
- list of assigned resources
-
getAssignedRichResources
Description copied from interface:ResourcesManagerImplApiList of all rich resources associated with the group.- Specified by:
getAssignedRichResourcesin interfaceResourcesManagerImplApi- Parameters:
sess-group-- Returns:
- list of assigned rich resources
-
getAssignedRichResources
Description copied from interface:ResourcesManagerImplApiReturns all rich resources where the member is assigned through the groups.- Specified by:
getAssignedRichResourcesin interfaceResourcesManagerImplApi- Parameters:
sess-member-- Returns:
- list of rich resources
-
getAssignedRichResources
public List<RichResource> getAssignedRichResources(PerunSession sess, Member member, Service service) Description copied from interface:ResourcesManagerImplApiReturns all rich resources where the service and the member are assigned through the groups.- Specified by:
getAssignedRichResourcesin interfaceResourcesManagerImplApi- Parameters:
sess-member-service-- Returns:
- list of rich resources
-
getAssignedServices
Description copied from interface:ResourcesManagerImplApiList all services' id associated with the resource.- Specified by:
getAssignedServicesin interfaceResourcesManagerImplApi- Parameters:
sess-resource-- Returns:
- list of assigned service' id
-
getAssignedUsers
Description copied from interface:ResourcesManagerImplApiReturns all user assigned to the resource.- Specified by:
getAssignedUsersin interfaceResourcesManagerImplApi- Parameters:
sess-resource-- Returns:
- list of user assigned to the resource
-
getAssociatedMembers
Description copied from interface:ResourcesManagerImplApiReturns all members who are associated with the resource. Does not require ACTIVE group-resource status or any specific member status.- Specified by:
getAssociatedMembersin interfaceResourcesManagerImplApi- Parameters:
sess-resource-- Returns:
- list of members
-
getAssociatedResources
Description copied from interface:ResourcesManagerImplApiList all resources associated with the group. Does not require ACTIVE group-resource status.- Specified by:
getAssociatedResourcesin interfaceResourcesManagerImplApi- Parameters:
sess-group-- Returns:
- list of associated resources
-
getAssociatedResources
Description copied from interface:ResourcesManagerImplApiReturns all resources with which the member is associated through the groups. Does not require ACTIVE group-resource status.- Specified by:
getAssociatedResourcesin interfaceResourcesManagerImplApi- Parameters:
sess-member-- Returns:
- list of resources
-
getAssociatedUsers
Description copied from interface:ResourcesManagerImplApiReturns all users who are associated with the defined resource. Does not require ACTIVE group-resource status.- Specified by:
getAssociatedUsersin interfaceResourcesManagerImplApi- Parameters:
sess-resource-- Returns:
- list of users
-
getBan
public BanOnResource getBan(PerunSession sess, int memberId, int resourceId) throws BanNotExistsException Description copied from interface:ResourcesManagerImplApiGet specific resource ban.- Specified by:
getBanin interfaceResourcesManagerImplApi- Parameters:
sess-memberId- the member idresourceId- the resource id- Returns:
- specific resource ban
- Throws:
BanNotExistsException
-
getBanById
Description copied from interface:ResourcesManagerImplApiGet Ban for member on resource by it's id- Specified by:
getBanByIdin interfaceResourcesManagerImplApi- Parameters:
sess-banId- the ban id- Returns:
- resource ban by it's id
- Throws:
BanNotExistsException
-
getBansForMember
Description copied from interface:ResourcesManagerImplApiGet all resources bans for member.- Specified by:
getBansForMemberin interfaceResourcesManagerImplApi- Parameters:
sess-memberId- the member id- Returns:
- list of bans for member on any resource
-
getBansForResource
Description copied from interface:ResourcesManagerImplApiGet all members bans for resource- Specified by:
getBansForResourcein interfaceResourcesManagerImplApi- Parameters:
sess-resourceId- the resource id- Returns:
- list of all members bans on resource
-
getDirectAdmins
Description copied from interface:ResourcesManagerImplApiGets 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.- Specified by:
getDirectAdminsin interfaceResourcesManagerImplApi- Parameters:
perunSession-resource-- Returns:
- list of direct admins of the resource
-
getFacilityId
Deprecated.Description copied from interface:ResourcesManagerImplApiGet facility id which belongs to the concrete resource.- Specified by:
getFacilityIdin interfaceResourcesManagerImplApi- Parameters:
sess-resource-- Returns:
- facility id
-
getFailedGroupResourceAssignmentCause
public String getFailedGroupResourceAssignmentCause(PerunSession sess, Group group, Resource resource) Description copied from interface:ResourcesManagerImplApiGets the current cause of failed group-resource assignment. Returns null if there is no such group-resource assignment.- Specified by:
getFailedGroupResourceAssignmentCausein interfaceResourcesManagerImplApi- Parameters:
sess- sessiongroup- groupresource- resource- Returns:
- error message
-
getGroupAssignments
Description copied from interface:ResourcesManagerImplApiLists all of the assigned groups for the given resource without the groups' attributes.- Specified by:
getGroupAssignmentsin interfaceResourcesManagerImplApi- Parameters:
sess- sessionresource- resource- Returns:
- list of assigned groups for given resource
-
getGroupResourceAssignments
public List<GroupResourceAssignment> getGroupResourceAssignments(PerunSession sess, List<GroupResourceStatus> statuses) Description copied from interface:ResourcesManagerImplApiLists all group-resource assignments with given statuses. If statuses are empty or null, lists assignments with all statuses.- Specified by:
getGroupResourceAssignmentsin interfaceResourcesManagerImplApi- Parameters:
sess- sessionstatuses- list of allowed statuses- Returns:
- list of group-resource assignments with given statuses
-
getGroupResourceStatus
public GroupResourceStatus getGroupResourceStatus(PerunSession sess, Group group, Resource resource) throws GroupNotDefinedOnResourceException Description copied from interface:ResourcesManagerImplApiGets status of given group-resource assignment.- Specified by:
getGroupResourceStatusin interfaceResourcesManagerImplApi- Parameters:
sess- sessiongroup- groupresource- resource- Returns:
- assignment status of the given group and resource
- Throws:
GroupNotDefinedOnResourceException- if there is no such group-resource assignment
-
getResourceAssignments
Description copied from interface:ResourcesManagerImplApiLists all of the resource assignments for the given group without the resources' attributes.- Specified by:
getResourceAssignmentsin interfaceResourcesManagerImplApi- Parameters:
sess- sessiongroup- group- Returns:
- list of assigned resources for given group
-
getResourceById
Description copied from interface:ResourcesManagerImplApiSearches for the Resource with specified id.- Specified by:
getResourceByIdin interfaceResourcesManagerImplApi- Parameters:
sess-id-- Returns:
- Resource with specified id
- Throws:
ResourceNotExistsException
-
getResourceByName
public Resource getResourceByName(PerunSession sess, Vo vo, Facility facility, String name) throws ResourceNotExistsException Description copied from interface:ResourcesManagerImplApiReturn resource by its name.- Specified by:
getResourceByNamein interfaceResourcesManagerImplApi- Parameters:
sess-vo-facility-name-- Returns:
- resource
- Throws:
ResourceNotExistsException
-
getResources
Description copied from interface:ResourcesManagerImplApiGet all VO resources.- Specified by:
getResourcesin interfaceResourcesManagerImplApi- Parameters:
sess-vo-- Returns:
- list of resources
-
getResources
Description copied from interface:ResourcesManagerImplApiGet all resources.- Specified by:
getResourcesin interfaceResourcesManagerImplApi- Parameters:
sess- session- Returns:
- list of resources
-
getResources
public List<Resource> getResources(PerunSession sess, User user, List<Status> memberStatuses, List<MemberGroupStatus> memberGroupStatuses, List<GroupResourceStatus> groupResourceStatuses) Description copied from interface:ResourcesManagerImplApiReturn 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.- Specified by:
getResourcesin interfaceResourcesManagerImplApi- 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
-
getResourcesByAttribute
Description copied from interface:ResourcesManagerImplApiReturns all resources which have set the attribute with the value. Searching only def and opt attributes.- Specified by:
getResourcesByAttributein interfaceResourcesManagerImplApi- Parameters:
sess-attribute-- Returns:
-
getResourcesByIds
Description copied from interface:ResourcesManagerImplApiGets resources by their ids. Silently skips non-existing resources.- Specified by:
getResourcesByIdsin interfaceResourcesManagerImplApi- Parameters:
sess-ids-- Returns:
- List of resources with specified ids
-
getResourcesCount
Description copied from interface:ResourcesManagerImplApiGet all VO resources count.- Specified by:
getResourcesCountin interfaceResourcesManagerImplApi- Parameters:
perunSession-vo-- Returns:
- count of vo resources
-
getResourcesCount
Description copied from interface:ResourcesManagerImplApiGet count of all resources.- Specified by:
getResourcesCountin interfaceResourcesManagerImplApi- Parameters:
sess-- Returns:
- count of all resources
-
getResourcesWhereGroupIsAdmin
public List<Resource> getResourcesWhereGroupIsAdmin(PerunSession sess, Facility facility, Vo vo, Group authorizedGroup) Description copied from interface:ResourcesManagerImplApiReturn all resources for the facility and the vo where the group is authorized as resource manager.- Specified by:
getResourcesWhereGroupIsAdminin interfaceResourcesManagerImplApi- 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
-
getResourcesWhereUserIsAdmin
Description copied from interface:ResourcesManagerImplApiReturns list of resources, where the user is an admin. Including resources, where the user is a VALID member of authorized group.- Specified by:
getResourcesWhereUserIsAdminin interfaceResourcesManagerImplApi- Parameters:
sess-user-- Returns:
- list of resources, where the user is an admin
-
getResourcesWhereUserIsAdmin
public List<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, Facility facility, Vo vo, User authorizedUser) Description copied from interface:ResourcesManagerImplApiReturn 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.- Specified by:
getResourcesWhereUserIsAdminin interfaceResourcesManagerImplApi- 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
-
getResourcesWhereUserIsAdmin
Description copied from interface:ResourcesManagerImplApiReturn all resources for the vo where user is authorized as resource manager. Including resources, where the user is a VALID member of authorized group.- Specified by:
getResourcesWhereUserIsAdminin interfaceResourcesManagerImplApi- 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
-
getRichResourceById
public RichResource getRichResourceById(PerunSession sess, int id) throws ResourceNotExistsException Description copied from interface:ResourcesManagerImplApiSearches for the Rich Resource with specified id.- Specified by:
getRichResourceByIdin interfaceResourcesManagerImplApi- Parameters:
sess-id-- Returns:
- RichResource with specified id
- Throws:
ResourceNotExistsException
-
getRichResources
Description copied from interface:ResourcesManagerImplApiGet all VO rich resources.- Specified by:
getRichResourcesin interfaceResourcesManagerImplApi- Parameters:
sess-vo-- Returns:
- list of rich resources
-
getRichResourcesByIds
Description copied from interface:ResourcesManagerImplApiGets rich resources by their ids. Silently skips non-existing rich resources.- Specified by:
getRichResourcesByIdsin interfaceResourcesManagerImplApi- Parameters:
perunSession-ids-- Returns:
- List of rich resources with specified ids
-
getRichResourcesWithMemberAndAttribute
public List<RichResource> getRichResourcesWithMemberAndAttribute(PerunSession perunSession, Member member, AttributeDefinition ad) Description copied from interface:ResourcesManagerImplApiReturn all rich resources with given attribute where given member is assigned.- Specified by:
getRichResourcesWithMemberAndAttributein interfaceResourcesManagerImplApi- Parameters:
perunSession- sessionmember- memberad- attribute definition- Returns:
- list of corresponding rich resources
-
groupResourceAssignmentExists
Description copied from interface:ResourcesManagerImplApiReturns true if the group is assigned to the current resource with any status, false otherwise.- Specified by:
groupResourceAssignmentExistsin interfaceResourcesManagerImplApi- Parameters:
sess-resource-group-- Returns:
- true if the group is assigned to the current resource.
-
initialize
protected void initialize() -
isGroupAssigned
Description copied from interface:ResourcesManagerImplApiReturns true if the group is assigned to the current resource with ACTIVE status, false otherwise.- Specified by:
isGroupAssignedin interfaceResourcesManagerImplApi- Parameters:
sess-resource-group-- Returns:
- true if the group is assigned to the current resource with active status.
-
isGroupManuallyAssigned
Description copied from interface:ResourcesManagerImplApiReturns true if the group is assigned to the given resource manually, false otherwise.- Specified by:
isGroupManuallyAssignedin interfaceResourcesManagerImplApi- Parameters:
sess-group-resource-- Returns:
- true if the group is assigned to the given resource manually.
-
isUserAllowed
Description copied from interface:ResourcesManagerImplApiCheck if the user is allowed as a member on the selected resource.- Specified by:
isUserAllowedin interfaceResourcesManagerImplApi- Parameters:
sess-user-resource-- Returns:
- true if the user is allowed as a member on the selected resource.
-
isUserAssigned
Description copied from interface:ResourcesManagerImplApiCheck if the user is assigned as a member on the selected resource.- Specified by:
isUserAssignedin interfaceResourcesManagerImplApi- Parameters:
sess-user-resource-- Returns:
- true if the user is assigned as a member on the selected resource.
-
removeAllResourcesTagFromResource
Description copied from interface:ResourcesManagerImplApiRemove all existing Resource tags for specific resource.- Specified by:
removeAllResourcesTagFromResourcein interfaceResourcesManagerImplApi- Parameters:
perunSession-resource-
-
removeAutomaticGroupFromResource
public void removeAutomaticGroupFromResource(PerunSession perunSession, Group group, Resource resource, int sourceGroupId) throws GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerImplApiRemove automatically assigned group from resource.- Specified by:
removeAutomaticGroupFromResourcein interfaceResourcesManagerImplApi- Parameters:
perunSession-group-resource-sourceGroupId- id of a source group through which was the group automatically assigned- Throws:
GroupAlreadyRemovedFromResourceException- if there are 0 rows affected by removing group from resource
-
removeBan
Description copied from interface:ResourcesManagerImplApiRemove ban by id from resources bans.- Specified by:
removeBanin interfaceResourcesManagerImplApi- Parameters:
sess-banId- id of specific ban- Throws:
BanNotExistsException
-
removeBan
Description copied from interface:ResourcesManagerImplApiRemove ban by member_id and facility_id- Specified by:
removeBanin interfaceResourcesManagerImplApi- Parameters:
sess-memberId- the id of memberresourceId- the id of resource- Throws:
BanNotExistsException
-
removeGroupFromResource
public void removeGroupFromResource(PerunSession sess, Group group, Resource resource) throws GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerImplApiRemove group from a resource.- Specified by:
removeGroupFromResourcein interfaceResourcesManagerImplApi- Parameters:
sess-group-resource-- Throws:
GroupAlreadyRemovedFromResourceException- if there are 0 rows affected by removing group from resource
-
removeResourceTagFromResource
public void removeResourceTagFromResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Description copied from interface:ResourcesManagerImplApiRemove specific ResourceTag from existing Resource.- Specified by:
removeResourceTagFromResourcein interfaceResourcesManagerImplApi- Parameters:
perunSession-resourceTag-resource-
-
removeService
public void removeService(PerunSession sess, Resource resource, Service service) throws ServiceNotAssignedException Description copied from interface:ResourcesManagerImplApiRemove service from resource.- Specified by:
removeServicein interfaceResourcesManagerImplApi- Parameters:
sess-resource-service-- Throws:
ServiceNotAssignedException
-
resourceExists
Description copied from interface:ResourcesManagerImplApiCheck if resource exists in underlaying data source.- Specified by:
resourceExistsin interfaceResourcesManagerImplApi- Parameters:
sess-resource-- Returns:
- true if resource exists in underlaying data source, false otherwise
-
resourceTagExists
-
setBan
Description copied from interface:ResourcesManagerImplApiSet ban for member on resource- Specified by:
setBanin interfaceResourcesManagerImplApi- Parameters:
sess-banOnResource- the ban- Returns:
- ban on resource
-
setFailedGroupResourceAssignmentCause
public void setFailedGroupResourceAssignmentCause(PerunSession sess, Group group, Resource resource, String cause) throws GroupNotDefinedOnResourceException Description copied from interface:ResourcesManagerImplApiSets the cause of failed group-resource assignment- Specified by:
setFailedGroupResourceAssignmentCausein interfaceResourcesManagerImplApi- Parameters:
sess- sessiongroup- groupresource- resourcecause- the cause of assignment failure- Throws:
GroupNotDefinedOnResourceException- if there is no such group-resource assignment
-
setGroupResourceStatus
public void setGroupResourceStatus(PerunSession sess, Group group, Resource resource, GroupResourceStatus status) throws GroupNotDefinedOnResourceException Description copied from interface:ResourcesManagerImplApiSets status of given group-resource assignment to the specified status.- Specified by:
setGroupResourceStatusin interfaceResourcesManagerImplApi- Parameters:
sess- sessiongroup- groupresource- resourcestatus- new status of the group-resource assignment- Throws:
GroupNotDefinedOnResourceException- if there is no such group-resource assignment
-
updateBan
Description copied from interface:ResourcesManagerImplApiUpdate description and validity timestamp of specific ban.- Specified by:
updateBanin interfaceResourcesManagerImplApi- Parameters:
sess-banOnResource- ban to be updated- Returns:
- updated ban
-
updateResource
Description copied from interface:ResourcesManagerImplApiUpdates Resource.- Specified by:
updateResourcein interfaceResourcesManagerImplApi- Parameters:
sess-resource-- Returns:
- returns updated Resource
-
updateResourceTag
Description copied from interface:ResourcesManagerImplApiUpdate existing Resource tag.- Specified by:
updateResourceTagin interfaceResourcesManagerImplApi- Parameters:
perunSession-resourceTag-- Returns:
- updated ResourceTag
-