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 SummaryFieldsModifier 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 SummaryConstructors
- 
Method SummaryModifier 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_EXTRACTORprotected static final cz.metacentrum.perun.core.impl.ResourcesManagerImpl.RichResourceExtractor RICH_RESOURCE_WITH_TAGS_EXTRACTOR
 
- 
- 
Constructor Details- 
ResourcesManagerImpl
 
- 
- 
Method Details- 
assignAutomaticGroupToResourcepublic 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 interface- ResourcesManagerImplApi
- Parameters:
- sess-
- group-
- resource-
- sourceGroup-
- Throws:
- GroupAlreadyAssignedException
 
- 
assignGroupToResourcepublic void assignGroupToResource(PerunSession sess, Group group, Resource resource, boolean autoAssignSubgroups) throws GroupAlreadyAssignedException Description copied from interface:ResourcesManagerImplApiAssign group to a resource.- Specified by:
- assignGroupToResourcein interface- ResourcesManagerImplApi
- Parameters:
- sess-
- group-
- resource-
- autoAssignSubgroups-
- Throws:
- GroupAlreadyAssignedException
 
- 
assignGroupToResourceStatepublic void assignGroupToResourceState(PerunSession sess, Group group, Resource resource, GroupResourceStatus status) Description copied from interface:ResourcesManagerImplApiSet initial status to group-resource assignment.- Specified by:
- assignGroupToResourceStatein interface- ResourcesManagerImplApi
- Parameters:
- sess-
- group-
- resource-
- status- Status of the group-resource assignment
 
- 
assignResourceTagToResourcepublic void assignResourceTagToResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Description copied from interface:ResourcesManagerImplApiAssign existing ResourceTag on existing Resource.- Specified by:
- assignResourceTagToResourcein interface- ResourcesManagerImplApi
- Parameters:
- perunSession-
- resource-
 
- 
assignServicepublic void assignService(PerunSession sess, Resource resource, Service service) throws ServiceAlreadyAssignedException Description copied from interface:ResourcesManagerImplApiAssign service to resource.- Specified by:
- assignServicein interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- service-
- Throws:
- ServiceAlreadyAssignedException
 
- 
banExistsDescription copied from interface:ResourcesManagerImplApiGet true if any ban for member and resource exists.- Specified by:
- banExistsin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- memberId- id of member
- resourceId- id of resource
- Returns:
- true if ban exists
 
- 
banExistsDescription copied from interface:ResourcesManagerImplApiGet true if any band defined by id exists for any member and resource.- Specified by:
- banExistsin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- banId- id of ban
- Returns:
- true if ban exists
 
- 
checkResourceExistspublic void checkResourceExists(PerunSession sess, Resource resource) throws ResourceNotExistsException Description copied from interface:ResourcesManagerImplApiCheck if resource exists in underlaying data source.- Specified by:
- checkResourceExistsin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- Throws:
- ResourceNotExistsException
 
- 
checkResourceTagExistspublic void checkResourceTagExists(PerunSession sess, ResourceTag resourceTag) throws ResourceTagNotExistsException Description copied from interface:ResourcesManagerImplApiCheck if resource tag exists in underlaying data source.- Specified by:
- checkResourceTagExistsin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resourceTag-
- Throws:
- ResourceTagNotExistsException
 
- 
createResourceDescription 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 interface- ResourcesManagerImplApi
- Parameters:
- sess-
- vo-
- resource-
- facility-
- Returns:
- newly created resource with id
 
- 
createResourceTagDescription copied from interface:ResourcesManagerImplApiCreate new Resource tag.- Specified by:
- createResourceTagin interface- ResourcesManagerImplApi
- Parameters:
- perunSession-
- resourceTag-
- vo-
- Returns:
- new created resourceTag
 
- 
deleteAllResourcesTagsForVoDescription copied from interface:ResourcesManagerImplApiDelete all ResourcesTags for specific VO.- Specified by:
- deleteAllResourcesTagsForVoin interface- ResourcesManagerImplApi
- Parameters:
- perunSession-
- vo-
 
- 
deleteResourcepublic void deleteResource(PerunSession sess, Vo vo, Resource resource) throws ResourceAlreadyRemovedException Description copied from interface:ResourcesManagerImplApiDeletes resource by id.- Specified by:
- deleteResourcein interface- ResourcesManagerImplApi
- Parameters:
- sess-
- vo-
- resource-
- Throws:
- ResourceAlreadyRemovedException- if there are 0 rows affected by deleting from DB
 
- 
deleteResourceTagDescription copied from interface:ResourcesManagerImplApiDelete existing Resource tag.- Specified by:
- deleteResourceTagin interface- ResourcesManagerImplApi
- Parameters:
- perunSession-
- resourceTag-
 
- 
getAdminGroupsDescription copied from interface:ResourcesManagerImplApiGets list of all group administrators of the Resource.- Specified by:
- getAdminGroupsin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- Returns:
- list of groups who are admins in the resource
 
- 
getAdminsDescription 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 interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- Returns:
- list of users who are admins in the resource
 
- 
getAllExpiredBansOnResourcesDescription copied from interface:ResourcesManagerImplApiGet all expired bans on any resource to now date- Specified by:
- getAllExpiredBansOnResourcesin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- Returns:
- list of expired bans for any resource
 
- 
getAllResourcesDescription copied from interface:ResourcesManagerImplApiGet all resources from database.- Specified by:
- getAllResourcesin interface- ResourcesManagerImplApi
- Parameters:
- sess- Perun session
- Returns:
- list of all resources
 
- 
getAllResourcesByResourceTagpublic 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 interface- ResourcesManagerImplApi
- Parameters:
- perunSession-
- resourceTag-
- Returns:
- list of Resources
 
- 
getAllResourcesTagsForResourcepublic List<ResourceTag> getAllResourcesTagsForResource(PerunSession perunSession, Resource resource) Description copied from interface:ResourcesManagerImplApiGet all resourcesTags for existing Resource- Specified by:
- getAllResourcesTagsForResourcein interface- ResourcesManagerImplApi
- Parameters:
- perunSession-
- resource-
- Returns:
- list of ResourcesTags
 
- 
getAllResourcesTagsForVoDescription copied from interface:ResourcesManagerImplApiGet all resourcesTags for existing Vo.- Specified by:
- getAllResourcesTagsForVoin interface- ResourcesManagerImplApi
- Parameters:
- perunSession-
- vo-
- Returns:
- list of all resourcesTags for existing Vo
 
- 
getAllowedMembersDescription 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 interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- Returns:
- list of members
 
- 
getAllowedMembersNotExpiredInGroupDescription 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 interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- Returns:
- list of members
 
- 
getAllowedResourcesDescription copied from interface:ResourcesManagerImplApiReturn all resources through which user is allowed on facility.- Specified by:
- getAllowedResourcesin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- facility-
- user-
- Returns:
- List of allowed resources for the user on facility
 
- 
getAllowedUsersDescription copied from interface:ResourcesManagerImplApiReturns all users who are allowed on the defined resource.- Specified by:
- getAllowedUsersin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- Returns:
- list of users
 
- 
getAllowedUsersNotExpiredInGroupDescription 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 interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- Returns:
- list of users
 
- 
getAssignedMembersDescription copied from interface:ResourcesManagerImplApiReturns all members who are assigned on the defined resource.- Specified by:
- getAssignedMembersin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- Returns:
- list of members
 
- 
getAssignedMembersWithStatusDescription 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 interface- ResourcesManagerImplApi
- Parameters:
- sess- perunSession
- resource- resource
- Returns:
- list of members of groups assigned to given resource
 
- 
getAssignedResourcesDescription copied from interface:ResourcesManagerImplApiList all resources to which the group is assigned.- Specified by:
- getAssignedResourcesin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- group-
- Returns:
- list of assigned resources
 
- 
getAssignedResourcesDescription copied from interface:ResourcesManagerImplApiReturns all resources where the member is assigned through the groups.- Specified by:
- getAssignedResourcesin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- member-
- Returns:
- list of resources
 
- 
getAssignedResourcesDescription copied from interface:ResourcesManagerImplApiReturns all resources where member and service are assigned together.- Specified by:
- getAssignedResourcesin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- member-
- service-
- Returns:
- list of resources
 
- 
getAssignedResourcesDescription copied from interface:ResourcesManagerImplApiReturns all resources where the user is assigned through the specified vo and its groups.- Specified by:
- getAssignedResourcesin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- user-
- vo-
- Returns:
- list of resources
- See Also:
 
- 
getAssignedResourcesWithStatusDescription copied from interface:ResourcesManagerImplApiReturns all assigned resources where member is assigned through the groups.- Specified by:
- getAssignedResourcesWithStatusin interface- ResourcesManagerImplApi
- Parameters:
- sess- perun session
- member- member
- Returns:
- list of assigned resources
 
- 
getAssignedRichResourcesDescription copied from interface:ResourcesManagerImplApiList of all rich resources associated with the group.- Specified by:
- getAssignedRichResourcesin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- group-
- Returns:
- list of assigned rich resources
 
- 
getAssignedRichResourcesDescription copied from interface:ResourcesManagerImplApiReturns all rich resources where the member is assigned through the groups.- Specified by:
- getAssignedRichResourcesin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- member-
- Returns:
- list of rich resources
 
- 
getAssignedRichResourcespublic 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 interface- ResourcesManagerImplApi
- Parameters:
- sess-
- member-
- service-
- Returns:
- list of rich resources
 
- 
getAssignedServicesDescription copied from interface:ResourcesManagerImplApiList all services' id associated with the resource.- Specified by:
- getAssignedServicesin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- Returns:
- list of assigned service' id
 
- 
getAssignedUsersDescription copied from interface:ResourcesManagerImplApiReturns all user assigned to the resource.- Specified by:
- getAssignedUsersin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- Returns:
- list of user assigned to the resource
 
- 
getAssociatedMembersDescription 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 interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- Returns:
- list of members
 
- 
getAssociatedResourcesDescription copied from interface:ResourcesManagerImplApiList all resources associated with the group. Does not require ACTIVE group-resource status.- Specified by:
- getAssociatedResourcesin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- group-
- Returns:
- list of associated resources
 
- 
getAssociatedResourcesDescription 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 interface- ResourcesManagerImplApi
- Parameters:
- sess-
- member-
- Returns:
- list of resources
 
- 
getAssociatedUsersDescription copied from interface:ResourcesManagerImplApiReturns all users who are associated with the defined resource. Does not require ACTIVE group-resource status.- Specified by:
- getAssociatedUsersin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- Returns:
- list of users
 
- 
getBanpublic BanOnResource getBan(PerunSession sess, int memberId, int resourceId) throws BanNotExistsException Description copied from interface:ResourcesManagerImplApiGet specific resource ban.- Specified by:
- getBanin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- memberId- the member id
- resourceId- the resource id
- Returns:
- specific resource ban
- Throws:
- BanNotExistsException
 
- 
getBanByIdDescription copied from interface:ResourcesManagerImplApiGet Ban for member on resource by it's id- Specified by:
- getBanByIdin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- banId- the ban id
- Returns:
- resource ban by it's id
- Throws:
- BanNotExistsException
 
- 
getBansForMemberDescription copied from interface:ResourcesManagerImplApiGet all resources bans for member.- Specified by:
- getBansForMemberin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- memberId- the member id
- Returns:
- list of bans for member on any resource
 
- 
getBansForResourceDescription copied from interface:ResourcesManagerImplApiGet all members bans for resource- Specified by:
- getBansForResourcein interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resourceId- the resource id
- Returns:
- list of all members bans on resource
 
- 
getDirectAdminsDescription 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 interface- ResourcesManagerImplApi
- Parameters:
- perunSession-
- resource-
- Returns:
- list of direct admins of the resource
 
- 
getFacilityIdDeprecated.Description copied from interface:ResourcesManagerImplApiGet facility id which belongs to the concrete resource.- Specified by:
- getFacilityIdin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- Returns:
- facility id
 
- 
getFailedGroupResourceAssignmentCausepublic 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 interface- ResourcesManagerImplApi
- Parameters:
- sess- session
- group- group
- resource- resource
- Returns:
- error message
 
- 
getGroupAssignmentsDescription copied from interface:ResourcesManagerImplApiLists all of the assigned groups for the given resource without the groups' attributes.- Specified by:
- getGroupAssignmentsin interface- ResourcesManagerImplApi
- Parameters:
- sess- session
- resource- resource
- Returns:
- list of assigned groups for given resource
 
- 
getGroupResourceAssignmentspublic 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 interface- ResourcesManagerImplApi
- Parameters:
- sess- session
- statuses- list of allowed statuses
- Returns:
- list of group-resource assignments with given statuses
 
- 
getGroupResourceStatuspublic GroupResourceStatus getGroupResourceStatus(PerunSession sess, Group group, Resource resource) throws GroupNotDefinedOnResourceException Description copied from interface:ResourcesManagerImplApiGets status of given group-resource assignment.- Specified by:
- getGroupResourceStatusin interface- ResourcesManagerImplApi
- Parameters:
- sess- session
- group- group
- resource- resource
- Returns:
- assignment status of the given group and resource
- Throws:
- GroupNotDefinedOnResourceException- if there is no such group-resource assignment
 
- 
getResourceAssignmentsDescription copied from interface:ResourcesManagerImplApiLists all of the resource assignments for the given group without the resources' attributes.- Specified by:
- getResourceAssignmentsin interface- ResourcesManagerImplApi
- Parameters:
- sess- session
- group- group
- Returns:
- list of assigned resources for given group
 
- 
getResourceByIdDescription copied from interface:ResourcesManagerImplApiSearches for the Resource with specified id.- Specified by:
- getResourceByIdin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- id-
- Returns:
- Resource with specified id
- Throws:
- ResourceNotExistsException
 
- 
getResourceByNamepublic Resource getResourceByName(PerunSession sess, Vo vo, Facility facility, String name) throws ResourceNotExistsException Description copied from interface:ResourcesManagerImplApiReturn resource by its name.- Specified by:
- getResourceByNamein interface- ResourcesManagerImplApi
- Parameters:
- sess-
- vo-
- facility-
- name-
- Returns:
- resource
- Throws:
- ResourceNotExistsException
 
- 
getResourcesDescription copied from interface:ResourcesManagerImplApiGet all VO resources.- Specified by:
- getResourcesin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- vo-
- Returns:
- list of resources
 
- 
getResourcesDescription copied from interface:ResourcesManagerImplApiGet all resources.- Specified by:
- getResourcesin interface- ResourcesManagerImplApi
- Parameters:
- sess- session
- Returns:
- list of resources
 
- 
getResourcespublic 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 interface- ResourcesManagerImplApi
- Parameters:
- sess-
- user-
- memberStatuses- allowed member's statuses in VO
- memberGroupStatuses- allowed member's statuses in group
- groupResourceStatuses- allowed statuses of group-resource assignment
- Returns:
- List of allowed resources for the user
 
- 
getResourcesByAttributeDescription copied from interface:ResourcesManagerImplApiReturns all resources which have set the attribute with the value. Searching only def and opt attributes.- Specified by:
- getResourcesByAttributein interface- ResourcesManagerImplApi
- Parameters:
- sess-
- attribute-
- Returns:
 
- 
getResourcesByIdsDescription copied from interface:ResourcesManagerImplApiGets resources by their ids. Silently skips non-existing resources.- Specified by:
- getResourcesByIdsin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- ids-
- Returns:
- List of resources with specified ids
 
- 
getResourcesCountDescription copied from interface:ResourcesManagerImplApiGet all VO resources count.- Specified by:
- getResourcesCountin interface- ResourcesManagerImplApi
- Parameters:
- perunSession-
- vo-
- Returns:
- count of vo resources
 
- 
getResourcesCountDescription copied from interface:ResourcesManagerImplApiGet count of all resources.- Specified by:
- getResourcesCountin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- Returns:
- count of all resources
 
- 
getResourcesWhereGroupIsAdminpublic 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 interface- ResourcesManagerImplApi
- Parameters:
- sess-
- facility- the facility to which resources should be assigned to
- vo- the vo to which resources should be assigned to
- authorizedGroup- group with resource manager role for all those resources
- Returns:
- list of defined resources where groups has role resource manager
 
- 
getResourcesWhereUserIsAdminDescription 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 interface- ResourcesManagerImplApi
- Parameters:
- sess-
- user-
- Returns:
- list of resources, where the user is an admin
 
- 
getResourcesWhereUserIsAdminpublic 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 interface- ResourcesManagerImplApi
- Parameters:
- sess-
- facility- the facility to which resources should be assigned to
- vo- the vo to which resources should be assigned to
- authorizedUser- user with resource manager role for all those resources
- Returns:
- list of defined resources where user has role resource manager
 
- 
getResourcesWhereUserIsAdminDescription 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 interface- ResourcesManagerImplApi
- Parameters:
- sess-
- vo- the vo to which resources should be assigned to
- authorizedUser- user with resource manager role for all those resources
- Returns:
- list of defined resources where user has role resource manager
 
- 
getRichResourceByIdpublic RichResource getRichResourceById(PerunSession sess, int id) throws ResourceNotExistsException Description copied from interface:ResourcesManagerImplApiSearches for the Rich Resource with specified id.- Specified by:
- getRichResourceByIdin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- id-
- Returns:
- RichResource with specified id
- Throws:
- ResourceNotExistsException
 
- 
getRichResourcesDescription copied from interface:ResourcesManagerImplApiGet all VO rich resources.- Specified by:
- getRichResourcesin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- vo-
- Returns:
- list of rich resources
 
- 
getRichResourcesByIdsDescription copied from interface:ResourcesManagerImplApiGets rich resources by their ids. Silently skips non-existing rich resources.- Specified by:
- getRichResourcesByIdsin interface- ResourcesManagerImplApi
- Parameters:
- perunSession-
- ids-
- Returns:
- List of rich resources with specified ids
 
- 
getRichResourcesWithMemberAndAttributepublic 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 interface- ResourcesManagerImplApi
- Parameters:
- perunSession- session
- member- member
- ad- attribute definition
- Returns:
- list of corresponding rich resources
 
- 
groupResourceAssignmentExistsDescription copied from interface:ResourcesManagerImplApiReturns true if the group is assigned to the current resource with any status, false otherwise.- Specified by:
- groupResourceAssignmentExistsin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- group-
- Returns:
- true if the group is assigned to the current resource.
 
- 
initializeprotected void initialize()
- 
isGroupAssignedDescription copied from interface:ResourcesManagerImplApiReturns true if the group is assigned to the current resource with ACTIVE status, false otherwise.- Specified by:
- isGroupAssignedin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- group-
- Returns:
- true if the group is assigned to the current resource with active status.
 
- 
isGroupManuallyAssignedDescription copied from interface:ResourcesManagerImplApiReturns true if the group is assigned to the given resource manually, false otherwise.- Specified by:
- isGroupManuallyAssignedin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- group-
- resource-
- Returns:
- true if the group is assigned to the given resource manually.
 
- 
isUserAllowedDescription copied from interface:ResourcesManagerImplApiCheck if the user is allowed as a member on the selected resource.- Specified by:
- isUserAllowedin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- user-
- resource-
- Returns:
- true if the user is allowed as a member on the selected resource.
 
- 
isUserAssignedDescription copied from interface:ResourcesManagerImplApiCheck if the user is assigned as a member on the selected resource.- Specified by:
- isUserAssignedin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- user-
- resource-
- Returns:
- true if the user is assigned as a member on the selected resource.
 
- 
removeAllResourcesTagFromResourceDescription copied from interface:ResourcesManagerImplApiRemove all existing Resource tags for specific resource.- Specified by:
- removeAllResourcesTagFromResourcein interface- ResourcesManagerImplApi
- Parameters:
- perunSession-
- resource-
 
- 
removeAutomaticGroupFromResourcepublic 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 interface- ResourcesManagerImplApi
- 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
 
- 
removeBanDescription copied from interface:ResourcesManagerImplApiRemove ban by id from resources bans.- Specified by:
- removeBanin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- banId- id of specific ban
- Throws:
- BanNotExistsException
 
- 
removeBanDescription copied from interface:ResourcesManagerImplApiRemove ban by member_id and facility_id- Specified by:
- removeBanin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- memberId- the id of member
- resourceId- the id of resource
- Throws:
- BanNotExistsException
 
- 
removeGroupFromResourcepublic void removeGroupFromResource(PerunSession sess, Group group, Resource resource) throws GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerImplApiRemove group from a resource.- Specified by:
- removeGroupFromResourcein interface- ResourcesManagerImplApi
- Parameters:
- sess-
- group-
- resource-
- Throws:
- GroupAlreadyRemovedFromResourceException- if there are 0 rows affected by removing group from resource
 
- 
removeResourceTagFromResourcepublic void removeResourceTagFromResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Description copied from interface:ResourcesManagerImplApiRemove specific ResourceTag from existing Resource.- Specified by:
- removeResourceTagFromResourcein interface- ResourcesManagerImplApi
- Parameters:
- perunSession-
- resourceTag-
- resource-
 
- 
removeServicepublic void removeService(PerunSession sess, Resource resource, Service service) throws ServiceNotAssignedException Description copied from interface:ResourcesManagerImplApiRemove service from resource.- Specified by:
- removeServicein interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- service-
- Throws:
- ServiceNotAssignedException
 
- 
resourceExistsDescription copied from interface:ResourcesManagerImplApiCheck if resource exists in underlaying data source.- Specified by:
- resourceExistsin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- Returns:
- true if resource exists in underlaying data source, false otherwise
 
- 
resourceTagExists
- 
setBanDescription copied from interface:ResourcesManagerImplApiSet ban for member on resource- Specified by:
- setBanin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- banOnResource- the ban
- Returns:
- ban on resource
 
- 
setFailedGroupResourceAssignmentCausepublic 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 interface- ResourcesManagerImplApi
- Parameters:
- sess- session
- group- group
- resource- resource
- cause- the cause of assignment failure
- Throws:
- GroupNotDefinedOnResourceException- if there is no such group-resource assignment
 
- 
setGroupResourceStatuspublic 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 interface- ResourcesManagerImplApi
- Parameters:
- sess- session
- group- group
- resource- resource
- status- new status of the group-resource assignment
- Throws:
- GroupNotDefinedOnResourceException- if there is no such group-resource assignment
 
- 
updateBanDescription copied from interface:ResourcesManagerImplApiUpdate description and validity timestamp of specific ban.- Specified by:
- updateBanin interface- ResourcesManagerImplApi
- Parameters:
- sess-
- banOnResource- ban to be updated
- Returns:
- updated ban
 
- 
updateResourceDescription copied from interface:ResourcesManagerImplApiUpdates Resource.- Specified by:
- updateResourcein interface- ResourcesManagerImplApi
- Parameters:
- sess-
- resource-
- Returns:
- returns updated Resource
 
- 
updateResourceTagDescription copied from interface:ResourcesManagerImplApiUpdate existing Resource tag.- Specified by:
- updateResourceTagin interface- ResourcesManagerImplApi
- Parameters:
- perunSession-
- resourceTag-
- Returns:
- updated ResourceTag
 
 
-