Package cz.metacentrum.perun.core.api
Interface ResourcesManager
- All Known Implementing Classes:
- ResourcesManagerEntry
public interface ResourcesManager
Manages resources.
- Author:
- Slavek Licehammer,
- 
Method SummaryModifier and TypeMethodDescriptionvoidactivateGroupResourceAssignment(PerunSession session, 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 perunSession, 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 perunSession, Resource resource, Service service) Assign service to resource.voidassignServices(PerunSession perunSession, 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 perunSession, 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 perunSession, 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 session, Group group, Resource resource) Deactivates the group-resource assignment.voiddeleteAllResources(PerunSession perunSession, Vo vo) Deletes all resources for the VO.voiddeleteAllResourcesTagsForVo(PerunSession perunSession, Vo vo) Delete all ResourcesTags for specific VO.voiddeleteResource(PerunSession perunSession, Resource resource) Deletes resource by id.voiddeleteResourceTag(PerunSession perunSession, ResourceTag resourceTag) Delete existing Resource tag.getAdminGroups(PerunSession sess, Resource resource) Deprecated.getAdmins(PerunSession perunSession, Resource resource, boolean onlyDirectAdmins) Deprecated.getAllowedMembers(PerunSession perunSession, 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 perunSession, Resource resource) List all groups associated with the resource.getAssignedGroups(PerunSession perunSession, 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 perunSession, 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 perunSession, 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 perunSession, 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 perunSession, Resource resource) Get facility which belongs to the concrete resource.getGroupAssignments(PerunSession session, Resource resource, List<String> attrNames) Lists all of the assigned groups for the given resource.getMailingServiceRichResourcesWithMember(PerunSession perunSession, Member member) Return all rich resources with mailing service(s) where given member is assigned.getResourceAssignments(PerunSession session, Group group, List<String> attrNames) Lists all of the resource assignments for the given group.getResourceById(PerunSession perunSession, int id) Searches for the Resource with specified id.getResourceByName(PerunSession sess, Vo vo, Facility facility, String name) Return resource by its name.getResources(PerunSession perunSession, Vo vo) Get all VO resources.getResourcesByIds(PerunSession perunSession, List<Integer> ids) Search for the Resources with specific ids.intgetResourcesCount(PerunSession perunSession) Get count of all resources.intgetResourcesCount(PerunSession perunSession, Vo vo) Get all VO resources count.getResourcesWhereGroupIsAdmin(PerunSession sess, Facility facility, Vo vo, Group authorizedGroup) Return all resources for the facility and the vo where the group is authorized as resource manager.getResourcesWhereUserIsAdmin(PerunSession sess, Facility facility, Vo vo, User authorizedUser) Return all resources for the facility and the vo where user is authorized as resource manager.getResourcesWhereUserIsAdmin(PerunSession sess, User user) Returns list of resources, where the user is an admin.getResourcesWhereUserIsAdmin(PerunSession sess, Vo vo, User authorizedUser) Return all resources for the vo where user is authorized as resource manager.getRichAdmins(PerunSession perunSession, Resource resource, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) Deprecated.getRichResourceById(PerunSession perunSession, int id) Search for the RichResource with specific id.getRichResources(PerunSession perunSession, Vo vo) Get all VO rich resources with facility property filled.getRichResourcesByIds(PerunSession perunSession, List<Integer> ids) Search for the RichResources with specific ids.getVo(PerunSession perunSession, 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 perunSession, Group group, Resource resource) Remove group from a resource.voidremoveGroupFromResources(PerunSession perunSession, Group groups, 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 perunSession, 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 perunSession, 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.updateBan(PerunSession sess, BanOnResource banOnResource) Update existing ban (description, validation timestamp)updateResource(PerunSession perunSession, Resource resource) Updates Resource.updateResourceTag(PerunSession perunSession, ResourceTag resourceTag) Update existing Resource tag.
- 
Method Details- 
activateGroupResourceAssignmentvoid activateGroupResourceAssignment(PerunSession session, Group group, Resource resource, boolean async) throws ResourceNotExistsException, GroupNotExistsException, PrivilegeException, WrongReferenceAttributeValueException, GroupNotDefinedOnResourceException, GroupResourceMismatchException, WrongAttributeValueException Try 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.- Parameters:
- session-
- group- group
- resource- resource
- async- if true the validation is performed asynchronously
- Throws:
- PrivilegeException- insufficient permissions
- GroupNotExistsException- when the group doesn't exist
- ResourceNotExistsException- when the resource doesn't exist
- WrongAttributeValueException- when an attribute value has wrong/illegal syntax
- WrongReferenceAttributeValueException- when an attribute value has wrong/illegal semantics
- GroupResourceMismatchException- when the given group and resource are not from the same VO
- GroupNotDefinedOnResourceException- when the group-resource assignment doesn't exist
 
- 
addAdminvoid addAdmin(PerunSession sess, Resource resource, User user) throws UserNotExistsException, PrivilegeException, AlreadyAdminException, ResourceNotExistsException, RoleCannotBeManagedException, RoleCannotBeSetException Add role resource admin to user for the selected resource.- Parameters:
- sess-
- resource-
- user-
- Throws:
- InternalErrorException
- UserNotExistsException
- PrivilegeException
- AlreadyAdminException
- ResourceNotExistsException
- RoleCannotBeManagedException
- RoleCannotBeSetException
 
- 
addAdminvoid addAdmin(PerunSession sess, Resource resource, Group group) throws GroupNotExistsException, PrivilegeException, AlreadyAdminException, ResourceNotExistsException, RoleCannotBeManagedException, RoleCannotBeSetException Add role resource admin to group for the selected resource.- Parameters:
- sess-
- resource-
- group-
- Throws:
- InternalErrorException
- UserNotExistsException
- PrivilegeException
- AlreadyAdminException
- ResourceNotExistsException
- RoleCannotBeManagedException
- GroupNotExistsException
- RoleCannotBeSetException
 
- 
addResourceSelfServiceGroupvoid addResourceSelfServiceGroup(PerunSession sess, Resource resource, Group group) throws PrivilegeException, AlreadyAdminException, ResourceNotExistsException, GroupNotExistsException Sets ResourceSelfService role to given group for given resource.- Parameters:
- sess- session
- resource- resource
- group- group
- Throws:
- InternalErrorException- internal error
- PrivilegeException- insufficient permissions
- AlreadyAdminException- already has the role
- ResourceNotExistsException
- GroupNotExistsException
 
- 
addResourceSelfServiceUservoid addResourceSelfServiceUser(PerunSession sess, Resource resource, User user) throws PrivilegeException, AlreadyAdminException, ResourceNotExistsException, UserNotExistsException Sets ResourceSelfService role to given user for given resource.- Parameters:
- sess- session
- resource- resource
- user- user id
- Throws:
- InternalErrorException- internal error
- PrivilegeException- insufficient permissions
- AlreadyAdminException- already has the role
- ResourceNotExistsException
- UserNotExistsException
 
- 
assignGroupToResourcevoid assignGroupToResource(PerunSession perunSession, Group group, Resource resource, boolean async, boolean assignInactive, boolean autoAssignSubgroups) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException, GroupResourceMismatchException Assign 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. - Parameters:
- perunSession-
- group-
- resource-
- async-
- assignInactive-
- autoAssignSubgroups-
- Throws:
- InternalErrorException
- GroupNotExistsException
- ResourceNotExistsException
- PrivilegeException
- WrongAttributeValueException
- WrongReferenceAttributeValueException
- GroupResourceMismatchException
 
- 
assignGroupToResourcesvoid assignGroupToResources(PerunSession perunSession, Group group, List<Resource> resources, boolean async, boolean assignInactive, boolean autoAssignSubgroups) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException, GroupResourceMismatchException Assign 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.- Parameters:
- perunSession-
- group- the group
- resources- list of resources
- async-
- assignInactive-
- autoAssignSubgroups-
- Throws:
- InternalErrorException
- PrivilegeException
- GroupNotExistsException
- ResourceNotExistsException
- WrongAttributeValueException
- WrongReferenceAttributeValueException
- GroupResourceMismatchException
 
- 
assignGroupsToResourcevoid assignGroupsToResource(PerunSession perunSession, List<Group> groups, Resource resource, boolean async, boolean assignInactive, boolean autoAssignSubgroups) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException, GroupResourceMismatchException Assign 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.- Parameters:
- perunSession-
- groups- list of resources
- resource-
- async-
- assignInactive-
- autoAssignSubgroups-
- Throws:
- InternalErrorException
- PrivilegeException
- GroupNotExistsException
- ResourceNotExistsException
- WrongAttributeValueException
- WrongReferenceAttributeValueException
- GroupResourceMismatchException
 
- 
assignResourceTagToResourcevoid assignResourceTagToResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagAlreadyAssignedException Assign existing ResourceTag on existing Resource.- Parameters:
- perunSession-
- resourceTag-
- resource-
- Throws:
- InternalErrorException
- PrivilegeException
- ResourceTagNotExistsException
- ResourceNotExistsException
- ResourceTagAlreadyAssignedException
 
- 
assignResourceTagsToResourcevoid assignResourceTagsToResource(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagAlreadyAssignedException Assign existing ResourceTags on existing Resource.- Parameters:
- perunSession-
- resourceTags-
- resource-
- Throws:
- InternalErrorException
- PrivilegeException
- ResourceTagNotExistsException
- ResourceNotExistsException
- ResourceTagAlreadyAssignedException
 
- 
assignServicevoid assignService(PerunSession perunSession, Resource resource, Service service) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceAlreadyAssignedException, WrongAttributeValueException, WrongReferenceAttributeValueException Assign service to resource.- Parameters:
- perunSession-
- resource-
- service-
- Throws:
- InternalErrorException
- ResourceNotExistsException
- PrivilegeException
- ServiceNotExistsException
- WrongReferenceAttributeValueException
- WrongAttributeValueException
- ServiceAlreadyAssignedException
 
- 
assignServicesvoid assignServices(PerunSession perunSession, Resource resource, List<Service> services) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceAlreadyAssignedException, WrongAttributeValueException, WrongReferenceAttributeValueException Assign services to resource.- Parameters:
- perunSession- perun session
- resource- resource
- services- services to be assigned
- Throws:
- ResourceNotExistsException
- PrivilegeException
- ServiceNotExistsException
- WrongReferenceAttributeValueException
- WrongAttributeValueException
- ServiceAlreadyAssignedException
 
- 
copyAttributesvoid copyAttributes(PerunSession sess, Resource sourceResource, Resource destinationResource) throws PrivilegeException, ResourceNotExistsException, WrongReferenceAttributeValueException Copy 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.- Parameters:
- sess-
- sourceResource-
- destinationResource-
- Throws:
- InternalErrorException
- PrivilegeException
- ResourceNotExistsException
- WrongReferenceAttributeValueException
 
- 
copyGroupsvoid copyGroups(PerunSession sess, Resource sourceResource, Resource destinationResource) throws ResourceNotExistsException, PrivilegeException Copy 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.- Parameters:
- sourceResource-
- destinationResource-
- Throws:
- InternalErrorException
- ResourceNotExistsException
- PrivilegeException
 
- 
copyResourceResource copyResource(PerunSession perunSession, Resource templateResource, Resource destinationResource, boolean withGroups) throws ResourceNotExistsException, PrivilegeException, ResourceExistsException Copy "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.- Parameters:
- perunSession-
- 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:
- InternalErrorException
- ResourceNotExistsException
- PrivilegeException
- ResourceExistsException
 
- 
copyServicesvoid copyServices(PerunSession sess, Resource sourceResource, Resource destinationResource) throws ResourceNotExistsException, PrivilegeException, WrongAttributeValueException, WrongReferenceAttributeValueException Copy 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.- Parameters:
- sourceResource-
- destinationResource-
- Throws:
- InternalErrorException
- ResourceNotExistsException
- PrivilegeException
- WrongAttributeValueException
- WrongReferenceAttributeValueException
 
- 
createResourceResource createResource(PerunSession perunSession, Resource resource, Vo vo, Facility facility) throws PrivilegeException, VoNotExistsException, FacilityNotExistsException, ResourceExistsException Inserts resource into DB.- Parameters:
- resource- resource to create
- vo- virtual organization
- facility- facility
- Throws:
- InternalErrorException
- PrivilegeException
- VoNotExistsException
- FacilityNotExistsException
- ResourceExistsException
 
- 
createResourceTagResourceTag createResourceTag(PerunSession perunSession, ResourceTag resourceTag, Vo vo) throws PrivilegeException, VoNotExistsException Create new Resource tag for the vo.- Parameters:
- perunSession-
- resourceTag-
- vo-
- Returns:
- new created resourceTag
- Throws:
- InternalErrorException
- PrivilegeException
- VoNotExistsException
 
- 
deactivateGroupResourceAssignmentvoid deactivateGroupResourceAssignment(PerunSession session, Group group, Resource resource) throws PrivilegeException, ResourceNotExistsException, GroupNotExistsException, GroupNotDefinedOnResourceException, GroupResourceStatusException Deactivates the group-resource assignment. The assignment will become INACTIVE and will not be used to allow users from the given group to the resource.- Parameters:
- group- group
- resource- resource
- Throws:
- PrivilegeException- insufficient permissions
- GroupNotExistsException- when the group doesn't exist
- ResourceNotExistsException- when the resource doesn't exist
- GroupNotDefinedOnResourceException- when the group-resource assignment doesn't exist
- GroupResourceStatusException- when trying to deactivate an assignment in PROCESSING state
 
- 
deleteAllResourcesvoid deleteAllResources(PerunSession perunSession, Vo vo) throws VoNotExistsException, PrivilegeException, ResourceAlreadyRemovedException, GroupAlreadyRemovedFromResourceException Deletes all resources for the VO.- Parameters:
- perunSession-
- vo-
- Throws:
- InternalErrorException
- ResourceNotExistsException
- 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
 
- 
deleteAllResourcesTagsForVovoid deleteAllResourcesTagsForVo(PerunSession perunSession, Vo vo) throws ResourceTagAlreadyAssignedException, PrivilegeException, VoNotExistsException Delete all ResourcesTags for specific VO.- Parameters:
- perunSession-
- vo-
- Throws:
- InternalErrorException
- PrivilegeException
- ResourceTagAlreadyAssignedException
- VoNotExistsException- ¨
 
- 
deleteResourcevoid deleteResource(PerunSession perunSession, Resource resource) throws ResourceNotExistsException, PrivilegeException, ResourceAlreadyRemovedException, GroupAlreadyRemovedFromResourceException, FacilityNotExistsException Deletes resource by id.- Parameters:
- perunSession-
- resource-
- Throws:
- InternalErrorException
- 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
 
- 
deleteResourceTagvoid deleteResourceTag(PerunSession perunSession, ResourceTag resourceTag) throws PrivilegeException, ResourceTagAlreadyAssignedException, VoNotExistsException, ResourceTagNotExistsException Delete existing Resource tag.- Parameters:
- perunSession-
- resourceTag-
- Throws:
- InternalErrorException
- PrivilegeException
- VoNotExistsException
- ResourceTagAlreadyAssignedException
- ResourceTagNotExistsException
 
- 
getAdminGroups@Deprecated List<Group> getAdminGroups(PerunSession sess, Resource resource) throws PrivilegeException, ResourceNotExistsException Deprecated.Gets list of all group administrators of the Resource.- Parameters:
- sess-
- resource-
- Returns:
- list of Group that are admins in the resource.
- Throws:
- InternalErrorException
- PrivilegeException
- ResourceNotExistsException
 
- 
getAdmins@Deprecated List<User> getAdmins(PerunSession perunSession, Resource resource, boolean onlyDirectAdmins) throws PrivilegeException, ResourceNotExistsException Deprecated.Gets list of all user administrators of the Resource. If some group is administrator of the given resource, all VALID members are included in the list.If onlyDirectAdmins is true, return only direct users of the group for supported role. Supported roles: ResourceAdmin, VOAdmin - 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:
- InternalErrorException
- PrivilegeException
- ResourceNotExistsException
 
- 
getAllResourcesGet all resources from database. Returned resources are filtered based on the principal rights.- Parameters:
- sess- Perun session
- Returns:
- list of all resources
- Throws:
- PrivilegeException- if the principal has insufficient permission
 
- 
getAllResourcesByResourceTagList<Resource> getAllResourcesByResourceTag(PerunSession perunSession, ResourceTag resourceTag) throws PrivilegeException, VoNotExistsException, ResourceTagNotExistsException Get all resources in specific Vo (specific by resourceTag.getVoId) for existing resourceTag- Parameters:
- perunSession-
- resourceTag-
- Returns:
- list of Resources
- Throws:
- InternalErrorException
- PrivilegeException
- VoNotExistsException
- ResourceTagNotExistsException- ¨
 
- 
getAllResourcesTagsForResourceList<ResourceTag> getAllResourcesTagsForResource(PerunSession perunSession, Resource resource) throws ResourceNotExistsException, PrivilegeException Get all resourcesTags for existing Resource- Parameters:
- perunSession-
- resource-
- Returns:
- list of ResourcesTags
- Throws:
- InternalErrorException
- ResourceNotExistsException
- PrivilegeException
 
- 
getAllResourcesTagsForVoList<ResourceTag> getAllResourcesTagsForVo(PerunSession perunSession, Vo vo) throws PrivilegeException, VoNotExistsException Get all resourcesTags for existing Vo.- Parameters:
- perunSession-
- vo-
- Returns:
- list of all resourcesTags for existing Vo
- Throws:
- InternalErrorException
- PrivilegeException
- VoNotExistsException- ¨
 
- 
getAllowedMembersList<Member> getAllowedMembers(PerunSession perunSession, Resource resource) throws ResourceNotExistsException, PrivilegeException Returns all members assigned to the resource.- Parameters:
- perunSession-
- resource-
- Returns:
- list of members assigned to the resource
- Throws:
- InternalErrorException
- ResourceNotExistsException
- PrivilegeException
 
- 
getAllowedResourcesList<Resource> getAllowedResources(PerunSession sess, Member member) throws MemberNotExistsException, PrivilegeException Get all resources which have the member access on.- Parameters:
- sess-
- member-
- Returns:
- list of resources which have the member acess on
- Throws:
- InternalErrorException
- PrivilegeException
- MemberNotExistsException
 
- 
getAllowedUsersList<User> getAllowedUsers(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Returns all users who is assigned with the resource.- Parameters:
- sess-
- resource-
- Returns:
- list of users
- Throws:
- InternalErrorException
- ResourceNotExistsException
- PrivilegeException
 
- 
getAssignedGroupsList<Group> getAssignedGroups(PerunSession perunSession, Resource resource) throws PrivilegeException, ResourceNotExistsException List all groups associated with the resource.- Parameters:
- perunSession-
- resource-
- Returns:
- list of assigned group
- Throws:
- InternalErrorException
- ResourceNotExistsException
- PrivilegeException
 
- 
getAssignedGroupsList<Group> getAssignedGroups(PerunSession perunSession, Resource resource, Member member) throws PrivilegeException, ResourceNotExistsException, MemberNotExistsException List all groups associated with the resource and member- Parameters:
- perunSession-
- resource-
- member-
- Returns:
- list of assigned groups associated with the resource and member
- Throws:
- InternalErrorException
- ResourceNotExistsException
- PrivilegeException
- MemberNotExistsException
 
- 
getAssignedMembersReturns all members assigned to the resource.- Parameters:
- sess-
- resource-
- Returns:
- list of assigned members
- Throws:
- InternalErrorException
- PrivilegeException
 
- 
getAssignedMembersWithStatusList<AssignedMember> getAssignedMembersWithStatus(PerunSession sess, Resource resource) throws PrivilegeException Returns members of groups assigned to resource with status of group-resource assignment.- Parameters:
- sess- perunSession
- resource- resource
- Returns:
- list of members of groups assigned to given resource
- Throws:
- PrivilegeException
 
- 
getAssignedResourcesList<Resource> getAssignedResources(PerunSession perunSession, Group group) throws GroupNotExistsException, PrivilegeException List all resources to which the group is assigned.- Parameters:
- perunSession-
- group-
- Returns:
- list of assigned resources
- Throws:
- InternalErrorException
- GroupNotExistsException
- PrivilegeException
 
- 
getAssignedResourcesList<Resource> getAssignedResources(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Get all resources where the member is assigned.- Parameters:
- sess-
- member-
- Returns:
- Throws:
- InternalErrorException
- MemberNotExistsException
- PrivilegeException
 
- 
getAssignedResourcesList<Resource> getAssignedResources(PerunSession sess, Member member, Service service) throws PrivilegeException, MemberNotExistsException, ServiceNotExistsException Get all resources where the member and the service are assigned.- Parameters:
- sess-
- member-
- service-
- Returns:
- list of resources
- Throws:
- InternalErrorException
- MemberNotExistsException
- ServiceNotExistsException
- PrivilegeException
 
- 
getAssignedResourcesWithStatusList<AssignedResource> getAssignedResourcesWithStatus(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Returns all assigned resources where member is assigned through the groups.- Parameters:
- sess- perun session
- member- member
- Returns:
- list of assigned resources
- Throws:
- MemberNotExistsException- if the member does not exist
- PrivilegeException
 
- 
getAssignedRichMembersList<RichMember> getAssignedRichMembers(PerunSession sess, Resource resource) throws PrivilegeException Returns all members assigned to the resource as RichMembers.- Parameters:
- sess-
- resource-
- Returns:
- list of assigned rich members
- Throws:
- InternalErrorException
- PrivilegeException
 
- 
getAssignedRichResourcesList<RichResource> getAssignedRichResources(PerunSession perunSession, Group group) throws GroupNotExistsException, PrivilegeException List all rich resources associated with the group with facility property filled.- Parameters:
- perunSession-
- group-
- Returns:
- list of assigned rich resources
- Throws:
- InternalErrorException
- GroupNotExistsException
- PrivilegeException
 
- 
getAssignedRichResourcesList<RichResource> getAssignedRichResources(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Get all rich resources where the member is assigned with facility property filled.- Parameters:
- sess-
- member-
- Returns:
- list of rich resources
- Throws:
- InternalErrorException
- MemberNotExistsException
- PrivilegeException
 
- 
getAssignedRichResourcesList<RichResource> getAssignedRichResources(PerunSession sess, Member member, Service service) throws PrivilegeException, MemberNotExistsException, ServiceNotExistsException Get all rich resources where the service and the member are assigned with facility property filled.- Parameters:
- sess-
- member-
- service-
- Returns:
- list of rich resources
- Throws:
- InternalErrorException
- MemberNotExistsException
- ServiceNotExistsException
- PrivilegeException
 
- 
getAssignedServicesList<Service> getAssignedServices(PerunSession perunSession, Resource resource) throws ResourceNotExistsException, PrivilegeException List all services associated with the resource.- Parameters:
- perunSession-
- resource-
- Returns:
- list of assigned resources
- Throws:
- InternalErrorException
- ResourceNotExistsException
- PrivilegeException
 
- 
getBanBanOnResource getBan(PerunSession sess, int memberId, int resourceId) throws BanNotExistsException, PrivilegeException, MemberNotExistsException, ResourceNotExistsException Get ban by memberId and resource id- Parameters:
- sess-
- memberId- the id of member
- resourceId- the id of resource
- Returns:
- specific ban for member on resource
- Throws:
- InternalErrorException
- BanNotExistsException
- PrivilegeException
- MemberNotExistsException
- ResourceNotExistsException
 
- 
getBanByIdBanOnResource getBanById(PerunSession sess, int banId) throws BanNotExistsException, PrivilegeException, ResourceNotExistsException Get Ban for member on resource by it's id- Parameters:
- sess-
- banId- the id of ban
- Returns:
- resource ban by it's id
- Throws:
- InternalErrorException
- BanNotExistsException
- ResourceNotExistsException
- PrivilegeException
 
- 
getBansForMemberList<BanOnResource> getBansForMember(PerunSession sess, int memberId) throws MemberNotExistsException, ResourceNotExistsException Get all bans for member on any resource.- Parameters:
- sess-
- memberId- the id of member
- Returns:
- list of bans for member on any resource
- Throws:
- InternalErrorException
- MemberNotExistsException
- ResourceNotExistsException
 
- 
getBansForResourceList<BanOnResource> getBansForResource(PerunSession sess, int resourceId) throws PrivilegeException, ResourceNotExistsException Get all bans for members on the resource.- Parameters:
- sess-
- resourceId- the id of resource
- Returns:
- list of all members bans on the resource
- Throws:
- InternalErrorException
- PrivilegeException
- ResourceNotExistsException
 
- 
getEnrichedBansForResourceList<EnrichedBanOnResource> getEnrichedBansForResource(PerunSession sess, int resourceId, List<String> attrNames) throws PrivilegeException, ResourceNotExistsException, AttributeNotExistsException Get all enriched bans for members on the resource.- 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
 
- 
getEnrichedBansForUserList<EnrichedBanOnResource> getEnrichedBansForUser(PerunSession sess, int userId, List<String> attrNames) throws PrivilegeException, UserNotExistsException, AttributeNotExistsException Get all enriched bans on resources for user.- 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
 
- 
getEnrichedResourceByIdEnrichedResource getEnrichedResourceById(PerunSession sess, int id, List<String> attrNames) throws PrivilegeException, ResourceNotExistsException Find resource for given id and returns it with given attributes. If attrNames are null or empty, all resource attributes are returned.- 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
 
- 
getEnrichedResourcesForFacilityList<EnrichedResource> getEnrichedResourcesForFacility(PerunSession sess, Facility facility, List<String> attrNames) throws FacilityNotExistsException, PrivilegeException Find resources for given facility and attributes for given names. If the attrNames are empty or null, return all attributes.- 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
 
- 
getEnrichedResourcesForVoList<EnrichedResource> getEnrichedResourcesForVo(PerunSession sess, Vo vo, List<String> attrNames) throws VoNotExistsException, PrivilegeException Find resources for given vo and attributes for given names. If the attrNames are empty or null, return all attributes.- 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
 
- 
getFacilityFacility getFacility(PerunSession perunSession, Resource resource) throws ResourceNotExistsException, PrivilegeException Get facility which belongs to the concrete resource.- Parameters:
- perunSession-
- resource-
- Returns:
- facility belonging to the resource
- Throws:
- InternalErrorException
- ResourceNotExistsException
- PrivilegeException
 
- 
getGroupAssignmentsList<AssignedGroup> getGroupAssignments(PerunSession session, Resource resource, List<String> attrNames) throws PrivilegeException, ResourceNotExistsException Lists 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.- Parameters:
- session-
- 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
 
- 
getMailingServiceRichResourcesWithMemberList<RichResource> getMailingServiceRichResourcesWithMember(PerunSession perunSession, Member member) throws MemberNotExistsException, PrivilegeException Return all rich resources with mailing service(s) where given member is assigned.- Parameters:
- perunSession- session
- member- member
- Returns:
- list of corresponding rich resources
- Throws:
- MemberNotExistsException- if member is not present (does not exist)
- PrivilegeException
 
- 
getResourceAssignmentsList<AssignedResource> getResourceAssignments(PerunSession session, Group group, List<String> attrNames) throws PrivilegeException, GroupNotExistsException Lists 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.- Parameters:
- session- 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
 
- 
getResourceByIdResource getResourceById(PerunSession perunSession, int id) throws PrivilegeException, ResourceNotExistsException Searches for the Resource with specified id.- Parameters:
- perunSession-
- id-
- Returns:
- Resource with specified id
- Throws:
- ResourceNotExistsException
- InternalErrorException
- PrivilegeException
 
- 
getResourceByNameResource getResourceByName(PerunSession sess, Vo vo, Facility facility, String name) throws ResourceNotExistsException, PrivilegeException, VoNotExistsException, FacilityNotExistsException Return resource by its name.- Parameters:
- sess-
- vo-
- facility-
- name-
- Returns:
- resource
- Throws:
- InternalErrorException
- ResourceNotExistsException
- PrivilegeException
- VoNotExistsException
- FacilityNotExistsException
 
- 
getResourcesList<Resource> getResources(PerunSession perunSession, Vo vo) throws PrivilegeException, VoNotExistsException Get all VO resources. If called by resourceAdmin it returns only those resources of which is he admin.- Parameters:
- perunSession-
- vo-
- Returns:
- list of resources
- Throws:
- InternalErrorException
- VoNotExistsException
- PrivilegeException
 
- 
getResourcesByIdsList<Resource> getResourcesByIds(PerunSession perunSession, List<Integer> ids) throws PrivilegeException Search for the Resources with specific ids.- Parameters:
- perunSession-
- ids-
- Returns:
- Resources with specified ids
- Throws:
- InternalErrorException
- PrivilegeException
 
- 
getResourcesCountint getResourcesCount(PerunSession perunSession, Vo vo) throws PrivilegeException, VoNotExistsException Get all VO resources count.- Parameters:
- perunSession-
- vo-
- Returns:
- count of vo resources
- Throws:
- InternalErrorException
- VoNotExistsException
- PrivilegeException
 
- 
getResourcesCountGet count of all resources.- Parameters:
- perunSession-
- Returns:
- count of all resources
- Throws:
- InternalErrorException
 
- 
getResourcesWhereGroupIsAdminList<Resource> getResourcesWhereGroupIsAdmin(PerunSession sess, Facility facility, Vo vo, Group authorizedGroup) throws PrivilegeException, GroupNotExistsException, FacilityNotExistsException, VoNotExistsException Return all resources for the facility and the vo where the group is authorized as resource manager.- Parameters:
- sess-
- facility- the facility to which resources should be assigned 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:
- InternalErrorException
- PrivilegeException
- GroupNotExistsException
- FacilityNotExistsException
- VoNotExistsException
 
- 
getResourcesWhereUserIsAdminList<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, User user) throws UserNotExistsException, PrivilegeException Returns list of resources, where the user is an admin. Including resources, where the user is a VALID member of authorized group.- Parameters:
- sess-
- user-
- Returns:
- list of resources, where the user is an admin.
- Throws:
- InternalErrorException
- PrivilegeException
- UserNotExistsException
 
- 
getResourcesWhereUserIsAdminList<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, Facility facility, Vo vo, User authorizedUser) throws PrivilegeException, UserNotExistsException, FacilityNotExistsException, VoNotExistsException Return all resources for the facility and the vo where user is authorized as resource manager. Including resources, where the user is a VALID member of authorized group.- Parameters:
- sess-
- facility- the facility to which resources should be assigned 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:
- InternalErrorException
- PrivilegeException
- UserNotExistsException
- FacilityNotExistsException
- VoNotExistsException
 
- 
getResourcesWhereUserIsAdminList<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, Vo vo, User authorizedUser) throws PrivilegeException, UserNotExistsException, VoNotExistsException Return all resources for the vo where user is authorized as resource manager. Including resources, where the user is a VALID member of authorized group.- Parameters:
- sess-
- vo- the vo to which resources should be assigned to
- authorizedUser- user with resource manager role for all those resources
- Returns:
- list of defined resources where user has role resource manager
- Throws:
- InternalErrorException
- PrivilegeException
- UserNotExistsException
- VoNotExistsException
 
- 
getRichAdmins@Deprecated List<RichUser> getRichAdmins(PerunSession perunSession, Resource resource, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) throws UserNotExistsException, PrivilegeException, ResourceNotExistsException Deprecated.Gets 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. - 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:
- InternalErrorException
- PrivilegeException
- UserNotExistsException
- ResourceNotExistsException
 
- 
getRichResourceByIdRichResource getRichResourceById(PerunSession perunSession, int id) throws PrivilegeException, ResourceNotExistsException Search for the RichResource with specific id.- Parameters:
- perunSession-
- id-
- Returns:
- RichResource with specified id
- Throws:
- InternalErrorException
- PrivilegeException
- ResourceNotExistsException
 
- 
getRichResourcesList<RichResource> getRichResources(PerunSession perunSession, Vo vo) throws PrivilegeException, VoNotExistsException Get all VO rich resources with facility property filled. If called by resourceAdmin it returns only those resources of which is he admin.- Parameters:
- perunSession-
- vo-
- Returns:
- list of rich resources
- Throws:
- InternalErrorException
- VoNotExistsException
- PrivilegeException
 
- 
getRichResourcesByIdsList<RichResource> getRichResourcesByIds(PerunSession perunSession, List<Integer> ids) throws PrivilegeException Search for the RichResources with specific ids.- Parameters:
- perunSession-
- ids-
- Returns:
- RichResources with specified ids
- Throws:
- InternalErrorException
- PrivilegeException
 
- 
getVoVo getVo(PerunSession perunSession, Resource resource) throws ResourceNotExistsException, PrivilegeException Get Vo which is tied to specified resource.- Parameters:
- perunSession-
- resource-
- Returns:
- vo tied to specified resource
- Throws:
- InternalErrorException
- ResourceNotExistsException
- PrivilegeException
 
- 
isResourceLastAssignedServicesList<Service> isResourceLastAssignedServices(PerunSession sess, Resource resource, List<Service> services) throws FacilityNotExistsException, ResourceNotExistsException, ServiceNotExistsException, PrivilegeException Checks whether the resource is the last one on the facility to have the provided services assigned. Returns the services where this is the case.- Parameters:
- sess-
- resource-
- services-
- Returns:
- list of services where the provided resource is last to have them assigned on its facility.
- Throws:
- FacilityNotExistsException
- ResourceNotExistsException
- ServiceNotExistsException
- PrivilegeException
 
- 
removeAdminvoid removeAdmin(PerunSession sess, Resource resource, User user) throws UserNotExistsException, PrivilegeException, UserNotAdminException, ResourceNotExistsException, RoleCannotBeManagedException Remove role resource admin from user for the selected resource.- Parameters:
- sess-
- resource-
- user-
- Throws:
- InternalErrorException
- UserNotExistsException
- PrivilegeException
- AlreadyAdminException
- ResourceNotExistsException
- UserNotAdminException
- RoleCannotBeManagedException
 
- 
removeAdminvoid removeAdmin(PerunSession sess, Resource resource, Group group) throws GroupNotExistsException, PrivilegeException, GroupNotAdminException, ResourceNotExistsException, RoleCannotBeManagedException Remove role resource admin from group for the selected resource.- Parameters:
- sess-
- resource-
- group-
- Throws:
- InternalErrorException
- GroupNotExistsException
- PrivilegeException
- GroupNotAdminException
- ResourceNotExistsException
- RoleCannotBeManagedException
 
- 
removeAllResourcesTagFromResourcevoid removeAllResourcesTagFromResource(PerunSession perunSession, Resource resource) throws PrivilegeException, ResourceNotExistsException Remove all Resource tags for specific resource.- Parameters:
- perunSession-
- resource-
- Throws:
- InternalErrorException
- PrivilegeException
- ResourceNotExistsException
 
- 
removeBanvoid removeBan(PerunSession sess, int banId) throws PrivilegeException, BanNotExistsException, ResourceNotExistsException Remove specific ban by it's id.- Parameters:
- sess-
- banId- the id of ban
- Throws:
- InternalErrorException
- PrivilegeException
- BanNotExistsException
- ResourceNotExistsException
 
- 
removeBanvoid removeBan(PerunSession sess, int memberId, int resourceId) throws BanNotExistsException, PrivilegeException, ResourceNotExistsException Remove specific ban by memberId and resourceId.- Parameters:
- sess-
- memberId- the id of member
- resourceId- the id of resource
- Throws:
- InternalErrorException
- BanNotExistsException
- ResourceNotExistsException
- PrivilegeException
 
- 
removeGroupFromResourcevoid removeGroupFromResource(PerunSession perunSession, Group group, Resource resource) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, GroupNotDefinedOnResourceException, GroupAlreadyRemovedFromResourceException Remove group from a resource. After removing, check attributes and fix them if it is needed.- Parameters:
- perunSession-
- group-
- resource-
- Throws:
- InternalErrorException- Raise when group and resource not belong to the same VO or cant properly fix attributes of group's members after removing group from resource.
- ResourceNotExistsException
- PrivilegeException
- GroupNotDefinedOnResourceException- Group was never assigned to this resource
- GroupAlreadyRemovedFromResourceException- if there are 0 rows affected by deleting from DB
- GroupNotExistsException
 
- 
removeGroupFromResourcesvoid removeGroupFromResources(PerunSession perunSession, Group groups, List<Resource> resources) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, GroupNotDefinedOnResourceException, GroupAlreadyRemovedFromResourceException Remove group from the resources. After removing, check attributes and fix them if it is needed.- Parameters:
- perunSession-
- groups- list of groups
- resources- list of resources
- Throws:
- InternalErrorException
- PrivilegeException
- GroupNotExistsException
- ResourceNotExistsException
- GroupNotDefinedOnResourceException
- GroupAlreadyRemovedFromResourceException
 
- 
removeGroupsFromResourcevoid removeGroupsFromResource(PerunSession perunSession, List<Group> groups, Resource resource) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, GroupNotDefinedOnResourceException, GroupAlreadyRemovedFromResourceException Remove groups from a resource. After removing, check attributes and fix them if it is needed.- Parameters:
- perunSession-
- groups- list of groups
- resource-
- Throws:
- InternalErrorException
- PrivilegeException
- GroupNotExistsException
- ResourceNotExistsException
- GroupNotDefinedOnResourceException
- GroupAlreadyRemovedFromResourceException
 
- 
removeResourceSelfServiceGroupvoid removeResourceSelfServiceGroup(PerunSession sess, Resource resource, Group group) throws PrivilegeException, GroupNotAdminException, ResourceNotExistsException, GroupNotExistsException Unset ResourceSelfService role to given group for given resource.- Parameters:
- sess- session
- resource- resource
- group- group
- Throws:
- InternalErrorException- internal error
- PrivilegeException- insufficient permissions
- GroupNotAdminException- group did not have the role
- ResourceNotExistsException
- GroupNotExistsException
 
- 
removeResourceSelfServiceUservoid removeResourceSelfServiceUser(PerunSession sess, Resource resource, User user) throws PrivilegeException, UserNotAdminException, ResourceNotExistsException, UserNotExistsException Unset ResourceSelfService role to given user for given resource.- Parameters:
- sess- session
- resource- resource
- user- user
- Throws:
- InternalErrorException- internal error
- PrivilegeException- insufficient permissions
- UserNotAdminException- user did not have the role
- ResourceNotExistsException
- UserNotExistsException
 
- 
removeResourceTagFromResourcevoid removeResourceTagFromResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagNotAssignedException Remove specific ResourceTag from existing Resource.- Parameters:
- perunSession-
- resourceTag-
- resource-
- Throws:
- InternalErrorException
- PrivilegeException
- ResourceTagNotExistsException
- ResourceNotExistsException
- ResourceTagNotAssignedException
 
- 
removeResourceTagsFromResourcevoid removeResourceTagsFromResource(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagNotAssignedException Remove specific ResourceTags from existing Resource.- Parameters:
- perunSession-
- resourceTags-
- resource-
- Throws:
- InternalErrorException
- PrivilegeException
- ResourceTagNotExistsException
- ResourceNotExistsException
- ResourceTagNotAssignedException
 
- 
removeServicevoid removeService(PerunSession perunSession, Resource resource, Service service) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceNotAssignedException Remove service from resource.- Parameters:
- perunSession-
- resource-
- service-
- Throws:
- InternalErrorException
- ResourceNotExistsException
- PrivilegeException
- ServiceNotExistsException
- ServiceNotAssignedException
 
- 
removeServicevoid removeService(PerunSession perunSession, List<Resource> resources, Service service) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceNotAssignedException, FacilityNotExistsException, FacilityMismatchException Remove service from multiple resources in the same facility- Parameters:
- perunSession-
- resources-
- service-
- Throws:
- PrivilegeException
- ResourceNotExistsException
- ServiceNotExistsException
- ServiceNotAssignedException
- FacilityMismatchException
- FacilityNotExistsException
 
- 
removeServicesvoid removeServices(PerunSession perunSession, Resource resource, List<Service> services, boolean removeTasks, boolean removeTaskResults, boolean removeDestinations) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceNotAssignedException, FacilityNotExistsException Remove 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.- Parameters:
- perunSession-
- resource-
- services-
- removeTasks-
- removeTaskResults-
- removeDestinations-
- Throws:
- InternalErrorException
- ResourceNotExistsException
- PrivilegeException
- ServiceNotExistsException
- ServiceNotAssignedException
- FacilityNotExistsException
 
- 
setBanBanOnResource setBan(PerunSession sess, BanOnResource banOnResource) throws PrivilegeException, BanAlreadyExistsException, ResourceNotExistsException Set ban for member on resource.- Parameters:
- sess-
- banOnResource- the ban
- Returns:
- ban on resource
- Throws:
- InternalErrorException
- PrivilegeException
- BanAlreadyExistsException
- ResourceNotExistsException
 
- 
updateBanBanOnResource updateBan(PerunSession sess, BanOnResource banOnResource) throws PrivilegeException, MemberNotExistsException, BanNotExistsException, ResourceNotExistsException Update existing ban (description, validation timestamp)- Parameters:
- sess-
- banOnResource- the specific ban
- Returns:
- updated ban
- Throws:
- InternalErrorException
- PrivilegeException
- MemberNotExistsException
- BanNotExistsException
- ResourceNotExistsException
 
- 
updateResourceResource updateResource(PerunSession perunSession, Resource resource) throws ResourceNotExistsException, PrivilegeException, ResourceExistsException Updates Resource.- Parameters:
- perunSession-
- resource-
- Returns:
- returns updated Resource
- Throws:
- ResourceNotExistsException
- ResourceExistsException
- PrivilegeException
- InternalErrorException
 
- 
updateResourceTagResourceTag updateResourceTag(PerunSession perunSession, ResourceTag resourceTag) throws PrivilegeException, ResourceTagNotExistsException, VoNotExistsException Update existing Resource tag.- Parameters:
- perunSession-
- resourceTag-
- Returns:
- updated ResourceTag
- Throws:
- InternalErrorException
- PrivilegeException
- ResourceTagNotExistsException
- VoNotExistsException
 
 
-