Package cz.metacentrum.perun.core.entry
Class ResourcesManagerEntry
java.lang.Object
cz.metacentrum.perun.core.entry.ResourcesManagerEntry
- All Implemented Interfaces:
- ResourcesManager
- 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.voidaddAdmin(PerunSession sess, Resource resource, Group group) Add role resource admin to group for the selected resource.voidaddAdmin(PerunSession sess, Resource resource, User user) Add role resource admin to user for the selected resource.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.voidassignGroupsToResource(PerunSession perunSession, List<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.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 for the vo.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.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.getAllowedMembers(PerunSession sess, Resource resource) Returns all members assigned to the resource.getAllowedResources(PerunSession sess, Member member) Get all resources which have the member access on.getAllowedUsers(PerunSession sess, Resource resource) Returns all users who is assigned with 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 and membergetAssignedMembers(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.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.getBan(PerunSession sess, int memberId, int resourceId) Get ban by memberId and resource idgetBanById(PerunSession sess, int banId) Get Ban for member on resource by it's idgetBansForMember(PerunSession sess, int memberId) Get all bans for member on any resource.getBansForResource(PerunSession sess, int resourceId) Get all bans for members on the resource.getEnrichedBansForResource(PerunSession sess, int resourceId, List<String> attrNames) Get all enriched bans for members on the resource.getEnrichedBansForUser(PerunSession sess, int userId, List<String> attrNames) Get all enriched bans on resources for user.getEnrichedResourceById(PerunSession sess, int id, List<String> attrNames) Find resource for given id and returns it with given attributes.getEnrichedResourcesForFacility(PerunSession sess, Facility facility, List<String> attrNames) Find resources for given facility and attributes for given names.getEnrichedResourcesForVo(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.getMailingServiceRichResourcesWithMember(PerunSession sess, Member member) Return all rich resources with mailing service(s) where given member is assigned.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, Vo vo) Get all VO resources.getResourcesByIds(PerunSession sess, List<Integer> ids) Search for the Resources with specific ids.intGet count of all resources.intgetResourcesCount(PerunSession sess, Vo vo) Get all VO resources count.Gets the resourcesManagerBl for this instance.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) Search for the RichResource with specific id.getRichResources(PerunSession sess, Vo vo) Get all VO rich resources with facility property filled.getRichResourcesByIds(PerunSession sess, List<Integer> ids) Search for the RichResources with specific ids.getVo(PerunSession sess, Resource resource) Get Vo which is tied to specified resource.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.voidremoveAdmin(PerunSession sess, Resource resource, Group group) Remove role resource admin from group for the selected resource.voidremoveAdmin(PerunSession sess, Resource resource, User user) Remove role resource admin from user for the selected resource.voidremoveAllResourcesTagFromResource(PerunSession perunSession, Resource resource) Remove all Resource tags for specific resource.voidremoveBan(PerunSession sess, int banId) Remove specific ban by it's id.voidremoveBan(PerunSession sess, int memberId, int resourceId) Remove specific ban by memberId and resourceId.voidremoveGroupFromResource(PerunSession sess, Group group, Resource resource) Remove group from a resource.voidremoveGroupFromResources(PerunSession perunSession, Group group, List<Resource> resources) Remove group from the 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.voidremoveService(PerunSession perunSession, List<Resource> resources, Service service) Remove service from multiple resources in the same facilityvoidremoveServices(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 resource.voidsetPerunBl(PerunBl perunBl) Sets the perunBl for this instance.voidsetResourcesManagerBl(ResourcesManagerBl resourcesManagerBl) Sets the resourcesManagerBl for this instance.updateBan(PerunSession sess, BanOnResource banOnResource) Update existing ban (description, validation timestamp)updateResource(PerunSession sess, Resource resource) Updates Resource.updateResourceTag(PerunSession perunSession, ResourceTag resourceTag) Update existing Resource tag.
- 
Constructor Details- 
ResourcesManagerEntry
- 
ResourcesManagerEntrypublic ResourcesManagerEntry()
 
- 
- 
Method Details- 
activateGroupResourceAssignmentpublic void activateGroupResourceAssignment(PerunSession sess, Group group, Resource resource, boolean async) throws ResourceNotExistsException, GroupNotExistsException, PrivilegeException, WrongReferenceAttributeValueException, GroupNotDefinedOnResourceException, GroupResourceMismatchException, WrongAttributeValueException Description copied from interface:ResourcesManagerTry 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- ResourcesManager
- Parameters:
- sess-
- group- group
- resource- resource
- async- if true the validation is performed asynchronously
- Throws:
- ResourceNotExistsException- when the resource doesn't exist
- GroupNotExistsException- when the group doesn't exist
- PrivilegeException- insufficient permissions
- WrongReferenceAttributeValueException- when an attribute value has wrong/illegal semantics
- GroupNotDefinedOnResourceException- when the group-resource assignment doesn't exist
- GroupResourceMismatchException- when the given group and resource are not from the same VO
- WrongAttributeValueException- when an attribute value has wrong/illegal syntax
 
- 
addAdminpublic void addAdmin(PerunSession sess, Resource resource, User user) throws UserNotExistsException, PrivilegeException, AlreadyAdminException, ResourceNotExistsException, RoleCannotBeManagedException, RoleCannotBeSetException Description copied from interface:ResourcesManagerAdd role resource admin to user for the selected resource.- Specified by:
- addAdminin interface- ResourcesManager
- Parameters:
- sess-
- resource-
- user-
- Throws:
- UserNotExistsException
- PrivilegeException
- AlreadyAdminException
- ResourceNotExistsException
- RoleCannotBeManagedException
- RoleCannotBeSetException
 
- 
addAdminpublic void addAdmin(PerunSession sess, Resource resource, Group group) throws GroupNotExistsException, PrivilegeException, AlreadyAdminException, ResourceNotExistsException, RoleCannotBeManagedException, RoleCannotBeSetException Description copied from interface:ResourcesManagerAdd role resource admin to group for the selected resource.- Specified by:
- addAdminin interface- ResourcesManager
- Parameters:
- sess-
- resource-
- group-
- Throws:
- PrivilegeException
- AlreadyAdminException
- ResourceNotExistsException
- RoleCannotBeManagedException
- GroupNotExistsException
- RoleCannotBeSetException
 
- 
addResourceSelfServiceGrouppublic void addResourceSelfServiceGroup(PerunSession sess, Resource resource, Group group) throws PrivilegeException, AlreadyAdminException, ResourceNotExistsException, GroupNotExistsException Description copied from interface:ResourcesManagerSets ResourceSelfService role to given group for given resource.- Specified by:
- addResourceSelfServiceGroupin interface- ResourcesManager
- Parameters:
- sess- session
- resource- resource
- group- group
- Throws:
- PrivilegeException- insufficient permissions
- AlreadyAdminException- already has the role
- ResourceNotExistsException
- GroupNotExistsException
 
- 
addResourceSelfServiceUserpublic void addResourceSelfServiceUser(PerunSession sess, Resource resource, User user) throws PrivilegeException, AlreadyAdminException, ResourceNotExistsException, UserNotExistsException Description copied from interface:ResourcesManagerSets ResourceSelfService role to given user for given resource.- Specified by:
- addResourceSelfServiceUserin interface- ResourcesManager
- Parameters:
- sess- session
- resource- resource
- user- user id
- Throws:
- PrivilegeException- insufficient permissions
- AlreadyAdminException- already has the role
- ResourceNotExistsException
- UserNotExistsException
 
- 
assignGroupToResourcepublic void assignGroupToResource(PerunSession sess, Group group, Resource resource, boolean async, boolean assignInactive, boolean autoAssignSubgroups) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException, GroupResourceMismatchException Description copied from interface:ResourcesManagerAssign group to a resource. Check if attributes for each member form group are valid. Fill members' attributes with missing value. Work in sync/async mode. Provide options for creating inactive or automatic subgroups group-resource assignments.If the group is already assigned, nothing it performed. - Specified by:
- assignGroupToResourcein interface- ResourcesManager
- Parameters:
- sess-
- group-
- resource-
- async-
- assignInactive-
- autoAssignSubgroups-
- Throws:
- PrivilegeException
- GroupNotExistsException
- ResourceNotExistsException
- WrongAttributeValueException
- WrongReferenceAttributeValueException
- GroupResourceMismatchException
 
- 
assignGroupToResourcespublic void assignGroupToResources(PerunSession perunSession, Group group, List<Resource> resources, boolean async, boolean assignInactive, boolean autoAssignSubgroups) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException, GroupResourceMismatchException Description copied from interface:ResourcesManagerAssign group to the resources. Check if attributes for each member from group are valid. Fill members' attributes with missing values. Work in sync/async mode. Provide options for creating inactive or automatic subgroups group-resource assignments.- Specified by:
- assignGroupToResourcesin interface- ResourcesManager
- Parameters:
- perunSession-
- group- the group
- resources- list of resources
- async-
- assignInactive-
- autoAssignSubgroups-
- Throws:
- PrivilegeException
- GroupNotExistsException
- ResourceNotExistsException
- WrongAttributeValueException
- WrongReferenceAttributeValueException
- GroupResourceMismatchException
 
- 
assignGroupsToResourcepublic void assignGroupsToResource(PerunSession perunSession, List<Group> groups, Resource resource, boolean async, boolean assignInactive, boolean autoAssignSubgroups) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException, GroupResourceMismatchException Description copied from interface:ResourcesManagerAssign groups to a resource. Check if attributes for each member from all groups are valid. Fill members' attributes with missing values. Work in sync/async mode. Provide options for creating inactive or automatic subgroups group-resource assignments.- Specified by:
- assignGroupsToResourcein interface- ResourcesManager
- Parameters:
- perunSession-
- groups- list of resources
- resource-
- async-
- assignInactive-
- autoAssignSubgroups-
- Throws:
- PrivilegeException
- GroupNotExistsException
- ResourceNotExistsException
- WrongAttributeValueException
- WrongReferenceAttributeValueException
- GroupResourceMismatchException
 
- 
assignResourceTagToResourcepublic void assignResourceTagToResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagAlreadyAssignedException Description copied from interface:ResourcesManagerAssign existing ResourceTag on existing Resource.- Specified by:
- assignResourceTagToResourcein interface- ResourcesManager
- Parameters:
- perunSession-
- resourceTag-
- resource-
- Throws:
- PrivilegeException
- ResourceTagNotExistsException
- ResourceNotExistsException
- ResourceTagAlreadyAssignedException
 
- 
assignResourceTagsToResourcepublic void assignResourceTagsToResource(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagAlreadyAssignedException Description copied from interface:ResourcesManagerAssign existing ResourceTags on existing Resource.- Specified by:
- assignResourceTagsToResourcein interface- ResourcesManager
- Parameters:
- perunSession-
- resourceTags-
- resource-
- Throws:
- PrivilegeException
- ResourceTagNotExistsException
- ResourceNotExistsException
- ResourceTagAlreadyAssignedException
 
- 
assignServicepublic void assignService(PerunSession sess, Resource resource, Service service) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceAlreadyAssignedException, WrongAttributeValueException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManagerAssign service to resource.- Specified by:
- assignServicein interface- ResourcesManager
- Parameters:
- sess-
- resource-
- service-
- Throws:
- PrivilegeException
- ResourceNotExistsException
- ServiceNotExistsException
- ServiceAlreadyAssignedException
- WrongAttributeValueException
- WrongReferenceAttributeValueException
 
- 
assignServicespublic void assignServices(PerunSession sess, Resource resource, List<Service> services) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceAlreadyAssignedException, WrongAttributeValueException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManagerAssign services to resource.- Specified by:
- assignServicesin interface- ResourcesManager
- Parameters:
- sess- perun session
- resource- resource
- services- services to be assigned
- Throws:
- PrivilegeException
- ResourceNotExistsException
- ServiceNotExistsException
- ServiceAlreadyAssignedException
- WrongAttributeValueException
- WrongReferenceAttributeValueException
 
- 
copyAttributespublic void copyAttributes(PerunSession sess, Resource sourceResource, Resource destinationResource) throws PrivilegeException, ResourceNotExistsException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManagerCopy 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 the attributes from the source resource. The virtual attributes are not copied.- Specified by:
- copyAttributesin interface- ResourcesManager
- Parameters:
- sess-
- sourceResource-
- destinationResource-
- Throws:
- PrivilegeException
- ResourceNotExistsException
- WrongReferenceAttributeValueException
 
- 
copyGroupspublic void copyGroups(PerunSession sess, Resource sourceResource, Resource destinationResource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerCopy 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- ResourcesManager
- Parameters:
- sourceResource-
- destinationResource-
- Throws:
- ResourceNotExistsException
- PrivilegeException
 
- 
copyResourcepublic Resource copyResource(PerunSession sess, Resource templateResource, Resource destinationResource, boolean withGroups) throws ResourceNotExistsException, PrivilegeException, ResourceExistsException Description copied from interface:ResourcesManagerCopy "template" settings from user's another existing resource and create new resource with this template. The settings are attributes, services, tags (if exists), 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- ResourcesManager
- 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:
- ResourceNotExistsException
- PrivilegeException
- ResourceExistsException
 
- 
copyServicespublic void copyServices(PerunSession sess, Resource sourceResource, Resource destinationResource) throws ResourceNotExistsException, PrivilegeException, WrongAttributeValueException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManagerCopy 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 the services from source resource.- Specified by:
- copyServicesin interface- ResourcesManager
- Parameters:
- sourceResource-
- destinationResource-
- Throws:
- ResourceNotExistsException
- PrivilegeException
- WrongAttributeValueException
- WrongReferenceAttributeValueException
 
- 
createResourcepublic Resource createResource(PerunSession sess, Resource resource, Vo vo, Facility facility) throws PrivilegeException, VoNotExistsException, FacilityNotExistsException, ResourceExistsException Description copied from interface:ResourcesManagerInserts resource into DB.- Specified by:
- createResourcein interface- ResourcesManager
- Parameters:
- resource- resource to create
- vo- virtual organization
- facility- facility
- Throws:
- PrivilegeException
- VoNotExistsException
- FacilityNotExistsException
- ResourceExistsException
 
- 
createResourceTagpublic ResourceTag createResourceTag(PerunSession perunSession, ResourceTag resourceTag, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ResourcesManagerCreate new Resource tag for the vo.- Specified by:
- createResourceTagin interface- ResourcesManager
- Parameters:
- perunSession-
- resourceTag-
- vo-
- Returns:
- new created resourceTag
- Throws:
- PrivilegeException
- VoNotExistsException
 
- 
deactivateGroupResourceAssignmentpublic void deactivateGroupResourceAssignment(PerunSession sess, Group group, Resource resource) throws PrivilegeException, ResourceNotExistsException, GroupNotExistsException, GroupNotDefinedOnResourceException, GroupResourceStatusException Description copied from interface:ResourcesManagerDeactivates 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- ResourcesManager
- Parameters:
- group- group
- resource- resource
- Throws:
- PrivilegeException- insufficient permissions
- ResourceNotExistsException- when the resource doesn't exist
- GroupNotExistsException- when the group doesn't exist
- 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 VoNotExistsException, PrivilegeException, ResourceAlreadyRemovedException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerDeletes all resources for the VO.- Specified by:
- deleteAllResourcesin interface- ResourcesManager
- Parameters:
- sess-
- vo-
- Throws:
- PrivilegeException
- ResourceAlreadyRemovedException- if there are at least 1 resource not affected by deleting from DB
- GroupAlreadyRemovedFromResourceException- if there is at least 1 group which is not affected by removing from DB
- VoNotExistsException
 
- 
deleteAllResourcesTagsForVopublic void deleteAllResourcesTagsForVo(PerunSession perunSession, Vo vo) throws PrivilegeException, VoNotExistsException, ResourceTagAlreadyAssignedException Description copied from interface:ResourcesManagerDelete all ResourcesTags for specific VO.- Specified by:
- deleteAllResourcesTagsForVoin interface- ResourcesManager
- Parameters:
- perunSession-
- vo-
- Throws:
- PrivilegeException
- VoNotExistsException- ¨
- ResourceTagAlreadyAssignedException
 
- 
deleteResourcepublic void deleteResource(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException, ResourceAlreadyRemovedException, GroupAlreadyRemovedFromResourceException, FacilityNotExistsException Description copied from interface:ResourcesManagerDeletes resource by id.- Specified by:
- deleteResourcein interface- ResourcesManager
- Parameters:
- sess-
- resource-
- Throws:
- ResourceNotExistsException
- PrivilegeException
- ResourceAlreadyRemovedException- if there are 0 rows affected by deleting from DB
- GroupAlreadyRemovedFromResourceException- if there is at least 1 group which is not affected by removing from DB
- FacilityNotExistsException- if facility of this resource not exists
 
- 
deleteResourceTagpublic void deleteResourceTag(PerunSession perunSession, ResourceTag resourceTag) throws PrivilegeException, VoNotExistsException, ResourceTagAlreadyAssignedException, ResourceTagNotExistsException Description copied from interface:ResourcesManagerDelete existing Resource tag.- Specified by:
- deleteResourceTagin interface- ResourcesManager
- Parameters:
- perunSession-
- resourceTag-
- Throws:
- PrivilegeException
- VoNotExistsException
- ResourceTagAlreadyAssignedException
- ResourceTagNotExistsException
 
- 
getAdminGroupspublic List<Group> getAdminGroups(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerGets list of all group administrators of the Resource.- Specified by:
- getAdminGroupsin interface- ResourcesManager
- Parameters:
- sess-
- resource-
- Returns:
- list of Group that are admins in the resource.
- Throws:
- PrivilegeException
- ResourceNotExistsException
 
- 
getAdminspublic List<User> getAdmins(PerunSession perunSession, Resource resource, boolean onlyDirectAdmins) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerGets 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- ResourcesManager
- 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
- Throws:
- PrivilegeException
- ResourceNotExistsException
 
- 
getAllResourcesDescription copied from interface:ResourcesManagerGet all resources from database. Returned resources are filtered based on the principal rights.- Specified by:
- getAllResourcesin interface- ResourcesManager
- Parameters:
- sess- Perun session
- Returns:
- list of all resources
- Throws:
- PrivilegeException- if the principal has insufficient permission
 
- 
getAllResourcesByResourceTagpublic List<Resource> getAllResourcesByResourceTag(PerunSession perunSession, ResourceTag resourceTag) throws PrivilegeException, VoNotExistsException, ResourceTagNotExistsException Description copied from interface:ResourcesManagerGet all resources in specific Vo (specific by resourceTag.getVoId) for existing resourceTag- Specified by:
- getAllResourcesByResourceTagin interface- ResourcesManager
- Parameters:
- perunSession-
- resourceTag-
- Returns:
- list of Resources
- Throws:
- PrivilegeException
- VoNotExistsException
- ResourceTagNotExistsException- ¨
 
- 
getAllResourcesTagsForResourcepublic List<ResourceTag> getAllResourcesTagsForResource(PerunSession perunSession, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerGet all resourcesTags for existing Resource- Specified by:
- getAllResourcesTagsForResourcein interface- ResourcesManager
- Parameters:
- perunSession-
- resource-
- Returns:
- list of ResourcesTags
- Throws:
- ResourceNotExistsException
- PrivilegeException
 
- 
getAllResourcesTagsForVopublic List<ResourceTag> getAllResourcesTagsForVo(PerunSession perunSession, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ResourcesManagerGet all resourcesTags for existing Vo.- Specified by:
- getAllResourcesTagsForVoin interface- ResourcesManager
- Parameters:
- perunSession-
- vo-
- Returns:
- list of all resourcesTags for existing Vo
- Throws:
- PrivilegeException
- VoNotExistsException- ¨
 
- 
getAllowedMemberspublic List<Member> getAllowedMembers(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerReturns all members assigned to the resource.- Specified by:
- getAllowedMembersin interface- ResourcesManager
- Parameters:
- sess-
- resource-
- Returns:
- list of members assigned to the resource
- Throws:
- ResourceNotExistsException
- PrivilegeException
 
- 
getAllowedResourcespublic List<Resource> getAllowedResources(PerunSession sess, Member member) throws MemberNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerGet all resources which have the member access on.- Specified by:
- getAllowedResourcesin interface- ResourcesManager
- Parameters:
- sess-
- member-
- Returns:
- list of resources which have the member acess on
- Throws:
- MemberNotExistsException
- PrivilegeException
 
- 
getAllowedUserspublic List<User> getAllowedUsers(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerReturns all users who is assigned with the resource.- Specified by:
- getAllowedUsersin interface- ResourcesManager
- Parameters:
- sess-
- resource-
- Returns:
- list of users
- Throws:
- ResourceNotExistsException
- PrivilegeException
 
- 
getAssignedGroupspublic List<Group> getAssignedGroups(PerunSession sess, Resource resource) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerList all groups associated with the resource.- Specified by:
- getAssignedGroupsin interface- ResourcesManager
- Parameters:
- sess-
- resource-
- Returns:
- list of assigned group
- Throws:
- PrivilegeException
- ResourceNotExistsException
 
- 
getAssignedGroupspublic List<Group> getAssignedGroups(PerunSession sess, Resource resource, Member member) throws PrivilegeException, ResourceNotExistsException, MemberNotExistsException Description copied from interface:ResourcesManagerList all groups associated with the resource and member- Specified by:
- getAssignedGroupsin interface- ResourcesManager
- Parameters:
- sess-
- resource-
- member-
- Returns:
- list of assigned groups associated with the resource and member
- Throws:
- PrivilegeException
- ResourceNotExistsException
- MemberNotExistsException
 
- 
getAssignedMemberspublic List<Member> getAssignedMembers(PerunSession sess, Resource resource) throws PrivilegeException Description copied from interface:ResourcesManagerReturns all members assigned to the resource.- Specified by:
- getAssignedMembersin interface- ResourcesManager
- Parameters:
- sess-
- resource-
- Returns:
- list of assigned members
- Throws:
- PrivilegeException
 
- 
getAssignedMembersWithStatuspublic List<AssignedMember> getAssignedMembersWithStatus(PerunSession sess, Resource resource) throws PrivilegeException Description copied from interface:ResourcesManagerReturns members of groups assigned to resource with status of group-resource assignment.- Specified by:
- getAssignedMembersWithStatusin interface- ResourcesManager
- Parameters:
- sess- perunSession
- resource- resource
- Returns:
- list of members of groups assigned to given resource
- Throws:
- PrivilegeException
 
- 
getAssignedResourcespublic List<Resource> getAssignedResources(PerunSession sess, Group group) throws GroupNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerList all resources to which the group is assigned.- Specified by:
- getAssignedResourcesin interface- ResourcesManager
- Parameters:
- sess-
- group-
- Returns:
- list of assigned resources
- Throws:
- GroupNotExistsException
- PrivilegeException
 
- 
getAssignedResourcespublic List<Resource> getAssignedResources(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:ResourcesManagerGet all resources where the member is assigned.- Specified by:
- getAssignedResourcesin interface- ResourcesManager
- Parameters:
- sess-
- member-
- Returns:
- Throws:
- PrivilegeException
- MemberNotExistsException
 
- 
getAssignedResourcespublic List<Resource> getAssignedResources(PerunSession sess, Member member, Service service) throws PrivilegeException, MemberNotExistsException, ServiceNotExistsException Description copied from interface:ResourcesManagerGet all resources where the member and the service are assigned.- Specified by:
- getAssignedResourcesin interface- ResourcesManager
- Parameters:
- sess-
- member-
- service-
- Returns:
- list of resources
- Throws:
- PrivilegeException
- MemberNotExistsException
- ServiceNotExistsException
 
- 
getAssignedResourcesWithStatuspublic List<AssignedResource> getAssignedResourcesWithStatus(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:ResourcesManagerReturns all assigned resources where member is assigned through the groups.- Specified by:
- getAssignedResourcesWithStatusin interface- ResourcesManager
- Parameters:
- sess- perun session
- member- member
- Returns:
- list of assigned resources
- Throws:
- PrivilegeException
- MemberNotExistsException- if the member does not exist
 
- 
getAssignedRichMemberspublic List<RichMember> getAssignedRichMembers(PerunSession sess, Resource resource) throws PrivilegeException Description copied from interface:ResourcesManagerReturns all members assigned to the resource as RichMembers.- Specified by:
- getAssignedRichMembersin interface- ResourcesManager
- Parameters:
- sess-
- resource-
- Returns:
- list of assigned rich members
- Throws:
- PrivilegeException
 
- 
getAssignedRichResourcespublic List<RichResource> getAssignedRichResources(PerunSession sess, Group group) throws GroupNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerList all rich resources associated with the group with facility property filled.- Specified by:
- getAssignedRichResourcesin interface- ResourcesManager
- Parameters:
- sess-
- group-
- Returns:
- list of assigned rich resources
- Throws:
- GroupNotExistsException
- PrivilegeException
 
- 
getAssignedRichResourcespublic List<RichResource> getAssignedRichResources(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:ResourcesManagerGet all rich resources where the member is assigned with facility property filled.- Specified by:
- getAssignedRichResourcesin interface- ResourcesManager
- Parameters:
- sess-
- member-
- Returns:
- list of rich resources
- Throws:
- PrivilegeException
- MemberNotExistsException
 
- 
getAssignedRichResourcespublic List<RichResource> getAssignedRichResources(PerunSession sess, Member member, Service service) throws PrivilegeException, MemberNotExistsException, ServiceNotExistsException Description copied from interface:ResourcesManagerGet all rich resources where the service and the member are assigned with facility property filled.- Specified by:
- getAssignedRichResourcesin interface- ResourcesManager
- Parameters:
- sess-
- member-
- service-
- Returns:
- list of rich resources
- Throws:
- PrivilegeException
- MemberNotExistsException
- ServiceNotExistsException
 
- 
getAssignedServicespublic List<Service> getAssignedServices(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerList all services associated with the resource.- Specified by:
- getAssignedServicesin interface- ResourcesManager
- Parameters:
- sess-
- resource-
- Returns:
- list of assigned resources
- Throws:
- ResourceNotExistsException
- PrivilegeException
 
- 
getBanpublic BanOnResource getBan(PerunSession sess, int memberId, int resourceId) throws BanNotExistsException, PrivilegeException, MemberNotExistsException, ResourceNotExistsException Description copied from interface:ResourcesManagerGet ban by memberId and resource id- Specified by:
- getBanin interface- ResourcesManager
- Parameters:
- sess-
- memberId- the id of member
- resourceId- the id of resource
- Returns:
- specific ban for member on resource
- Throws:
- BanNotExistsException
- PrivilegeException
- MemberNotExistsException
- ResourceNotExistsException
 
- 
getBanByIdpublic BanOnResource getBanById(PerunSession sess, int banId) throws BanNotExistsException, PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerGet Ban for member on resource by it's id- Specified by:
- getBanByIdin interface- ResourcesManager
- Parameters:
- sess-
- banId- the id of ban
- Returns:
- resource ban by it's id
- Throws:
- BanNotExistsException
- PrivilegeException
- ResourceNotExistsException
 
- 
getBansForMemberpublic List<BanOnResource> getBansForMember(PerunSession sess, int memberId) throws MemberNotExistsException, ResourceNotExistsException Description copied from interface:ResourcesManagerGet all bans for member on any resource.- Specified by:
- getBansForMemberin interface- ResourcesManager
- Parameters:
- sess-
- memberId- the id of member
- Returns:
- list of bans for member on any resource
- Throws:
- MemberNotExistsException
- ResourceNotExistsException
 
- 
getBansForResourcepublic List<BanOnResource> getBansForResource(PerunSession sess, int resourceId) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerGet all bans for members on the resource.- Specified by:
- getBansForResourcein interface- ResourcesManager
- Parameters:
- sess-
- resourceId- the id of resource
- Returns:
- list of all members bans on the resource
- Throws:
- PrivilegeException
- ResourceNotExistsException
 
- 
getEnrichedBansForResourcepublic List<EnrichedBanOnResource> getEnrichedBansForResource(PerunSession sess, int resourceId, List<String> attrNames) throws PrivilegeException, ResourceNotExistsException, AttributeNotExistsException Description copied from interface:ResourcesManagerGet all enriched bans for members on the resource.- Specified by:
- getEnrichedBansForResourcein interface- ResourcesManager
- Parameters:
- sess-
- resourceId- the id of resource
- attrNames- list of attributes names, returns all user/member attributes if null or empty
- Returns:
- list of all enriched bans on resource
- Throws:
- PrivilegeException
- ResourceNotExistsException
- AttributeNotExistsException
 
- 
getEnrichedBansForUserpublic List<EnrichedBanOnResource> getEnrichedBansForUser(PerunSession sess, int userId, List<String> attrNames) throws PrivilegeException, UserNotExistsException, AttributeNotExistsException Description copied from interface:ResourcesManagerGet all enriched bans on resources for user.- Specified by:
- getEnrichedBansForUserin interface- ResourcesManager
- Parameters:
- sess-
- userId- id of user
- Returns:
- attrNames list of attributes names, returns all user/member attributes if null or empty
- Throws:
- PrivilegeException
- UserNotExistsException
- AttributeNotExistsException
 
- 
getEnrichedResourceByIdpublic EnrichedResource getEnrichedResourceById(PerunSession sess, int id, List<String> attrNames) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerFind 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- ResourcesManager
- Parameters:
- sess- session
- id- resource id
- attrNames- names of attributes to return
- Returns:
- resource for given id with desired attributes
- Throws:
- PrivilegeException- insufficient permissions
- ResourceNotExistsException- if there is no resource with given id
 
- 
getEnrichedResourcesForFacilitypublic List<EnrichedResource> getEnrichedResourcesForFacility(PerunSession sess, Facility facility, List<String> attrNames) throws FacilityNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerFind resources for given facility and attributes for given names. If the attrNames are empty or null, return all attributes.- Specified by:
- getEnrichedResourcesForFacilityin interface- ResourcesManager
- Parameters:
- sess- session
- facility- facility
- attrNames- names of attributes to return
- Returns:
- resources with desired attributes
- Throws:
- FacilityNotExistsException- if there is not facility with given id
- PrivilegeException- insufficient permissions
 
- 
getEnrichedResourcesForVopublic List<EnrichedResource> getEnrichedResourcesForVo(PerunSession sess, Vo vo, List<String> attrNames) throws VoNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerFind resources for given vo and attributes for given names. If the attrNames are empty or null, return all attributes.- Specified by:
- getEnrichedResourcesForVoin interface- ResourcesManager
- Parameters:
- sess- session
- vo- vo
- attrNames- names of attributes to return
- Returns:
- resources with desired attributes
- Throws:
- VoNotExistsException- if there is no vo with given id
- PrivilegeException- insufficient permissions
 
- 
getFacilitypublic Facility getFacility(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerGet facility which belongs to the concrete resource.- Specified by:
- getFacilityin interface- ResourcesManager
- Parameters:
- sess-
- resource-
- Returns:
- facility belonging to the resource
- Throws:
- ResourceNotExistsException
- PrivilegeException
 
- 
getGroupAssignmentspublic List<AssignedGroup> getGroupAssignments(PerunSession sess, Resource resource, List<String> attrNames) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerLists 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- ResourcesManager
- Parameters:
- sess-
- resource- resource
- attrNames- names of attributes to return
- Returns:
- list of assigned groups for given resource with specified attributes
- Throws:
- PrivilegeException- insufficient permissions
- ResourceNotExistsException- when the resource doesn't exist
 
- 
getMailingServiceRichResourcesWithMemberpublic List<RichResource> getMailingServiceRichResourcesWithMember(PerunSession sess, Member member) throws MemberNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerReturn all rich resources with mailing service(s) where given member is assigned.- Specified by:
- getMailingServiceRichResourcesWithMemberin interface- ResourcesManager
- Parameters:
- sess- session
- member- member
- Returns:
- list of corresponding rich resources
- Throws:
- MemberNotExistsException- if member is not present (does not exist)
- PrivilegeException
 
- 
getPerunBl
- 
getResourceAssignmentspublic List<AssignedResource> getResourceAssignments(PerunSession sess, Group group, List<String> attrNames) throws PrivilegeException, GroupNotExistsException Description copied from interface:ResourcesManagerLists 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- ResourcesManager
- 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
- Throws:
- PrivilegeException- insufficient permissions
- GroupNotExistsException- when the group doesn't exist
 
- 
getResourceByIdpublic Resource getResourceById(PerunSession sess, int id) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerSearches for the Resource with specified id.- Specified by:
- getResourceByIdin interface- ResourcesManager
- Parameters:
- sess-
- id-
- Returns:
- Resource with specified id
- Throws:
- PrivilegeException
- ResourceNotExistsException
 
- 
getResourceByNamepublic Resource getResourceByName(PerunSession sess, Vo vo, Facility facility, String name) throws PrivilegeException, ResourceNotExistsException, VoNotExistsException, FacilityNotExistsException Description copied from interface:ResourcesManagerReturn resource by its name.- Specified by:
- getResourceByNamein interface- ResourcesManager
- Parameters:
- sess-
- vo-
- facility-
- name-
- Returns:
- resource
- Throws:
- PrivilegeException
- ResourceNotExistsException
- VoNotExistsException
- FacilityNotExistsException
 
- 
getResourcespublic List<Resource> getResources(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ResourcesManagerGet all VO resources. If called by resourceAdmin it returns only those resources of which is he admin.- Specified by:
- getResourcesin interface- ResourcesManager
- Parameters:
- sess-
- vo-
- Returns:
- list of resources
- Throws:
- PrivilegeException
- VoNotExistsException
 
- 
getResourcesByIdspublic List<Resource> getResourcesByIds(PerunSession sess, List<Integer> ids) throws PrivilegeException Description copied from interface:ResourcesManagerSearch for the Resources with specific ids.- Specified by:
- getResourcesByIdsin interface- ResourcesManager
- Parameters:
- sess-
- ids-
- Returns:
- Resources with specified ids
- Throws:
- PrivilegeException
 
- 
getResourcesCountpublic int getResourcesCount(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ResourcesManagerGet all VO resources count.- Specified by:
- getResourcesCountin interface- ResourcesManager
- Parameters:
- sess-
- vo-
- Returns:
- count of vo resources
- Throws:
- PrivilegeException
- VoNotExistsException
 
- 
getResourcesCountDescription copied from interface:ResourcesManagerGet count of all resources.- Specified by:
- getResourcesCountin interface- ResourcesManager
- Parameters:
- sess-
- Returns:
- count of all resources
 
- 
getResourcesManagerBlGets the resourcesManagerBl for this instance.- Returns:
- The resourcesManagerBl.
 
- 
getResourcesWhereGroupIsAdminpublic List<Resource> getResourcesWhereGroupIsAdmin(PerunSession sess, Facility facility, Vo vo, Group authorizedGroup) throws PrivilegeException, GroupNotExistsException, FacilityNotExistsException, VoNotExistsException Description copied from interface:ResourcesManagerReturn all resources for the facility and the vo where the group is authorized as resource manager.- Specified by:
- getResourcesWhereGroupIsAdminin interface- ResourcesManager
- 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
- Throws:
- PrivilegeException
- GroupNotExistsException
- FacilityNotExistsException
- VoNotExistsException
 
- 
getResourcesWhereUserIsAdminpublic List<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, User user) throws UserNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerReturns 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- ResourcesManager
- Parameters:
- sess-
- user-
- Returns:
- list of resources, where the user is an admin.
- Throws:
- UserNotExistsException
- PrivilegeException
 
- 
getResourcesWhereUserIsAdminpublic List<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, Facility facility, Vo vo, User authorizedUser) throws PrivilegeException, UserNotExistsException, FacilityNotExistsException, VoNotExistsException Description copied from interface:ResourcesManagerReturn 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- ResourcesManager
- 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
- Throws:
- PrivilegeException
- UserNotExistsException
- FacilityNotExistsException
- VoNotExistsException
 
- 
getResourcesWhereUserIsAdminpublic List<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, Vo vo, User authorizedUser) throws PrivilegeException, UserNotExistsException, VoNotExistsException Description copied from interface:ResourcesManagerReturn 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- ResourcesManager
- 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
- Throws:
- PrivilegeException
- UserNotExistsException
- VoNotExistsException
 
- 
getRichAdminspublic List<RichUser> getRichAdmins(PerunSession perunSession, Resource resource, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) throws UserNotExistsException, PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerGets 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- ResourcesManager
- 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
- PrivilegeException
- ResourceNotExistsException
 
- 
getRichResourceByIdpublic RichResource getRichResourceById(PerunSession sess, int id) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerSearch for the RichResource with specific id.- Specified by:
- getRichResourceByIdin interface- ResourcesManager
- Parameters:
- sess-
- id-
- Returns:
- RichResource with specified id
- Throws:
- PrivilegeException
- ResourceNotExistsException
 
- 
getRichResourcespublic List<RichResource> getRichResources(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ResourcesManagerGet all VO rich resources with facility property filled. If called by resourceAdmin it returns only those resources of which is he admin.- Specified by:
- getRichResourcesin interface- ResourcesManager
- Parameters:
- sess-
- vo-
- Returns:
- list of rich resources
- Throws:
- PrivilegeException
- VoNotExistsException
 
- 
getRichResourcesByIdspublic List<RichResource> getRichResourcesByIds(PerunSession sess, List<Integer> ids) throws PrivilegeException Description copied from interface:ResourcesManagerSearch for the RichResources with specific ids.- Specified by:
- getRichResourcesByIdsin interface- ResourcesManager
- Parameters:
- sess-
- ids-
- Returns:
- RichResources with specified ids
- Throws:
- PrivilegeException
 
- 
getVopublic Vo getVo(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerGet Vo which is tied to specified resource.- Specified by:
- getVoin interface- ResourcesManager
- Parameters:
- sess-
- resource-
- Returns:
- vo tied to specified resource
- Throws:
- ResourceNotExistsException
- PrivilegeException
 
- 
isResourceLastAssignedServicespublic List<Service> isResourceLastAssignedServices(PerunSession sess, Resource resource, List<Service> services) throws FacilityNotExistsException, ResourceNotExistsException, PrivilegeException, ServiceNotExistsException Description copied from interface:ResourcesManagerChecks 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- ResourcesManager
- Parameters:
- sess-
- resource-
- services-
- Returns:
- list of services where the provided resource is last to have them assigned on its facility.
- Throws:
- FacilityNotExistsException
- ResourceNotExistsException
- PrivilegeException
- ServiceNotExistsException
 
- 
removeAdminpublic void removeAdmin(PerunSession sess, Resource resource, User user) throws UserNotExistsException, PrivilegeException, UserNotAdminException, ResourceNotExistsException, RoleCannotBeManagedException Description copied from interface:ResourcesManagerRemove role resource admin from user for the selected resource.- Specified by:
- removeAdminin interface- ResourcesManager
- Parameters:
- sess-
- resource-
- user-
- Throws:
- UserNotExistsException
- PrivilegeException
- ResourceNotExistsException
- UserNotAdminException
- RoleCannotBeManagedException
 
- 
removeAdminpublic void removeAdmin(PerunSession sess, Resource resource, Group group) throws GroupNotExistsException, PrivilegeException, GroupNotAdminException, ResourceNotExistsException, RoleCannotBeManagedException Description copied from interface:ResourcesManagerRemove role resource admin from group for the selected resource.- Specified by:
- removeAdminin interface- ResourcesManager
- Parameters:
- sess-
- resource-
- group-
- Throws:
- GroupNotExistsException
- PrivilegeException
- GroupNotAdminException
- ResourceNotExistsException
- RoleCannotBeManagedException
 
- 
removeAllResourcesTagFromResourcepublic void removeAllResourcesTagFromResource(PerunSession perunSession, Resource resource) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerRemove all Resource tags for specific resource.- Specified by:
- removeAllResourcesTagFromResourcein interface- ResourcesManager
- Parameters:
- perunSession-
- resource-
- Throws:
- PrivilegeException
- ResourceNotExistsException
 
- 
removeBanpublic void removeBan(PerunSession sess, int banId) throws PrivilegeException, BanNotExistsException, ResourceNotExistsException Description copied from interface:ResourcesManagerRemove specific ban by it's id.- Specified by:
- removeBanin interface- ResourcesManager
- Parameters:
- sess-
- banId- the id of ban
- Throws:
- PrivilegeException
- BanNotExistsException
- ResourceNotExistsException
 
- 
removeBanpublic void removeBan(PerunSession sess, int memberId, int resourceId) throws BanNotExistsException, PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerRemove specific ban by memberId and resourceId.- Specified by:
- removeBanin interface- ResourcesManager
- Parameters:
- sess-
- memberId- the id of member
- resourceId- the id of resource
- Throws:
- BanNotExistsException
- PrivilegeException
- ResourceNotExistsException
 
- 
removeGroupFromResourcepublic void removeGroupFromResource(PerunSession sess, Group group, Resource resource) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, GroupNotDefinedOnResourceException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerRemove group from a resource. After removing, check attributes and fix them if it is needed.- Specified by:
- removeGroupFromResourcein interface- ResourcesManager
- Parameters:
- sess-
- group-
- resource-
- Throws:
- PrivilegeException
- ResourceNotExistsException
- GroupNotDefinedOnResourceException- Group was never assigned to this resource
- GroupAlreadyRemovedFromResourceException- if there are 0 rows affected by deleting from DB
- GroupNotExistsException
 
- 
removeGroupFromResourcespublic void removeGroupFromResources(PerunSession perunSession, Group group, List<Resource> resources) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, GroupNotDefinedOnResourceException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerRemove group from the resources. After removing, check attributes and fix them if it is needed.- Specified by:
- removeGroupFromResourcesin interface- ResourcesManager
- Parameters:
- perunSession-
- group- list of groups
- resources- list of resources
- Throws:
- PrivilegeException
- GroupNotExistsException
- ResourceNotExistsException
- GroupNotDefinedOnResourceException
- GroupAlreadyRemovedFromResourceException
 
- 
removeGroupsFromResourcepublic void removeGroupsFromResource(PerunSession perunSession, List<Group> groups, Resource resource) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, GroupNotDefinedOnResourceException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerRemove groups from a resource. After removing, check attributes and fix them if it is needed.- Specified by:
- removeGroupsFromResourcein interface- ResourcesManager
- Parameters:
- perunSession-
- groups- list of groups
- resource-
- Throws:
- PrivilegeException
- GroupNotExistsException
- ResourceNotExistsException
- GroupNotDefinedOnResourceException
- GroupAlreadyRemovedFromResourceException
 
- 
removeResourceSelfServiceGrouppublic void removeResourceSelfServiceGroup(PerunSession sess, Resource resource, Group group) throws PrivilegeException, GroupNotAdminException, ResourceNotExistsException, GroupNotExistsException Description copied from interface:ResourcesManagerUnset ResourceSelfService role to given group for given resource.- Specified by:
- removeResourceSelfServiceGroupin interface- ResourcesManager
- Parameters:
- sess- session
- resource- resource
- group- group
- Throws:
- PrivilegeException- insufficient permissions
- GroupNotAdminException- group did not have the role
- ResourceNotExistsException
- GroupNotExistsException
 
- 
removeResourceSelfServiceUserpublic void removeResourceSelfServiceUser(PerunSession sess, Resource resource, User user) throws PrivilegeException, UserNotAdminException, ResourceNotExistsException, UserNotExistsException Description copied from interface:ResourcesManagerUnset ResourceSelfService role to given user for given resource.- Specified by:
- removeResourceSelfServiceUserin interface- ResourcesManager
- Parameters:
- sess- session
- resource- resource
- user- user
- Throws:
- PrivilegeException- insufficient permissions
- UserNotAdminException- user did not have the role
- ResourceNotExistsException
- UserNotExistsException
 
- 
removeResourceTagFromResourcepublic void removeResourceTagFromResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagNotAssignedException Description copied from interface:ResourcesManagerRemove specific ResourceTag from existing Resource.- Specified by:
- removeResourceTagFromResourcein interface- ResourcesManager
- Parameters:
- perunSession-
- resourceTag-
- resource-
- Throws:
- PrivilegeException
- ResourceTagNotExistsException
- ResourceNotExistsException
- ResourceTagNotAssignedException
 
- 
removeResourceTagsFromResourcepublic void removeResourceTagsFromResource(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagNotAssignedException Description copied from interface:ResourcesManagerRemove specific ResourceTags from existing Resource.- Specified by:
- removeResourceTagsFromResourcein interface- ResourcesManager
- Parameters:
- perunSession-
- resourceTags-
- resource-
- Throws:
- PrivilegeException
- ResourceTagNotExistsException
- ResourceNotExistsException
- ResourceTagNotAssignedException
 
- 
removeServicepublic void removeService(PerunSession sess, Resource resource, Service service) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceNotAssignedException Description copied from interface:ResourcesManagerRemove service from resource.- Specified by:
- removeServicein interface- ResourcesManager
- Parameters:
- sess-
- resource-
- service-
- Throws:
- PrivilegeException
- ResourceNotExistsException
- ServiceNotExistsException
- ServiceNotAssignedException
 
- 
removeServicepublic void removeService(PerunSession perunSession, List<Resource> resources, Service service) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceNotAssignedException, FacilityNotExistsException, FacilityMismatchException Description copied from interface:ResourcesManagerRemove service from multiple resources in the same facility- Specified by:
- removeServicein interface- ResourcesManager
- Parameters:
- perunSession-
- resources-
- service-
- Throws:
- PrivilegeException
- ResourceNotExistsException
- ServiceNotExistsException
- ServiceNotAssignedException
- FacilityNotExistsException
- FacilityMismatchException
 
- 
removeServicespublic void removeServices(PerunSession sess, Resource resource, List<Service> services, boolean removeTasks, boolean removeTaskResults, boolean removeDestinations) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceNotAssignedException, FacilityNotExistsException Description copied from interface:ResourcesManagerRemove 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- ResourcesManager
- Parameters:
- sess-
- resource-
- services-
- removeTasks-
- removeTaskResults-
- removeDestinations-
- Throws:
- PrivilegeException
- ResourceNotExistsException
- ServiceNotExistsException
- ServiceNotAssignedException
- FacilityNotExistsException
 
- 
setBanpublic BanOnResource setBan(PerunSession sess, BanOnResource banOnResource) throws PrivilegeException, BanAlreadyExistsException, ResourceNotExistsException Description copied from interface:ResourcesManagerSet ban for member on resource.- Specified by:
- setBanin interface- ResourcesManager
- Parameters:
- sess-
- banOnResource- the ban
- Returns:
- ban on resource
- Throws:
- PrivilegeException
- BanAlreadyExistsException
- ResourceNotExistsException
 
- 
setPerunBlSets the perunBl for this instance.- Parameters:
- perunBl- The perunBl.
 
- 
setResourcesManagerBlSets the resourcesManagerBl for this instance.- Parameters:
- resourcesManagerBl- The resourcesManagerBl.
 
- 
updateBanpublic BanOnResource updateBan(PerunSession sess, BanOnResource banOnResource) throws PrivilegeException, MemberNotExistsException, BanNotExistsException, ResourceNotExistsException Description copied from interface:ResourcesManagerUpdate existing ban (description, validation timestamp)- Specified by:
- updateBanin interface- ResourcesManager
- Parameters:
- sess-
- banOnResource- the specific ban
- Returns:
- updated ban
- Throws:
- PrivilegeException
- MemberNotExistsException
- BanNotExistsException
- ResourceNotExistsException
 
- 
updateResourcepublic Resource updateResource(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException, ResourceExistsException Description copied from interface:ResourcesManagerUpdates Resource.- Specified by:
- updateResourcein interface- ResourcesManager
- Parameters:
- sess-
- resource-
- Returns:
- returns updated Resource
- Throws:
- ResourceNotExistsException
- PrivilegeException
- ResourceExistsException
 
- 
updateResourceTagpublic ResourceTag updateResourceTag(PerunSession perunSession, ResourceTag resourceTag) throws PrivilegeException, ResourceTagNotExistsException, VoNotExistsException Description copied from interface:ResourcesManagerUpdate existing Resource tag.- Specified by:
- updateResourceTagin interface- ResourcesManager
- Parameters:
- perunSession-
- resourceTag-
- Returns:
- updated ResourceTag
- Throws:
- PrivilegeException
- ResourceTagNotExistsException
- VoNotExistsException
 
 
-