Class ResourcesManagerBlImpl
- All Implemented Interfaces:
- ResourcesManagerBl
- Author:
- Slavek Licehammer glory@ics.muni.cz
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidactivateGroupResourceAssignment(PerunSession sess, Group group, Resource resource, boolean async) Try to activate the group-resource status.voidaddResourceSelfServiceGroup(PerunSession sess, Resource resource, Group group) Sets ResourceSelfService role to given group for given resource.voidaddResourceSelfServiceUser(PerunSession sess, Resource resource, User user) Sets ResourceSelfService role to given user for given resource.voidassignAutomaticGroupToResource(PerunSession perunSession, Group sourceGroup, Group groupToAssign, Resource resource) Asynchronously assigns single subgroup to resource as automatically assigned source group's subgroup.voidassignGroupsToResource(PerunSession perunSession, Iterable<Group> groups, Resource resource, boolean async, boolean assignInactive, boolean autoAssignSubgroups) Assign groups to a resource.voidassignGroupToResource(PerunSession sess, Group group, Resource resource, boolean async, boolean assignInactive, boolean autoAssignSubgroups) Assign group to a resource.voidassignGroupToResources(PerunSession perunSession, Group group, List<Resource> resources, boolean async, boolean assignInactive, boolean autoAssignSubgroups) Assign group to the resources.voidassignResourceTagsToResource(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) Assign existing ResourceTags on existing Resource.voidassignResourceTagToResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Assign existing ResourceTag on existing Resource.voidassignService(PerunSession sess, Resource resource, Service service) Assign service to resource.voidassignServices(PerunSession sess, Resource resource, List<Service> services) Assign services to resource.booleanbanExists(PerunSession sess, int banId) Get true if any band defined by id exists for any user and facility.booleanbanExists(PerunSession sess, int memberId, int resourceId) Get true if any ban for member and resource exists.voidcheckBanExists(PerunSession sess, int banId) Check if ban already exists.voidcheckBanExists(PerunSession sess, int memberId, int resourceId) Check if ban already exists.voidcheckResourceExists(PerunSession sess, Resource resource) voidcheckResourceTagExists(PerunSession sess, ResourceTag resourceTag) voidChecks semantics of all required attributes of given resource and its facility.convertToEnrichedResource(PerunSession sess, Resource resource, List<String> attrNames) Creates enrichedResource from given resource and load attributes with given names.voidcopyAttributes(PerunSession sess, Resource sourceResource, Resource destinationResource) Copy all attributes of the source resource to the destination resource.voidcopyGroups(PerunSession sess, Resource sourceResource, Resource destinationResource) Copy all groups of the source resource to the destination resource.copyResource(PerunSession sess, Resource templateResource, Resource destinationResource, boolean withGroups) Copy "template" settings from user's another existing resource and create new resource with this template.voidcopyServices(PerunSession sess, Resource sourceResource, Resource destinationResource) Copy all services of the source resource to the destination resource.createResource(PerunSession sess, Resource resource, Vo vo, Facility facility) Inserts resource into DB.createResourceTag(PerunSession perunSession, ResourceTag resourceTag, Vo vo) Create new Resource tag.voiddeactivateGroupResourceAssignment(PerunSession sess, Group group, Resource resource) Deactivates the group-resource assignment.voiddeleteAllResources(PerunSession sess, Vo vo) Deletes all resources for the VO.voiddeleteAllResourcesTagsForVo(PerunSession perunSession, Vo vo) Delete all ResourcesTags for specific VO.voiddeleteResource(PerunSession sess, Resource resource) Deletes resource by id.voiddeleteResourceTag(PerunSession perunSession, ResourceTag resourceTag) Delete existing Resource tag.voidfillAndSetRequiredAttributesForGroups(PerunSession sess, List<Service> services, Resource resource) Fill and set group and group-resource attributes required by given services for all groups which are assigned to the given resource.filterOnlyAllowedAttributes(PerunSession sess, EnrichedResource enrichedResource) Filter attributes in given enrichedResources, which are allowed for current principal.getAdminGroups(PerunSession sess, Resource resource) Gets list of all group administrators of the Resource.getAdmins(PerunSession perunSession, Resource resource, boolean onlyDirectAdmins) 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 can access the resource.getAllowedMembersNotExpiredInGroups(PerunSession sess, Resource resource) Returns all members who can access the resource and who are also valid in at least one group associated to the resource.getAllowedResources(PerunSession sess, Facility facility, User user) Return all resources which are under the facility and has member of the user with status other than INVALID.getAllowedResources(PerunSession sess, Member member) Get all resources which have the member access on.getAllowedUsers(PerunSession sess, Resource resource) Get all users, who can assess the resource.getAllowedUsersNotExpiredInGroups(PerunSession sess, Resource resource) Get all users, who can assess the resource and who are not expired in at least one group associated to the resource.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.getAssignedGroups(PerunSession sess, Resource resource) List all groups associated with the resource.getAssignedGroups(PerunSession sess, Resource resource, Member member) List all groups associated with the resource where Member is a member.getAssignedMembers(PerunSession sess, Resource resource) Returns all members assigned to the 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) Get all resources where the member is assigned.getAssignedResources(PerunSession sess, Member member, Service service) Get all resources where the member and the service are assigned.getAssignedResources(PerunSession sess, User user, Vo vo) Return List of assigned resources to user on the vo.getAssignedResourcesWithStatus(PerunSession sess, Member member) Returns all assigned resources where member is assigned through the groups.getAssignedRichMembers(PerunSession sess, Resource resource) Returns all members assigned to the resource as RichMembers.getAssignedRichResources(PerunSession sess, Group group) List all rich resources associated with the group with facility property filled.getAssignedRichResources(PerunSession sess, Member member) Get all rich resources where the member is assigned with facility property filled.getAssignedRichResources(PerunSession sess, Member member, Service service) Get all rich resources where the service and the member are assigned with facility property filled.getAssignedServices(PerunSession sess, Resource resource) List all services associated with the resource.getAssignedUsers(PerunSession sess, Resource resource) Returns all users assigned to the resource.getAssociatedGroups(PerunSession sess, Resource resource, Member member) Return list of groups associated with the resource with specified member.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 resourcegetEnrichedBansForResource(PerunSession sess, Resource resource, List<String> attrNames) Get all enriched bans for members on the resource with user and member attributesgetEnrichedBansForUser(PerunSession sess, User user, List<String> attrNames) Get enriched bans for user on all resources where user is assigned with user and member attributesgetEnrichedResourceById(PerunSession sess, int id, List<String> attrNames) Find resource for given id and returns it with given attributes.getEnrichedRichResourcesForFacility(PerunSession sess, Facility facility, List<String> attrNames) Find resources for given facility and attributes for given names.getEnrichedRichResourcesForVo(PerunSession sess, Vo vo, List<String> attrNames) Find resources for given vo and attributes for given names.getFacility(PerunSession sess, Resource resource) Get facility which belongs to the concrete resource.getGroupAssignments(PerunSession sess, Resource resource, List<String> attrNames) Lists all of the assigned groups for the given resource.getGroupResourceAssignments(PerunSession sess, List<GroupResourceStatus> statuses) Lists all group-resource assignments with given statuses.getMailingServiceRichResourcesWithMember(PerunSession sess, Member member) Return all rich resources with mailing service(s) where given member is assigned.Gets the perunBl.getResourceAssignments(PerunSession sess, Group group, List<String> attrNames) Lists all of the resource assignments for the given group.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) Finds 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 resource which have set the attribute with the value.getResourcesByIds(PerunSession sess, List<Integer> ids) Searches for the Resources with specified ids.intGet count of all resources.intgetResourcesCount(PerunSession sess, Vo vo) Get all VO resources count.Gets the resourcesManagerImpl.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.getRichAdmins(PerunSession perunSession, Resource resource, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) Gets list of all richUser administrators of the Resource.getRichResourceById(PerunSession sess, int id) Searches for the RichResource with specified id.getRichResources(PerunSession sess, Vo vo) Get all VO rich resources with facility property filled.getRichResourcesByIds(PerunSession sess, List<Integer> ids) Searches for the RichResources with specified ids.getVo(PerunSession sess, Resource resource) Get Vo which is tied to specified resource.booleangroupResourceAssignmentExists(PerunSession sess, Resource resource, Group group) Returns true if the group is assigned to the current resource with any status, false otherwise.booleanisGroupAssigned(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.isResourceLastAssignedServices(PerunSession sess, Resource resource, List<Service> services) Checks whether the resource is the last one on the facility to have the provided services assigned.booleanisUserAllowed(PerunSession sess, User user, Resource resource) Returns true if the user is allowed to the current resource, false otherwise.booleanisUserAssigned(PerunSession sess, User user, Resource resource) Returns true if the user is assigned to the current resource, false otherwise.voidprocessGroupResourceActivationAsync(PerunSession sess, Group group, Resource resource) Asynchronously processes group-resource activation.voidRemove all expired bans on resources to now date.voidremoveAllResourcesTagFromResource(PerunSession perunSession, Resource resource) Remove all existing Resource tags for specific resource.voidremoveAutomaticGroupFromResource(PerunSession sess, 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.voidremoveGroupFromResources(PerunSession perunSession, Group group, List<Resource> resources) Remove group from resources.voidremoveGroupsFromResource(PerunSession perunSession, List<Group> groups, Resource resource) Remove groups from a resource.voidremoveResourceSelfServiceGroup(PerunSession sess, Resource resource, Group group) Unset ResourceSelfService role to given group for given resource.voidremoveResourceSelfServiceUser(PerunSession sess, Resource resource, User user) Unset ResourceSelfService role to given user for given resource.voidremoveResourceTagFromResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Remove specific ResourceTag from existing Resource.voidremoveResourceTagsFromResource(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) Remove specific ResourceTags from existing Resource.voidremoveService(PerunSession sess, Resource resource, Service service) Remove service from resource.voidremoveServices(PerunSession sess, Resource resource, List<Service> services, boolean removeTasks, boolean removeTaskResults, boolean removeDestinations) Remove services from resource.setBan(PerunSession sess, BanOnResource banOnResource) Set ban for member on resourcevoidsetPerunBl(PerunBl perunBl) voidupdateAllRequiredAttributesForAllowedMembers(PerunSession sess, Resource resource, List<Service> services) For given resource, finds all allowed members and sets them attributes, (member-resource, member, user-facility and user) that are required by given services.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.
- 
Constructor Details- 
ResourcesManagerBlImpl
 
- 
- 
Method Details- 
activateGroupResourceAssignmentpublic void activateGroupResourceAssignment(PerunSession sess, Group group, Resource resource, boolean async) throws WrongReferenceAttributeValueException, GroupResourceMismatchException, WrongAttributeValueException, GroupNotDefinedOnResourceException Description copied from interface:ResourcesManagerBlTry to activate the group-resource status. If the async is set to false, the validation is performed synchronously. The assignment will be either ACTIVE, in case of a successful synchronous call, or it will be PROCESSING in case of an asynchronous call. After the async validation, the state can be either ACTIVE or FAILED.- Specified by:
- activateGroupResourceAssignmentin interface- ResourcesManagerBl
- Parameters:
- sess- session
- group- group
- resource- resource
- async- if true the validation is performed asynchronously
- Throws:
- WrongReferenceAttributeValueException- when an attribute value has wrong/illegal semantics
- GroupResourceMismatchException- when the given group and resource are not from the same VO
- WrongAttributeValueException- when an attribute value has wrong/illegal syntax
- GroupNotDefinedOnResourceException- when the group-resource assignment doesn't exist
 
- 
addResourceSelfServiceGrouppublic void addResourceSelfServiceGroup(PerunSession sess, Resource resource, Group group) throws AlreadyAdminException Description copied from interface:ResourcesManagerBlSets ResourceSelfService role to given group for given resource.- Specified by:
- addResourceSelfServiceGroupin interface- ResourcesManagerBl
- Parameters:
- sess- session
- resource- resource
- group- group
- Throws:
- AlreadyAdminException- already has role
 
- 
addResourceSelfServiceUserpublic void addResourceSelfServiceUser(PerunSession sess, Resource resource, User user) throws AlreadyAdminException Description copied from interface:ResourcesManagerBlSets ResourceSelfService role to given user for given resource.- Specified by:
- addResourceSelfServiceUserin interface- ResourcesManagerBl
- Parameters:
- sess- session
- resource- resource
- user- user
- Throws:
- AlreadyAdminException- already has role
 
- 
assignAutomaticGroupToResourcepublic void assignAutomaticGroupToResource(PerunSession perunSession, Group sourceGroup, Group groupToAssign, Resource resource) throws GroupResourceMismatchException, GroupAlreadyAssignedException, WrongReferenceAttributeValueException, WrongAttributeValueException Description copied from interface:ResourcesManagerBlAsynchronously assigns single subgroup to resource as automatically assigned source group's subgroup. Source group must have existing assignment on resource with autoAssignSubgroups set to true.- Specified by:
- assignAutomaticGroupToResourcein interface- ResourcesManagerBl
- Parameters:
- perunSession- sess
- sourceGroup- source group (containing groupToAssign in hierarchy as a subgroup)
- groupToAssign- source group's subgroup to be assigned on resource as by automatic assignment
- resource- resource
- Throws:
- GroupResourceMismatchException
- GroupAlreadyAssignedException
- WrongReferenceAttributeValueException
- WrongAttributeValueException
 
- 
assignGroupToResourcepublic void assignGroupToResource(PerunSession sess, Group group, Resource resource, boolean async, boolean assignInactive, boolean autoAssignSubgroups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, GroupResourceMismatchException Description copied from interface:ResourcesManagerBlAssign group to a resource. Check if attributes for each member form group are valid. Fill members' attributes with missing value. Provide options for creating inactive or automatic subgroups group-resource assignments.- Specified by:
- assignGroupToResourcein interface- ResourcesManagerBl
- Parameters:
- sess-
- group-
- resource-
- async-
- assignInactive-
- autoAssignSubgroups-
- Throws:
- WrongAttributeValueException
- WrongReferenceAttributeValueException
- GroupResourceMismatchException
 
- 
assignGroupToResourcespublic void assignGroupToResources(PerunSession perunSession, Group group, List<Resource> resources, boolean async, boolean assignInactive, boolean autoAssignSubgroups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, GroupResourceMismatchException Description copied from interface:ResourcesManagerBlAssign group to the resources. Check if attributes for each member from group are valid. Fill members' attributes with missing values. Provide options for creating inactive or automatic subgroups group-resource assignments.If the group is already assigned to some of the resources, the assignment is silently skipped. - Specified by:
- assignGroupToResourcesin interface- ResourcesManagerBl
- Parameters:
- perunSession-
- group- the group
- resources- list of resources
- async-
- assignInactive-
- autoAssignSubgroups-
- Throws:
- WrongAttributeValueException
- WrongReferenceAttributeValueException
- GroupResourceMismatchException
 
- 
assignGroupsToResourcepublic void assignGroupsToResource(PerunSession perunSession, Iterable<Group> groups, Resource resource, boolean async, boolean assignInactive, boolean autoAssignSubgroups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, GroupResourceMismatchException Description copied from interface:ResourcesManagerBlAssign groups to a resource. Check if attributes for each member from all groups are valid. Fill members' attributes with missing values. Provide options for creating inactive or automatic subgroups group-resource assignments.Already assigned groups are silently skipped. - Specified by:
- assignGroupsToResourcein interface- ResourcesManagerBl
- Parameters:
- perunSession-
- groups- groups to assign
- resource-
- async-
- assignInactive-
- autoAssignSubgroups-
- Throws:
- WrongAttributeValueException
- WrongReferenceAttributeValueException
- GroupResourceMismatchException
 
- 
assignResourceTagToResourcepublic void assignResourceTagToResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) throws ResourceTagAlreadyAssignedException Description copied from interface:ResourcesManagerBlAssign existing ResourceTag on existing Resource.- Specified by:
- assignResourceTagToResourcein interface- ResourcesManagerBl
- Parameters:
- perunSession-
- resourceTag-
- resource-
- Throws:
- ResourceTagAlreadyAssignedException
 
- 
assignResourceTagsToResourcepublic void assignResourceTagsToResource(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) throws ResourceTagAlreadyAssignedException Description copied from interface:ResourcesManagerBlAssign existing ResourceTags on existing Resource.- Specified by:
- assignResourceTagsToResourcein interface- ResourcesManagerBl
- Parameters:
- perunSession-
- resourceTags-
- resource-
- Throws:
- ResourceTagAlreadyAssignedException
 
- 
assignServicepublic void assignService(PerunSession sess, Resource resource, Service service) throws ServiceAlreadyAssignedException, WrongAttributeValueException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManagerBlAssign service to resource.- Specified by:
- assignServicein interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- service-
- Throws:
- ServiceAlreadyAssignedException
- WrongAttributeValueException
- WrongReferenceAttributeValueException
 
- 
assignServicespublic void assignServices(PerunSession sess, Resource resource, List<Service> services) throws ServiceAlreadyAssignedException, WrongAttributeValueException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManagerBlAssign services to resource.- Specified by:
- assignServicesin interface- ResourcesManagerBl
- Parameters:
- sess- session
- resource- resource
- services- services to be assigned
- Throws:
- ServiceAlreadyAssignedException
- WrongAttributeValueException
- WrongReferenceAttributeValueException
 
- 
banExistsDescription copied from interface:ResourcesManagerBlGet true if any ban for member and resource exists.- Specified by:
- banExistsin interface- ResourcesManagerBl
- Parameters:
- sess-
- memberId- id of member
- resourceId- id of resource
- Returns:
- true if ban exists
 
- 
banExistsDescription copied from interface:ResourcesManagerBlGet true if any band defined by id exists for any user and facility.- Specified by:
- banExistsin interface- ResourcesManagerBl
- Parameters:
- sess-
- banId- id of ban
- Returns:
- true if ban exists
 
- 
checkBanExistspublic void checkBanExists(PerunSession sess, int memberId, int resourceId) throws BanNotExistsException Description copied from interface:ResourcesManagerBlCheck if ban already exists.Throw exception if no. - Specified by:
- checkBanExistsin interface- ResourcesManagerBl
- Parameters:
- sess-
- memberId- user id
- resourceId- facility id
- Throws:
- BanNotExistsException
 
- 
checkBanExistsDescription copied from interface:ResourcesManagerBlCheck if ban already exists.Throw exception if no. - Specified by:
- checkBanExistsin interface- ResourcesManagerBl
- Parameters:
- sess-
- banId- ban id
- Throws:
- BanNotExistsException
 
- 
checkResourceExistspublic void checkResourceExists(PerunSession sess, Resource resource) throws ResourceNotExistsException - Specified by:
- checkResourceExistsin interface- ResourcesManagerBl
- Throws:
- ResourceNotExistsException
 
- 
checkResourceTagExistspublic void checkResourceTagExists(PerunSession sess, ResourceTag resourceTag) throws ResourceTagNotExistsException - Specified by:
- checkResourceTagExistsin interface- ResourcesManagerBl
- Throws:
- ResourceTagNotExistsException
 
- 
checkSemanticsOfFacilityAndResourceRequiredAttributespublic void checkSemanticsOfFacilityAndResourceRequiredAttributes(PerunSession sess, Resource resource) throws WrongReferenceAttributeValueException, WrongAttributeAssignmentException Checks semantics of all required attributes of given resource and its facility.- Parameters:
- sess- session
- resource- resource used to get facility and attributes
- Throws:
- WrongReferenceAttributeValueException- WrongReferenceAttributeValueException
- WrongAttributeAssignmentException- WrongAttributeAssignmentException
 
- 
convertToEnrichedResourcepublic EnrichedResource convertToEnrichedResource(PerunSession sess, Resource resource, List<String> attrNames) Description copied from interface:ResourcesManagerBlCreates enrichedResource from given resource and load attributes with given names. If the attrNames are null or emtpy, all resource attributes are added.- Specified by:
- convertToEnrichedResourcein interface- ResourcesManagerBl
- Parameters:
- sess- session
- resource- resource
- attrNames- names of attributes to return
- Returns:
- EnrichedResource for given resource with desired attributes
 
- 
copyAttributespublic void copyAttributes(PerunSession sess, Resource sourceResource, Resource destinationResource) throws WrongReferenceAttributeValueException Description copied from interface:ResourcesManagerBlCopy all attributes of the source resource to the destination resource. The attributes, that are in the destination resource and aren't in the source resource, are retained. The common attributes are replaced with attributes from the source resource. The virtual attributes are not copied.- Specified by:
- copyAttributesin interface- ResourcesManagerBl
- Parameters:
- sess-
- sourceResource-
- destinationResource-
- Throws:
- WrongReferenceAttributeValueException
 
- 
copyGroupsDescription copied from interface:ResourcesManagerBlCopy all groups of the source resource to the destination resource. The groups, that are in the destination resource and aren't in the source resource, are retained. The common groups are replaced with the groups from source resource.- Specified by:
- copyGroupsin interface- ResourcesManagerBl
- Parameters:
- sourceResource-
- destinationResource-
 
- 
copyResourcepublic Resource copyResource(PerunSession sess, Resource templateResource, Resource destinationResource, boolean withGroups) throws ResourceExistsException Description copied from interface:ResourcesManagerBlCopy "template" settings from user's another existing resource and create new resource with this template. The settings are attributes, services, tags (if the resources are from the same VO), groups and their members (if the resources are from the same VO and withGroups is true) Template Resource can be from any of user's facilities.- Specified by:
- copyResourcein interface- ResourcesManagerBl
- Parameters:
- sess-
- templateResource- template resource to copy
- destinationResource- destination resource containing IDs of destination facility, VO and resource name.
- withGroups- if set to true and resources ARE from the same VO we also copy all group-resource and member-resource attributes and assign all groups same as on templateResource, if set to true and resources ARE NOT from the same VO InternalErrorException is thrown, if set to false we will NOT copy groups and group related attributes.
- Throws:
- ResourceExistsException
 
- 
copyServicespublic void copyServices(PerunSession sess, Resource sourceResource, Resource destinationResource) throws WrongAttributeValueException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManagerBlCopy all services of the source resource to the destination resource. The services, that are in the destination resource and aren't in the source resource, are retained. The common services are replaced with services from source resource.- Specified by:
- copyServicesin interface- ResourcesManagerBl
- Parameters:
- sourceResource-
- destinationResource-
- Throws:
- WrongAttributeValueException
- WrongReferenceAttributeValueException
 
- 
createResourcepublic Resource createResource(PerunSession sess, Resource resource, Vo vo, Facility facility) throws ResourceExistsException Description copied from interface:ResourcesManagerBlInserts resource into DB.- Specified by:
- createResourcein interface- ResourcesManagerBl
- Parameters:
- resource- resource to create
- Throws:
- ResourceExistsException
 
- 
createResourceTagDescription copied from interface:ResourcesManagerBlCreate new Resource tag.- Specified by:
- createResourceTagin interface- ResourcesManagerBl
- Parameters:
- perunSession-
- resourceTag-
- vo-
- Returns:
- new created resourceTag
 
- 
deactivateGroupResourceAssignmentpublic void deactivateGroupResourceAssignment(PerunSession sess, Group group, Resource resource) throws GroupNotDefinedOnResourceException, GroupResourceStatusException Description copied from interface:ResourcesManagerBlDeactivates the group-resource assignment. The assignment will become INACTIVE and will not be used to allow users from the given group to the resource.- Specified by:
- deactivateGroupResourceAssignmentin interface- ResourcesManagerBl
- Parameters:
- group- group
- resource- resource
- Throws:
- GroupNotDefinedOnResourceException- when the group-resource assignment doesn't exist
- GroupResourceStatusException- when trying to deactivate an assignment in PROCESSING state
 
- 
deleteAllResourcespublic void deleteAllResources(PerunSession sess, Vo vo) throws ResourceAlreadyRemovedException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerBlDeletes all resources for the VO.- Specified by:
- deleteAllResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
- vo-
- Throws:
- ResourceAlreadyRemovedException- if there is at least 1 resource not affected by deleting from DB
- GroupAlreadyRemovedFromResourceException- if there is at least 1 group not affected by deleting from DB
 
- 
deleteAllResourcesTagsForVopublic void deleteAllResourcesTagsForVo(PerunSession perunSession, Vo vo) throws ResourceTagAlreadyAssignedException Description copied from interface:ResourcesManagerBlDelete all ResourcesTags for specific VO.- Specified by:
- deleteAllResourcesTagsForVoin interface- ResourcesManagerBl
- Parameters:
- perunSession-
- vo-
- Throws:
- ResourceTagAlreadyAssignedException
 
- 
deleteResourcepublic void deleteResource(PerunSession sess, Resource resource) throws ResourceAlreadyRemovedException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerBlDeletes resource by id.- Specified by:
- deleteResourcein interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Throws:
- ResourceAlreadyRemovedException- if there are 0 rows affected by deleting from DB
- GroupAlreadyRemovedFromResourceException- if there is at least 1 group not affected by deleting from DB
 
- 
deleteResourceTagpublic void deleteResourceTag(PerunSession perunSession, ResourceTag resourceTag) throws ResourceTagAlreadyAssignedException Description copied from interface:ResourcesManagerBlDelete existing Resource tag.- Specified by:
- deleteResourceTagin interface- ResourcesManagerBl
- Parameters:
- perunSession-
- resourceTag-
- Throws:
- ResourceTagAlreadyAssignedException
 
- 
fillAndSetRequiredAttributesForGroupspublic void fillAndSetRequiredAttributesForGroups(PerunSession sess, List<Service> services, Resource resource) throws GroupResourceMismatchException, WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException Fill and set group and group-resource attributes required by given services for all groups which are assigned to the given resource.- Parameters:
- sess- session
- services- services of which required attributes are set
- resource- resource
- Throws:
- GroupResourceMismatchException- GroupResourceMismatchException
- WrongAttributeAssignmentException- WrongAttributeAssignmentException
- WrongAttributeValueException- WrongAttributeValueException
- WrongReferenceAttributeValueException- WrongReferenceAttributeValueException
 
- 
filterOnlyAllowedAttributespublic EnrichedResource filterOnlyAllowedAttributes(PerunSession sess, EnrichedResource enrichedResource) Description copied from interface:ResourcesManagerBlFilter attributes in given enrichedResources, which are allowed for current principal.- Specified by:
- filterOnlyAllowedAttributesin interface- ResourcesManagerBl
- Parameters:
- sess- session
- enrichedResource- resource with attributes to filter
- Returns:
- resource with attributes that are allowed for current principal
 
- 
getAdminGroupsDescription copied from interface:ResourcesManagerBlGets list of all group administrators of the Resource.- Specified by:
- getAdminGroupsin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- list of Groups that are admins in the resource
 
- 
getAdminsDescription copied from interface:ResourcesManagerBlGets 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.If onlyDirectAdmins is true, return only direct users of the group for supported role. Supported roles: ResourceAdmin, VOAdmin - Specified by:
- getAdminsin interface- ResourcesManagerBl
- Parameters:
- perunSession-
- resource-
- onlyDirectAdmins- if true, get only direct user administrators (if false, get both direct and indirect)
- Returns:
- list of all user administrators of the given resource for supported role
 
- 
getAllExpiredBansOnResourcesDescription copied from interface:ResourcesManagerBlGet all expired bans on any resource to now date- Specified by:
- getAllExpiredBansOnResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
- Returns:
- list of expired bans for any resource
 
- 
getAllResourcesDescription copied from interface:ResourcesManagerBlGet all resources from database.- Specified by:
- getAllResourcesin interface- ResourcesManagerBl
- Parameters:
- sess- Perun session
- Returns:
- list of all resources
 
- 
getAllResourcesByResourceTagpublic List<Resource> getAllResourcesByResourceTag(PerunSession perunSession, ResourceTag resourceTag) Description copied from interface:ResourcesManagerBlGet all resources in specific Vo (specific by resourceTag.getVoId) for existing resourceTag- Specified by:
- getAllResourcesByResourceTagin interface- ResourcesManagerBl
- Parameters:
- perunSession-
- resourceTag-
- Returns:
- list of Resources
 
- 
getAllResourcesTagsForResourcepublic List<ResourceTag> getAllResourcesTagsForResource(PerunSession perunSession, Resource resource) Description copied from interface:ResourcesManagerBlGet all resourcesTags for existing Resource- Specified by:
- getAllResourcesTagsForResourcein interface- ResourcesManagerBl
- Parameters:
- perunSession-
- resource-
- Returns:
- list of ResourcesTags
 
- 
getAllResourcesTagsForVoDescription copied from interface:ResourcesManagerBlGet all resourcesTags for existing Vo.- Specified by:
- getAllResourcesTagsForVoin interface- ResourcesManagerBl
- Parameters:
- perunSession-
- vo-
- Returns:
- list of all resourcesTags for existing Vo
 
- 
getAllowedMembersDescription copied from interface:ResourcesManagerBlReturns all members who can access the resource.- Specified by:
- getAllowedMembersin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- list of members assigned to the resource
 
- 
getAllowedMembersNotExpiredInGroupsDescription copied from interface:ResourcesManagerBlReturns all members who can access the resource and who are also valid in at least one group associated to the resource.- Specified by:
- getAllowedMembersNotExpiredInGroupsin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- list of members assigned to the resource
 
- 
getAllowedResourcesDescription copied from interface:ResourcesManagerBlGet all resources which have the member access on.- Specified by:
- getAllowedResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
- member-
- Returns:
- list of resources which have the member access on
 
- 
getAllowedResourcesDescription copied from interface:ResourcesManagerBlReturn all resources which are under the facility and has member of the user with status other than INVALID.- Specified by:
- getAllowedResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
- facility-
- user-
- Returns:
- list of resources allowed for user (user has there member with status other than INVALID)
 
- 
getAllowedUsersDescription copied from interface:ResourcesManagerBlGet all users, who can assess the resource.- Specified by:
- getAllowedUsersin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- list of users
 
- 
getAllowedUsersNotExpiredInGroupsDescription copied from interface:ResourcesManagerBlGet all users, who can assess the resource and who are not expired in at least one group associated to the resource.- Specified by:
- getAllowedUsersNotExpiredInGroupsin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- list of users
 
- 
getAssignedGroupsDescription copied from interface:ResourcesManagerBlList all groups associated with the resource.- Specified by:
- getAssignedGroupsin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- list of assigned group
 
- 
getAssignedGroupsDescription copied from interface:ResourcesManagerBlList all groups associated with the resource where Member is a member.- Specified by:
- getAssignedGroupsin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- member-
- Returns:
- list of assigned groups
 
- 
getAssignedMembersDescription copied from interface:ResourcesManagerBlReturns all members assigned to the resource.- Specified by:
- getAssignedMembersin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- list of members assigned to the resource
 
- 
getAssignedMembersWithStatusDescription copied from interface:ResourcesManagerBlReturns members of groups assigned to resource with status of group-resource assignment.- Specified by:
- getAssignedMembersWithStatusin interface- ResourcesManagerBl
- Parameters:
- sess- perunSession
- resource- resource
- Returns:
- list of members of groups assigned to given resource
 
- 
getAssignedResourcesDescription copied from interface:ResourcesManagerBlList all resources to which the group is assigned.- Specified by:
- getAssignedResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
- group-
- Returns:
- list of assigned resources
 
- 
getAssignedResourcesDescription copied from interface:ResourcesManagerBlGet all resources where the member is assigned.- Specified by:
- getAssignedResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
- member-
- Returns:
 
- 
getAssignedResourcesDescription copied from interface:ResourcesManagerBlGet all resources where the member and the service are assigned.- Specified by:
- getAssignedResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
- member-
- service-
- Returns:
- list of resources
 
- 
getAssignedResourcesDescription copied from interface:ResourcesManagerBlReturn List of assigned resources to user on the vo. If user is not member of Vo, return empty List;- Specified by:
- getAssignedResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
- user-
- vo-
- Returns:
- return list of assigned resources or empty list if user is not member of Vo
 
- 
getAssignedResourcesWithStatusDescription copied from interface:ResourcesManagerBlReturns all assigned resources where member is assigned through the groups.- Specified by:
- getAssignedResourcesWithStatusin interface- ResourcesManagerBl
- Parameters:
- sess- perun session
- member- member
- Returns:
- list of assigned resources
 
- 
getAssignedRichMembersDescription copied from interface:ResourcesManagerBlReturns all members assigned to the resource as RichMembers.- Specified by:
- getAssignedRichMembersin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- list of rich members assigned to the resource
 
- 
getAssignedRichResourcesDescription copied from interface:ResourcesManagerBlList all rich resources associated with the group with facility property filled.- Specified by:
- getAssignedRichResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
- group-
- Returns:
- list of assigned rich resources
 
- 
getAssignedRichResourcesDescription copied from interface:ResourcesManagerBlGet all rich resources where the member is assigned with facility property filled.- Specified by:
- getAssignedRichResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
- member-
- Returns:
- list of resources
 
- 
getAssignedRichResourcespublic List<RichResource> getAssignedRichResources(PerunSession sess, Member member, Service service) Description copied from interface:ResourcesManagerBlGet all rich resources where the service and the member are assigned with facility property filled.- Specified by:
- getAssignedRichResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
- member-
- service-
- Returns:
- list of resources
 
- 
getAssignedServicesDescription copied from interface:ResourcesManagerBlList all services associated with the resource.- Specified by:
- getAssignedServicesin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- list of assigned resources
 
- 
getAssignedUsersDescription copied from interface:ResourcesManagerBlReturns all users assigned to the resource.- Specified by:
- getAssignedUsersin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- list of users assigned to the resource
 
- 
getAssociatedGroupsDescription copied from interface:ResourcesManagerBlReturn list of groups associated with the resource with specified member. Does not require ACTIVE group-resource status.- Specified by:
- getAssociatedGroupsin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- member-
- Returns:
- list of groups, which are associated with the resource with specified member
 
- 
getAssociatedMembersDescription copied from interface:ResourcesManagerBlReturns all members who are associated with the resource. Does not require ACTIVE group-resource status or any specific member status.- Specified by:
- getAssociatedMembersin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- list of members
 
- 
getAssociatedResourcesDescription copied from interface:ResourcesManagerBlList all resources associated with the group. Does not require ACTIVE group-resource status.- Specified by:
- getAssociatedResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
- group-
- Returns:
- list of associated resources
 
- 
getAssociatedResourcesDescription copied from interface:ResourcesManagerBlReturns all resources with which the member is associated through the groups. Does not require ACTIVE group-resource status.- Specified by:
- getAssociatedResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
- member-
- Returns:
- list of resources
 
- 
getAssociatedUsersDescription copied from interface:ResourcesManagerBlReturns all users who are associated with the defined resource. Does not require ACTIVE group-resource status.- Specified by:
- getAssociatedUsersin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- list of users
 
- 
getBanpublic BanOnResource getBan(PerunSession sess, int memberId, int resourceId) throws BanNotExistsException Description copied from interface:ResourcesManagerBlGet specific resource ban.- Specified by:
- getBanin interface- ResourcesManagerBl
- Parameters:
- sess-
- memberId- the member id
- resourceId- the resource id
- Returns:
- specific resource ban
- Throws:
- BanNotExistsException
 
- 
getBanByIdDescription copied from interface:ResourcesManagerBlGet Ban for member on resource by it's id- Specified by:
- getBanByIdin interface- ResourcesManagerBl
- Parameters:
- sess-
- banId- the ban id
- Returns:
- resource ban by it's id
- Throws:
- BanNotExistsException
 
- 
getBansForMemberDescription copied from interface:ResourcesManagerBlGet all resources bans for member.- Specified by:
- getBansForMemberin interface- ResourcesManagerBl
- Parameters:
- sess-
- memberId- the member id
- Returns:
- list of bans for member on any resource
 
- 
getBansForResourceDescription copied from interface:ResourcesManagerBlGet all members bans for resource- Specified by:
- getBansForResourcein interface- ResourcesManagerBl
- Parameters:
- sess-
- resourceId- the resource id
- Returns:
- list of all members bans on resource
 
- 
getEnrichedBansForResourcepublic List<EnrichedBanOnResource> getEnrichedBansForResource(PerunSession sess, Resource resource, List<String> attrNames) throws AttributeNotExistsException Description copied from interface:ResourcesManagerBlGet all enriched bans for members on the resource with user and member attributes- Specified by:
- getEnrichedBansForResourcein interface- ResourcesManagerBl
- Parameters:
- sess-
- resource- resource
- attrNames- names of attributes
- Returns:
- list of all enriched bans on resource
- Throws:
- AttributeNotExistsException
 
- 
getEnrichedBansForUserpublic List<EnrichedBanOnResource> getEnrichedBansForUser(PerunSession sess, User user, List<String> attrNames) throws AttributeNotExistsException Description copied from interface:ResourcesManagerBlGet enriched bans for user on all resources where user is assigned with user and member attributes- Specified by:
- getEnrichedBansForUserin interface- ResourcesManagerBl
- Parameters:
- sess-
- user- user
- attrNames- names of attributes
- Returns:
- list of all user's bans on resources
- Throws:
- AttributeNotExistsException
 
- 
getEnrichedResourceByIdpublic EnrichedResource getEnrichedResourceById(PerunSession sess, int id, List<String> attrNames) throws ResourceNotExistsException Description copied from interface:ResourcesManagerBlFind resource for given id and returns it with given attributes. If attrNames are null or empty, all resource attributes are returned.- Specified by:
- getEnrichedResourceByIdin interface- ResourcesManagerBl
- Parameters:
- sess- session
- id- resource id
- attrNames- names of attributes to return
- Returns:
- resource for given id with desired attributes
- Throws:
- ResourceNotExistsException- if there is no resource with given id
 
- 
getEnrichedRichResourcesForFacilitypublic List<EnrichedResource> getEnrichedRichResourcesForFacility(PerunSession sess, Facility facility, List<String> attrNames) Description copied from interface:ResourcesManagerBlFind resources for given facility and attributes for given names. If the attrNames are empty or null, return all attributes.- Specified by:
- getEnrichedRichResourcesForFacilityin interface- ResourcesManagerBl
- Parameters:
- sess- session
- facility- facility
- attrNames- names of attributes to return
- Returns:
- resources with desired attributes
 
- 
getEnrichedRichResourcesForVopublic List<EnrichedResource> getEnrichedRichResourcesForVo(PerunSession sess, Vo vo, List<String> attrNames) Description copied from interface:ResourcesManagerBlFind resources for given vo and attributes for given names. If the attrNames are empty or null, return all attributes.- Specified by:
- getEnrichedRichResourcesForVoin interface- ResourcesManagerBl
- Parameters:
- sess- session
- vo- vo
- attrNames- names of attributes to return
- Returns:
- resources with desired attributes
 
- 
getFacilityDescription copied from interface:ResourcesManagerBlGet facility which belongs to the concrete resource.- Specified by:
- getFacilityin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- facility belonging to the resource
 
- 
getGroupAssignmentspublic List<AssignedGroup> getGroupAssignments(PerunSession sess, Resource resource, List<String> attrNames) Description copied from interface:ResourcesManagerBlLists all of the assigned groups for the given resource. Also, returns specified attributes for the groups. If attrNames are null, all group attributes are returned.- Specified by:
- getGroupAssignmentsin interface- ResourcesManagerBl
- Parameters:
- sess- session
- resource- resource
- attrNames- names of attributes to return
- Returns:
- list of assigned groups for given resource with specified attributes
 
- 
getGroupResourceAssignmentspublic List<GroupResourceAssignment> getGroupResourceAssignments(PerunSession sess, List<GroupResourceStatus> statuses) Description copied from interface:ResourcesManagerBlLists all group-resource assignments with given statuses. If statuses are empty or null, lists assignments with all statuses.- Specified by:
- getGroupResourceAssignmentsin interface- ResourcesManagerBl
- Parameters:
- sess- session
- statuses- list of allowed statuses
- Returns:
- list of group-resource assignments with given statuses
 
- 
getMailingServiceRichResourcesWithMemberpublic List<RichResource> getMailingServiceRichResourcesWithMember(PerunSession sess, Member member) Description copied from interface:ResourcesManagerBlReturn all rich resources with mailing service(s) where given member is assigned.- Specified by:
- getMailingServiceRichResourcesWithMemberin interface- ResourcesManagerBl
- Parameters:
- sess- session
- member- member
- Returns:
- list of corresponding rich resources
 
- 
getPerunBlGets the perunBl.- Returns:
- The perunBl.
 
- 
getResourceAssignmentspublic List<AssignedResource> getResourceAssignments(PerunSession sess, Group group, List<String> attrNames) Description copied from interface:ResourcesManagerBlLists all of the resource assignments for the given group. Also, returns specified attributes and resource tags for the resources. If attrNames are null or empty, all resource attributes are returned.- Specified by:
- getResourceAssignmentsin interface- ResourcesManagerBl
- Parameters:
- sess- session
- group- group
- attrNames- names of attributes to return
- Returns:
- list of assigned resources for given group with specified attributes and resource tags
 
- 
getResourceByIdDescription copied from interface:ResourcesManagerBlSearches for the Resource with specified id.- Specified by:
- getResourceByIdin interface- ResourcesManagerBl
- 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:ResourcesManagerBlReturn resource by its name.- Specified by:
- getResourceByNamein interface- ResourcesManagerBl
- Parameters:
- sess-
- vo-
- facility-
- name-
- Returns:
- resource
- Throws:
- ResourceNotExistsException
 
- 
getResourcesDescription copied from interface:ResourcesManagerBlGet all VO resources.- Specified by:
- getResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
- vo-
- 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:ResourcesManagerBlReturn 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- ResourcesManagerBl
- 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
 
- 
getResourcesDescription copied from interface:ResourcesManagerBlFinds all resources.- Specified by:
- getResourcesin interface- ResourcesManagerBl
- Parameters:
- sess- session
- Returns:
- list of all resources
 
- 
getResourcesByAttributepublic List<Resource> getResourcesByAttribute(PerunSession sess, Attribute attribute) throws WrongAttributeAssignmentException Description copied from interface:ResourcesManagerBlReturns all resource which have set the attribute with the value. Searching only def and opt attributes.- Specified by:
- getResourcesByAttributein interface- ResourcesManagerBl
- Parameters:
- sess-
- attribute-
- Returns:
- Throws:
- WrongAttributeAssignmentException
 
- 
getResourcesByIdsDescription copied from interface:ResourcesManagerBlSearches for the Resources with specified ids.- Specified by:
- getResourcesByIdsin interface- ResourcesManagerBl
- Parameters:
- sess-
- ids-
- Returns:
- Resources with specified ids
 
- 
getResourcesCountDescription copied from interface:ResourcesManagerBlGet all VO resources count.- Specified by:
- getResourcesCountin interface- ResourcesManagerBl
- Parameters:
- sess-
- vo-
- Returns:
- count fo vo resources
 
- 
getResourcesCountDescription copied from interface:ResourcesManagerBlGet count of all resources.- Specified by:
- getResourcesCountin interface- ResourcesManagerBl
- Parameters:
- sess-
- Returns:
- count of all resources
 
- 
getResourcesManagerImplGets the resourcesManagerImpl.- Returns:
- The resourcesManagerImpl.
 
- 
getResourcesWhereGroupIsAdminpublic List<Resource> getResourcesWhereGroupIsAdmin(PerunSession sess, Facility facility, Vo vo, Group authorizedGroup) Description copied from interface:ResourcesManagerBlReturn all resources for the facility and the vo where the group is authorized as resource manager.- Specified by:
- getResourcesWhereGroupIsAdminin interface- ResourcesManagerBl
- 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:ResourcesManagerBlReturns 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- ResourcesManagerBl
- 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:ResourcesManagerBlReturn 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- ResourcesManagerBl
- 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:ResourcesManagerBlReturn 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- ResourcesManagerBl
- 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
 
- 
getRichAdminspublic List<RichUser> getRichAdmins(PerunSession perunSession, Resource resource, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) throws UserNotExistsException Description copied from interface:ResourcesManagerBlGets list of all richUser administrators of the Resource. If some group is administrator of the given resource, all VALID members are included in the list.Supported roles: ResourceAdmin, VOAdmin If "onlyDirectAdmins" is "true", return only direct users of the group for supported role with specific attributes. If "allUserAttributes" is "true", do not specify attributes through list and return them all in objects richUser . Ignoring list of specific attributes. - Specified by:
- getRichAdminsin interface- ResourcesManagerBl
- Parameters:
- perunSession-
- resource-
- specificAttributes- list of specified attributes which are needed in object richUser
- allUserAttributes- if true, get all possible user attributes and ignore list of specificAttributes (if false, get only specific attributes)
- onlyDirectAdmins- if true, get only direct user administrators (if false, get both direct and indirect)
- Returns:
- list of RichUser administrators for the resource and supported role with attributes
- Throws:
- UserNotExistsException
 
- 
getRichResourceByIdpublic RichResource getRichResourceById(PerunSession sess, int id) throws ResourceNotExistsException Description copied from interface:ResourcesManagerBlSearches for the RichResource with specified id.- Specified by:
- getRichResourceByIdin interface- ResourcesManagerBl
- Parameters:
- sess-
- id-
- Returns:
- RichResource with specified id
- Throws:
- ResourceNotExistsException
 
- 
getRichResourcesDescription copied from interface:ResourcesManagerBlGet all VO rich resources with facility property filled.- Specified by:
- getRichResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
- vo-
- Returns:
- list of rich resources
 
- 
getRichResourcesByIdsDescription copied from interface:ResourcesManagerBlSearches for the RichResources with specified ids.- Specified by:
- getRichResourcesByIdsin interface- ResourcesManagerBl
- Parameters:
- sess-
- ids-
- Returns:
- RichResources with specified ids
 
- 
getVoDescription copied from interface:ResourcesManagerBlGet Vo which is tied to specified resource.- Specified by:
- getVoin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- vo tied to specified resource
 
- 
groupResourceAssignmentExistsDescription copied from interface:ResourcesManagerBlReturns true if the group is assigned to the current resource with any status, false otherwise.- Specified by:
- groupResourceAssignmentExistsin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- group-
- Returns:
- true if the group is assigned to the current resource.
 
- 
isGroupAssignedDescription copied from interface:ResourcesManagerBlReturns true if the group is assigned to the current resource with ACTIVE status, false otherwise.- Specified by:
- isGroupAssignedin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- group-
- Returns:
- true if the group is assigned to the current resource with active status.
 
- 
isGroupManuallyAssignedDescription copied from interface:ResourcesManagerBlReturns true if the group is assigned to the given resource manually, false otherwise.- Specified by:
- isGroupManuallyAssignedin interface- ResourcesManagerBl
- Parameters:
- sess-
- group-
- resource-
- Returns:
- true if the group is assigned to the given resource manually.
 
- 
isResourceLastAssignedServicespublic List<Service> isResourceLastAssignedServices(PerunSession sess, Resource resource, List<Service> services) throws FacilityNotExistsException Description copied from interface:ResourcesManagerBlChecks whether the resource is the last one on the facility to have the provided services assigned. Returns the services where this is the case.- Specified by:
- isResourceLastAssignedServicesin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- services-
- Returns:
- list of services where the provided resource is last to have them assigned on its facility.
- Throws:
- FacilityNotExistsException
 
- 
isUserAllowedDescription copied from interface:ResourcesManagerBlReturns true if the user is allowed to the current resource, false otherwise.- Specified by:
- isUserAllowedin interface- ResourcesManagerBl
- Parameters:
- sess-
- user-
- resource-
- Returns:
- true if the user is allowed to the current resource.
 
- 
isUserAssignedDescription copied from interface:ResourcesManagerBlReturns true if the user is assigned to the current resource, false otherwise.- Specified by:
- isUserAssignedin interface- ResourcesManagerBl
- Parameters:
- sess-
- user-
- resource-
- Returns:
- true if the user is assigned to the current resource.
 
- 
processGroupResourceActivationAsync@Async public void processGroupResourceActivationAsync(PerunSession sess, Group group, Resource resource) Description copied from interface:ResourcesManagerBlAsynchronously processes group-resource activation. Sets assignment status of given group and resource to ACTIVE. Check if attributes for each member from group are valid. Fill members' attributes with missing values. In case of error during activation, the group-resource assignment status is set to FAILED.- Specified by:
- processGroupResourceActivationAsyncin interface- ResourcesManagerBl
- Parameters:
- sess- session
- group- group
- resource- resource
 
- 
removeAllExpiredBansOnResourcesDescription copied from interface:ResourcesManagerBlRemove all expired bans on resources to now date.Get all expired bans and remove them one by one with auditing process. This method is for purpose of removing expired bans using some cron tool. - Specified by:
- removeAllExpiredBansOnResourcesin interface- ResourcesManagerBl
- Parameters:
- sess-
 
- 
removeAllResourcesTagFromResourceDescription copied from interface:ResourcesManagerBlRemove all existing Resource tags for specific resource.- Specified by:
- removeAllResourcesTagFromResourcein interface- ResourcesManagerBl
- Parameters:
- perunSession-
- resource-
 
- 
removeAutomaticGroupFromResourcepublic void removeAutomaticGroupFromResource(PerunSession sess, Group group, Resource resource, int sourceGroupId) throws GroupNotDefinedOnResourceException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerBlRemove automatically assigned group from resource. After removing, check attributes and fix them if it is needed.- Specified by:
- removeAutomaticGroupFromResourcein interface- ResourcesManagerBl
- Parameters:
- sess-
- group- the group
- resource- the resource
- sourceGroupId- id of a source group through which was the group automatically assigned
- Throws:
- GroupNotDefinedOnResourceException- when there is no such automatic group-resource assignment
- GroupAlreadyRemovedFromResourceException- when the group was already removed
 
- 
removeBanDescription copied from interface:ResourcesManagerBlRemove ban by id from resources bans.- Specified by:
- removeBanin interface- ResourcesManagerBl
- Parameters:
- sess-
- banId- id of specific ban
- Throws:
- BanNotExistsException
 
- 
removeBanDescription copied from interface:ResourcesManagerBlRemove ban by member_id and facility_id- Specified by:
- removeBanin interface- ResourcesManagerBl
- Parameters:
- sess-
- memberId- the id of member
- resourceId- the id of resource
- Throws:
- BanNotExistsException
 
- 
removeGroupFromResourcepublic void removeGroupFromResource(PerunSession sess, Group group, Resource resource) throws GroupNotDefinedOnResourceException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerBlRemove group from a resource. After removing, check attributes and fix them if it is needed.- Specified by:
- removeGroupFromResourcein interface- ResourcesManagerBl
- Parameters:
- sess-
- group-
- resource-
- Throws:
- GroupNotDefinedOnResourceException- Group was never assigned to this resource
- GroupAlreadyRemovedFromResourceException- there are 0 rows affected by deleting from DB
 
- 
removeGroupFromResourcespublic void removeGroupFromResources(PerunSession perunSession, Group group, List<Resource> resources) throws GroupNotDefinedOnResourceException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerBlRemove group from resources. After removing, check attributes and fix them if it is needed.- Specified by:
- removeGroupFromResourcesin interface- ResourcesManagerBl
- Parameters:
- perunSession-
- group- the group
- resources- list of resources
- Throws:
- GroupNotDefinedOnResourceException
- GroupAlreadyRemovedFromResourceException
 
- 
removeGroupsFromResourcepublic void removeGroupsFromResource(PerunSession perunSession, List<Group> groups, Resource resource) throws GroupNotDefinedOnResourceException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerBlRemove groups from a resource. After removing, check attributes and fix them if it is needed.- Specified by:
- removeGroupsFromResourcein interface- ResourcesManagerBl
- Parameters:
- perunSession-
- groups- list of groups
- resource-
- Throws:
- GroupNotDefinedOnResourceException
- GroupAlreadyRemovedFromResourceException
 
- 
removeResourceSelfServiceGrouppublic void removeResourceSelfServiceGroup(PerunSession sess, Resource resource, Group group) throws GroupNotAdminException Description copied from interface:ResourcesManagerBlUnset ResourceSelfService role to given group for given resource.- Specified by:
- removeResourceSelfServiceGroupin interface- ResourcesManagerBl
- Parameters:
- sess- session
- resource- resource
- group- group
- Throws:
- GroupNotAdminException- group did not have the role
 
- 
removeResourceSelfServiceUserpublic void removeResourceSelfServiceUser(PerunSession sess, Resource resource, User user) throws UserNotAdminException Description copied from interface:ResourcesManagerBlUnset ResourceSelfService role to given user for given resource.- Specified by:
- removeResourceSelfServiceUserin interface- ResourcesManagerBl
- Parameters:
- sess- session
- resource- resource
- user- user
- Throws:
- UserNotAdminException- user did not have the role
 
- 
removeResourceTagFromResourcepublic void removeResourceTagFromResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) throws ResourceTagNotAssignedException Description copied from interface:ResourcesManagerBlRemove specific ResourceTag from existing Resource.- Specified by:
- removeResourceTagFromResourcein interface- ResourcesManagerBl
- Parameters:
- perunSession-
- resourceTag-
- resource-
- Throws:
- ResourceTagNotAssignedException
 
- 
removeResourceTagsFromResourcepublic void removeResourceTagsFromResource(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) throws ResourceTagNotAssignedException Description copied from interface:ResourcesManagerBlRemove specific ResourceTags from existing Resource.- Specified by:
- removeResourceTagsFromResourcein interface- ResourcesManagerBl
- Parameters:
- perunSession-
- resourceTags-
- resource-
- Throws:
- ResourceTagNotAssignedException
 
- 
removeServicepublic void removeService(PerunSession sess, Resource resource, Service service) throws ServiceNotAssignedException Description copied from interface:ResourcesManagerBlRemove service from resource.- Specified by:
- removeServicein interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- service-
- Throws:
- ServiceNotAssignedException
 
- 
removeServicespublic void removeServices(PerunSession sess, Resource resource, List<Service> services, boolean removeTasks, boolean removeTaskResults, boolean removeDestinations) throws ServiceNotAssignedException, FacilityNotExistsException Description copied from interface:ResourcesManagerBlRemove services from resource. Optionally also removes tasks, their results or destinations associated with the services on the resource's facility. This only happens for services which are not assigned to other resources on the facility.- Specified by:
- removeServicesin interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- services-
- removeTasks-
- removeTaskResults-
- removeDestinations-
- Throws:
- ServiceNotAssignedException
- FacilityNotExistsException
 
- 
setBanpublic BanOnResource setBan(PerunSession sess, BanOnResource banOnResource) throws BanAlreadyExistsException Description copied from interface:ResourcesManagerBlSet ban for member on resource- Specified by:
- setBanin interface- ResourcesManagerBl
- Parameters:
- sess-
- banOnResource- the ban
- Returns:
- ban on resource
- Throws:
- BanAlreadyExistsException
 
- 
setPerunBl
- 
updateAllRequiredAttributesForAllowedMemberspublic void updateAllRequiredAttributesForAllowedMembers(PerunSession sess, Resource resource, List<Service> services) throws MemberResourceMismatchException, WrongAttributeAssignmentException, AttributeNotExistsException, WrongReferenceAttributeValueException, WrongAttributeValueException For given resource, finds all allowed members and sets them attributes, (member-resource, member, user-facility and user) that are required by given services.- Parameters:
- sess- session
- resource- resource from where allowed members are taken
- services- services, for which the required attributes are set
- Throws:
- MemberResourceMismatchException- MemberResourceMismatchException
- WrongAttributeAssignmentException- WrongAttributeAssignmentException
- AttributeNotExistsException- AttributeNotExistsException
- WrongReferenceAttributeValueException- WrongReferenceAttributeValueException
- WrongAttributeValueException- WrongAttributeValueException
 
- 
updateBanDescription copied from interface:ResourcesManagerBlUpdate description and validity timestamp of specific ban.- Specified by:
- updateBanin interface- ResourcesManagerBl
- Parameters:
- sess-
- banOnResource- ban to be updated
- Returns:
- updated ban
 
- 
updateResourceDescription copied from interface:ResourcesManagerBlUpdates Resource.- Specified by:
- updateResourcein interface- ResourcesManagerBl
- Parameters:
- sess-
- resource-
- Returns:
- returns updated Resource
- Throws:
- ResourceExistsException
 
- 
updateResourceTagDescription copied from interface:ResourcesManagerBlUpdate existing Resource tag.- Specified by:
- updateResourceTagin interface- ResourcesManagerBl
- Parameters:
- perunSession-
- resourceTag-
- Returns:
- updated ResourceTag
 
 
-