Interface ResourcesManagerImplApi

All Known Implementing Classes:
ResourcesManagerImpl

public interface ResourcesManagerImplApi
Manages resources.
Author:
Slavek Licehammer
  • Method Details

    • assignAutomaticGroupToResource

      void assignAutomaticGroupToResource(PerunSession perunSession, Group group, Resource resource, Group sourceGroup) throws GroupAlreadyAssignedException
      Assign group to a resource (automatic subgroup assignment).
      Parameters:
      perunSession -
      group -
      resource -
      sourceGroup -
      Throws:
      InternalErrorException
      GroupAlreadyAssignedException
    • assignGroupToResource

      void assignGroupToResource(PerunSession perunSession, Group group, Resource resource, boolean autoAssignSubgroups) throws GroupAlreadyAssignedException
      Assign group to a resource.
      Parameters:
      perunSession -
      group -
      resource -
      autoAssignSubgroups -
      Throws:
      InternalErrorException
      GroupAlreadyAssignedException
    • assignGroupToResourceState

      void assignGroupToResourceState(PerunSession perunSession, Group group, Resource resource, GroupResourceStatus status)
      Set initial status to group-resource assignment.
      Parameters:
      perunSession -
      group -
      resource -
      status - Status of the group-resource assignment
    • assignResourceTagToResource

      void assignResourceTagToResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource)
      Assign existing ResourceTag on existing Resource.
      Parameters:
      perunSession -
      resource -
      Throws:
      InternalErrorException
    • assignService

      void assignService(PerunSession perunSession, Resource resource, Service service) throws ServiceAlreadyAssignedException
      Assign service to resource.
      Parameters:
      perunSession -
      resource -
      service -
      Throws:
      InternalErrorException
      ServiceAlreadyAssignedException
    • banExists

      boolean banExists(PerunSession sess, int memberId, int resourceId)
      Get true if any ban for member and resource exists.
      Parameters:
      sess -
      memberId - id of member
      resourceId - id of resource
      Returns:
      true if ban exists
      Throws:
      InternalErrorException
    • banExists

      boolean banExists(PerunSession sess, int banId)
      Get true if any band defined by id exists for any member and resource.
      Parameters:
      sess -
      banId - id of ban
      Returns:
      true if ban exists
      Throws:
      InternalErrorException
    • checkResourceExists

      void checkResourceExists(PerunSession perunSession, Resource resource) throws ResourceNotExistsException
      Check if resource exists in underlaying data source.
      Parameters:
      perunSession -
      resource -
      Throws:
      InternalErrorException
      ResourceNotExistsException
    • checkResourceTagExists

      void checkResourceTagExists(PerunSession sess, ResourceTag resourceTag) throws ResourceTagNotExistsException
      Check if resource tag exists in underlaying data source.
      Parameters:
      sess -
      resourceTag -
      Throws:
      InternalErrorException
      ResourceTagNotExistsException
    • createResource

      Resource createResource(PerunSession perunSession, Vo vo, Resource resource, Facility facility)
      Creates the resource. This methods sets ids and uuid to the given resource object but returns a new resource object loaded from db.
      Parameters:
      perunSession -
      vo -
      resource -
      facility -
      Returns:
      newly created resource with id
      Throws:
      InternalErrorException
    • createResourceTag

      ResourceTag createResourceTag(PerunSession perunSession, ResourceTag resourceTag, Vo vo)
      Create new Resource tag.
      Parameters:
      perunSession -
      resourceTag -
      vo -
      Returns:
      new created resourceTag
      Throws:
      InternalErrorException
    • deleteAllResourcesTagsForVo

      void deleteAllResourcesTagsForVo(PerunSession perunSession, Vo vo)
      Delete all ResourcesTags for specific VO.
      Parameters:
      perunSession -
      vo -
      Throws:
      InternalErrorException
    • deleteResource

      void deleteResource(PerunSession perunSession, Vo vo, Resource resource) throws ResourceAlreadyRemovedException
      Deletes resource by id.
      Parameters:
      perunSession -
      vo -
      resource -
      Throws:
      InternalErrorException
      ResourceAlreadyRemovedException - if there are 0 rows affected by deleting from DB
    • deleteResourceTag

      void deleteResourceTag(PerunSession perunSession, ResourceTag resourceTag)
      Delete existing Resource tag.
      Parameters:
      perunSession -
      resourceTag -
      Throws:
      InternalErrorException
    • getAdminGroups

      List<Group> getAdminGroups(PerunSession sess, Resource resource)
      Gets list of all group administrators of the Resource.
      Parameters:
      sess -
      resource -
      Returns:
      list of groups who are admins in the resource
      Throws:
      InternalErrorException
    • getAdmins

      List<User> getAdmins(PerunSession sess, Resource resource)
      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.
      Parameters:
      sess -
      resource -
      Returns:
      list of users who are admins in the resource
      Throws:
      InternalErrorException
    • getAllExpiredBansOnResources

      List<BanOnResource> getAllExpiredBansOnResources(PerunSession sess)
      Get all expired bans on any resource to now date
      Parameters:
      sess -
      Returns:
      list of expired bans for any resource
      Throws:
      InternalErrorException
    • getAllResources

      List<Resource> getAllResources(PerunSession sess)
      Get all resources from database.
      Parameters:
      sess - Perun session
      Returns:
      list of all resources
    • getAllResourcesByResourceTag

      List<Resource> getAllResourcesByResourceTag(PerunSession perunSession, ResourceTag resourceTag)
      Get all resources in specific Vo (specific by resourceTag.getVoId) for existing resourceTag
      Parameters:
      perunSession -
      resourceTag -
      Returns:
      list of Resources
      Throws:
      InternalErrorException
    • getAllResourcesTagsForResource

      List<ResourceTag> getAllResourcesTagsForResource(PerunSession perunSession, Resource resource)
      Get all resourcesTags for existing Resource
      Parameters:
      perunSession -
      resource -
      Returns:
      list of ResourcesTags
      Throws:
      InternalErrorException
    • getAllResourcesTagsForVo

      List<ResourceTag> getAllResourcesTagsForVo(PerunSession perunSession, Vo vo)
      Get all resourcesTags for existing Vo.
      Parameters:
      perunSession -
      vo -
      Returns:
      list of all resourcesTags for existing Vo
      Throws:
      InternalErrorException
    • getAllowedMembers

      List<Member> getAllowedMembers(PerunSession sess, Resource resource)
      Returns all allowed members on the resource. Allowed members belong to a group with an active assignment to the resource and their VO membership status is not INVALID or DISABLED.
      Parameters:
      sess -
      resource -
      Returns:
      list of allowed members on the resource
      Throws:
      InternalErrorException
    • getAllowedMembersNotExpiredInGroup

      List<Member> getAllowedMembersNotExpiredInGroup(PerunSession sess, Resource resource)
      Returns all allowed members on the resource who are not expired in groups.

      Allowed members belong to a group with an active assignment to the resource and their VO membership status is not INVALID or DISABLED. On top of that, only members with a VALID group membership status in at least one group assigned to the resource are included.

      Parameters:
      sess -
      resource -
      Returns:
      list of allowed members not expired in groups on the resource
      Throws:
      InternalErrorException
    • getAllowedResources

      List<Resource> getAllowedResources(PerunSession sess, Facility facility, User user)
      Get all resources on the facility where the user is allowed. The user has a membership in a group with an active assignment to the resource and their VO membership status is not INVALID or DISABLED.
      Parameters:
      sess -
      facility -
      user -
      Returns:
      list of resources where the user is allowed
      Throws:
      InternalErrorException
    • getAllowedUsers

      List<User> getAllowedUsers(PerunSession sess, Resource resource)
      Get all allowed users on the resource. Allowed users are members of a group with an active assignment to the resource and their VO membership status is not INVALID or DISABLED.
      Parameters:
      sess -
      resource -
      Returns:
      list of allowed users on the resource
      Throws:
      InternalErrorException
    • getAllowedUsersNotExpiredInGroup

      List<User> getAllowedUsersNotExpiredInGroup(PerunSession sess, Resource resource)
      Get all allowed users on the resource who are not expired in groups.

      Allowed users are members of a group with an active assignment to the resource and their VO membership status is not INVALID or DISABLED. On top of that, only users with a VALID group membership status in at least one group assigned to the resource are included.

      Parameters:
      sess -
      resource -
      Returns:
      list of allowed users not expired in groups on the resource
      Throws:
      InternalErrorException
    • getAssignedMembers

      List<Member> getAssignedMembers(PerunSession sess, Resource resource)
      Returns all assigned members on the resource. Assigned members belong to a group with an active assignment to the resource. No filter is applied on their VO membership status.
      Parameters:
      sess -
      resource -
      Returns:
      list of assigned members on the resource
      Throws:
      InternalErrorException
    • getAssignedMembersWithStatus

      List<AssignedMember> getAssignedMembersWithStatus(PerunSession sess, Resource resource)
      Returns all members of groups with a group-resource assignment to the resource, annotated with the assignment status. Assignments in any state are included (not only ACTIVE). RichMember attribute has only Member set.
      Parameters:
      sess - perunSession
      resource - resource
      Returns:
      list of members of groups assigned to given resource with assignment status
    • getAssignedResources

      List<Resource> getAssignedResources(PerunSession perunSession, Group group)
      List all resources to which the group is assigned.
      Parameters:
      perunSession -
      group -
      Returns:
      list of assigned resources
      Throws:
      InternalErrorException
    • getAssignedResources

      List<Resource> getAssignedResources(PerunSession sess, Member member)
      Returns all resources where the member is assigned. The member belongs to a group with an active assignment to the resource. No filter is applied on their VO membership status.
      Parameters:
      sess -
      member -
      Returns:
      list of resources where the member is assigned
      Throws:
      InternalErrorException
    • getAssignedResources

      List<Resource> getAssignedResources(PerunSession sess, Member member, Service service)
      Returns all resources where the member is assigned. The member belongs to a group with an active assignment to the resource. On top of that, results are restricted to resources with the given service assigned. No filter is applied on their VO membership status.
      Parameters:
      sess -
      member -
      service -
      Returns:
      list of resources where the member is assigned that have the given service
      Throws:
      InternalErrorException
    • getAssignedResources

      List<Resource> getAssignedResources(PerunSession sess, User user, Vo vo)
      Returns all resources where the user is assigned. The user has a membership in a group with an active assignment to the resource. On top of that, results are restricted to resources in the given VO. No filter is applied on VO membership status.
      Parameters:
      sess -
      user -
      vo -
      Returns:
      list of resources in the VO where the user is assigned
      Throws:
      InternalErrorException
      See Also:
    • getAssignedResourcesWithStatus

      List<AssignedResource> getAssignedResourcesWithStatus(PerunSession sess, Member member)
      Returns all resources reachable through groups the member belongs to, annotated with the group-resource assignment status. Assignments in any state are included (not only ACTIVE). If the same resource is reached through multiple assignments, only the entry with the most important status is returned.
      Parameters:
      sess - perun session
      member - member
      Returns:
      list of resources where the member is assigned together with the assignment status
    • getAssignedRichResources

      List<RichResource> getAssignedRichResources(PerunSession perunSession, Group group)
      List of all rich resources associated with the group.
      Parameters:
      perunSession -
      group -
      Returns:
      list of assigned rich resources
      Throws:
      InternalErrorException
    • getAssignedRichResources

      List<RichResource> getAssignedRichResources(PerunSession sess, Member member)
      Returns all rich resources where the member is assigned. The member belongs to a group with an active assignment to the resource. No filter is applied on their VO membership status.
      Parameters:
      sess -
      member -
      Returns:
      list of rich resources where the member is assigned
      Throws:
      InternalErrorException
    • getAssignedRichResources

      List<RichResource> getAssignedRichResources(PerunSession sess, Member member, Service service)
      Returns all rich resources where the member is assigned. The member belongs to a group with an active assignment to the resource. On top of that, results are restricted to resources with the given service assigned. No filter is applied on their VO membership status.
      Parameters:
      sess -
      member -
      service -
      Returns:
      list of rich resources where the member is assigned that have the given service
      Throws:
      InternalErrorException
    • getAssignedServices

      List<Service> getAssignedServices(PerunSession perunSession, Resource resource)
      List all services' id associated with the resource.
      Parameters:
      perunSession -
      resource -
      Returns:
      list of assigned service' id
      Throws:
      InternalErrorException
    • getAssignedUsers

      List<User> getAssignedUsers(PerunSession perunSession, Resource resource)
      Returns all assigned users on the resource. Assigned users are members of a group with an active assignment to the resource. No filter is applied on their VO membership status.
      Parameters:
      perunSession -
      resource -
      Returns:
      list of assigned users on the resource
      Throws:
      InternalErrorException
    • getAssociatedMembers

      List<Member> getAssociatedMembers(PerunSession sess, Resource resource)
      Returns all members who are associated with the resource. Does not require ACTIVE group-resource status or any specific member status.
      Parameters:
      sess -
      resource -
      Returns:
      list of members
      Throws:
      InternalErrorException
    • getAssociatedResources

      List<Resource> getAssociatedResources(PerunSession perunSession, Group group)
      List all resources associated with the group. Does not require ACTIVE group-resource status.
      Parameters:
      perunSession -
      group -
      Returns:
      list of associated resources
      Throws:
      InternalErrorException
    • getAssociatedResources

      List<Resource> getAssociatedResources(PerunSession sess, Member member)
      Returns all resources with which the member is associated through the groups. Does not require ACTIVE group-resource status.
      Parameters:
      sess -
      member -
      Returns:
      list of resources
      Throws:
      InternalErrorException
    • getAssociatedUsers

      List<User> getAssociatedUsers(PerunSession sess, Resource resource)
      Returns all users who are associated with the defined resource. Does not require ACTIVE group-resource status.
      Parameters:
      sess -
      resource -
      Returns:
      list of users
      Throws:
      InternalErrorException
    • getBan

      BanOnResource getBan(PerunSession sess, int memberId, int resourceId) throws BanNotExistsException
      Get specific resource ban.
      Parameters:
      sess -
      memberId - the member id
      resourceId - the resource id
      Returns:
      specific resource ban
      Throws:
      InternalErrorException
      BanNotExistsException
    • getBanById

      BanOnResource getBanById(PerunSession sess, int banId) throws BanNotExistsException
      Get Ban for member on resource by it's id
      Parameters:
      sess -
      banId - the ban id
      Returns:
      resource ban by it's id
      Throws:
      InternalErrorException
      BanNotExistsException
    • getBansForMember

      List<BanOnResource> getBansForMember(PerunSession sess, int memberId)
      Get all resources bans for member.
      Parameters:
      sess -
      memberId - the member id
      Returns:
      list of bans for member on any resource
      Throws:
      InternalErrorException
    • getBansForResource

      List<BanOnResource> getBansForResource(PerunSession sess, int resourceId)
      Get all members bans for resource
      Parameters:
      sess -
      resourceId - the resource id
      Returns:
      list of all members bans on resource
      Throws:
      InternalErrorException
    • getDirectAdmins

      List<User> getDirectAdmins(PerunSession perunSession, Resource resource)
      Gets list of direct user administrators of the Resource. 'Direct' means, there aren't included users, who are members of group administrators, in the returned list.
      Parameters:
      perunSession -
      resource -
      Returns:
      list of direct admins of the resource
      Throws:
      InternalErrorException
    • getFacilityId

      int getFacilityId(PerunSession perunSession, Resource resource)
      Get facility id which belongs to the concrete resource.
      Parameters:
      perunSession -
      resource -
      Returns:
      facility id
      Throws:
      InternalErrorException
    • getFailedGroupResourceAssignmentCause

      String getFailedGroupResourceAssignmentCause(PerunSession sess, Group group, Resource resource)
      Gets the current cause of failed group-resource assignment. Returns null if there is no such group-resource assignment.
      Parameters:
      sess - session
      group - group
      resource - resource
      Returns:
      error message
    • getGroupAssignments

      List<AssignedGroup> getGroupAssignments(PerunSession sess, Resource resource)
      Lists all of the assigned groups for the given resource without the groups' attributes.
      Parameters:
      sess - session
      resource - resource
      Returns:
      list of assigned groups for given resource
      Throws:
      InternalErrorException
    • getGroupResourceAssignments

      List<GroupResourceAssignment> getGroupResourceAssignments(PerunSession sess, List<GroupResourceStatus> statuses)
      Lists all group-resource assignments with given statuses. If statuses are empty or null, lists assignments with all statuses.
      Parameters:
      sess - session
      statuses - list of allowed statuses
      Returns:
      list of group-resource assignments with given statuses
      Throws:
      InternalErrorException
    • getGroupResourceStatus

      GroupResourceStatus getGroupResourceStatus(PerunSession sess, Group group, Resource resource) throws GroupNotDefinedOnResourceException
      Gets status of given group-resource assignment.
      Parameters:
      sess - session
      group - group
      resource - resource
      Returns:
      assignment status of the given group and resource
      Throws:
      GroupNotDefinedOnResourceException - if there is no such group-resource assignment
      InternalErrorException
    • getResourceAssignments

      List<AssignedResource> getResourceAssignments(PerunSession sess, Group group)
      Lists all of the resource assignments for the given group without the resources' attributes.
      Parameters:
      sess - session
      group - group
      Returns:
      list of assigned resources for given group
      Throws:
      InternalErrorException
    • getResourceById

      Resource getResourceById(PerunSession perunSession, int id) throws ResourceNotExistsException
      Searches for the Resource with specified id.
      Parameters:
      perunSession -
      id -
      Returns:
      Resource with specified id
      Throws:
      ResourceNotExistsException
      InternalErrorException
    • getResourceByName

      Resource getResourceByName(PerunSession sess, Vo vo, Facility facility, String name) throws ResourceNotExistsException
      Return resource by its name.
      Parameters:
      sess -
      vo -
      facility -
      name -
      Returns:
      resource
      Throws:
      InternalErrorException
      ResourceNotExistsException
    • getResources

      List<Resource> getResources(PerunSession perunSession, Vo vo)
      Get all VO resources.
      Parameters:
      perunSession -
      vo -
      Returns:
      list of resources
      Throws:
      InternalErrorException
    • getResources

      List<Resource> getResources(PerunSession sess)
      Get all resources.
      Parameters:
      sess - session
      Returns:
      list of resources
      Throws:
      InternalErrorException - internal error
    • getResources

      List<Resource> getResources(PerunSession sess, User user, List<Status> memberStatuses, List<MemberGroupStatus> memberGroupStatuses, List<GroupResourceStatus> groupResourceStatuses)
      Return all resources where user is assigned. Checks member's status in VO and group and status of group-resource assignment. If statuses are null or empty all statuses are used.
      Parameters:
      sess -
      user -
      memberStatuses - allowed member's statuses in VO
      memberGroupStatuses - allowed member's statuses in group
      groupResourceStatuses - allowed statuses of group-resource assignment
      Returns:
      List of allowed resources for the user
      Throws:
      InternalErrorException
    • getResourcesByAttribute

      List<Resource> getResourcesByAttribute(PerunSession sess, Attribute attribute)
      Returns all resources which have set the attribute with the value. Searching only def and opt attributes.
      Parameters:
      sess -
      attribute -
      Returns:
      Throws:
      InternalErrorException
    • getResourcesByIds

      List<Resource> getResourcesByIds(PerunSession perunSession, List<Integer> ids)
      Gets resources by their ids. Silently skips non-existing resources.
      Parameters:
      perunSession -
      ids -
      Returns:
      List of resources with specified ids
      Throws:
      InternalErrorException
    • getResourcesCount

      int getResourcesCount(PerunSession perunSession, Vo vo)
      Get all VO resources count.
      Parameters:
      perunSession -
      vo -
      Returns:
      count of vo resources
      Throws:
      InternalErrorException
    • getResourcesCount

      int getResourcesCount(PerunSession perunSession)
      Get count of all resources.
      Parameters:
      perunSession -
      Returns:
      count of all resources
      Throws:
      InternalErrorException
    • getResourcesWhereGroupIsAdmin

      List<Resource> 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.
      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
    • getResourcesWhereUserIsAdmin

      List<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, User user)
      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
    • getResourcesWhereUserIsAdmin

      List<Resource> 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. 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
    • getResourcesWhereUserIsAdmin

      List<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, Vo vo, User authorizedUser)
      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
    • getRichResourceById

      RichResource getRichResourceById(PerunSession perunSession, int id) throws ResourceNotExistsException
      Searches for the Rich Resource with specified id.
      Parameters:
      perunSession -
      id -
      Returns:
      RichResource with specified id
      Throws:
      ResourceNotExistsException
      InternalErrorException
    • getRichResources

      List<RichResource> getRichResources(PerunSession perunSession, Vo vo)
      Get all VO rich resources.
      Parameters:
      perunSession -
      vo -
      Returns:
      list of rich resources
      Throws:
      InternalErrorException
    • getRichResourcesByIds

      List<RichResource> getRichResourcesByIds(PerunSession perunSession, List<Integer> ids)
      Gets rich resources by their ids. Silently skips non-existing rich resources.
      Parameters:
      perunSession -
      ids -
      Returns:
      List of rich resources with specified ids
      Throws:
      InternalErrorException
    • getRichResourcesWithMemberAndAttribute

      List<RichResource> getRichResourcesWithMemberAndAttribute(PerunSession perunSession, Member member, AttributeDefinition ad)
      Return all rich resources with given attribute where given member is assigned.
      Parameters:
      perunSession - session
      member - member
      ad - attribute definition
      Returns:
      list of corresponding rich resources
    • groupResourceAssignmentExists

      boolean groupResourceAssignmentExists(PerunSession sess, Resource resource, Group group)
      Returns true if the group is assigned to the current resource with any status, false otherwise.
      Parameters:
      sess -
      resource -
      group -
      Returns:
      true if the group is assigned to the current resource.
      Throws:
      InternalErrorException
    • isGroupAssigned

      boolean isGroupAssigned(PerunSession sess, Resource resource, Group group)
      Returns true if the group is assigned to the current resource with ACTIVE status, false otherwise.
      Parameters:
      sess -
      resource -
      group -
      Returns:
      true if the group is assigned to the current resource with active status.
      Throws:
      InternalErrorException
    • isGroupManuallyAssigned

      boolean isGroupManuallyAssigned(PerunSession sess, Group group, Resource resource)
      Returns true if the group is assigned to the given resource manually, false otherwise.
      Parameters:
      sess -
      group -
      resource -
      Returns:
      true if the group is assigned to the given resource manually.
      Throws:
      InternalErrorException
    • isUserAllowed

      boolean isUserAllowed(PerunSession sess, User user, Resource resource)
      Check if the user is allowed as a member on the selected resource.
      Parameters:
      sess -
      user -
      resource -
      Returns:
      true if the user is allowed as a member on the selected resource.
    • isUserAssigned

      boolean isUserAssigned(PerunSession sess, User user, Resource resource)
      Check if the user is assigned as a member on the selected resource.
      Parameters:
      sess -
      user -
      resource -
      Returns:
      true if the user is assigned as a member on the selected resource.
      Throws:
      InternalErrorException
    • removeAllResourcesTagFromResource

      void removeAllResourcesTagFromResource(PerunSession perunSession, Resource resource)
      Remove all existing Resource tags for specific resource.
      Parameters:
      perunSession -
      resource -
      Throws:
      InternalErrorException
    • removeAutomaticGroupFromResource

      void removeAutomaticGroupFromResource(PerunSession perunSession, Group group, Resource resource, int sourceGroupId) throws GroupAlreadyRemovedFromResourceException
      Remove automatically assigned group from resource.
      Parameters:
      perunSession -
      group -
      resource -
      sourceGroupId - id of a source group through which was the group automatically assigned
      Throws:
      InternalErrorException
      GroupAlreadyRemovedFromResourceException - if there are 0 rows affected by removing group from resource
    • removeBan

      void removeBan(PerunSession sess, int banId) throws BanNotExistsException
      Remove ban by id from resources bans.
      Parameters:
      sess -
      banId - id of specific ban
      Throws:
      InternalErrorException
      BanNotExistsException
    • removeBan

      void removeBan(PerunSession sess, int memberId, int resourceId) throws BanNotExistsException
      Remove ban by member_id and facility_id
      Parameters:
      sess -
      memberId - the id of member
      resourceId - the id of resource
      Throws:
      InternalErrorException
      BanNotExistsException
    • removeGroupFromResource

      void removeGroupFromResource(PerunSession perunSession, Group group, Resource resource) throws GroupAlreadyRemovedFromResourceException
      Remove group from a resource.
      Parameters:
      perunSession -
      group -
      resource -
      Throws:
      InternalErrorException
      GroupAlreadyRemovedFromResourceException - if there are 0 rows affected by removing group from resource
    • removeResourceTagFromResource

      void removeResourceTagFromResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource)
      Remove specific ResourceTag from existing Resource.
      Parameters:
      perunSession -
      resourceTag -
      resource -
      Throws:
      InternalErrorException
    • removeService

      void removeService(PerunSession perunSession, Resource resource, Service service) throws ServiceNotAssignedException
      Remove service from resource.
      Parameters:
      perunSession -
      resource -
      service -
      Throws:
      InternalErrorException
      ServiceNotAssignedException
    • resourceExists

      boolean resourceExists(PerunSession perunSession, Resource resource)
      Check if resource exists in underlaying data source.
      Parameters:
      perunSession -
      resource -
      Returns:
      true if resource exists in underlaying data source, false otherwise
      Throws:
      InternalErrorException
    • setBan

      BanOnResource setBan(PerunSession sess, BanOnResource banOnResource)
      Set ban for member on resource
      Parameters:
      sess -
      banOnResource - the ban
      Returns:
      ban on resource
      Throws:
      InternalErrorException
    • setFailedGroupResourceAssignmentCause

      void setFailedGroupResourceAssignmentCause(PerunSession sess, Group group, Resource resource, String cause) throws GroupNotDefinedOnResourceException
      Sets the cause of failed group-resource assignment
      Parameters:
      sess - session
      group - group
      resource - resource
      cause - the cause of assignment failure
      Throws:
      GroupNotDefinedOnResourceException - if there is no such group-resource assignment
    • setGroupResourceStatus

      void setGroupResourceStatus(PerunSession sess, Group group, Resource resource, GroupResourceStatus status) throws GroupNotDefinedOnResourceException
      Sets status of given group-resource assignment to the specified status.
      Parameters:
      sess - session
      group - group
      resource - resource
      status - new status of the group-resource assignment
      Throws:
      GroupNotDefinedOnResourceException - if there is no such group-resource assignment
      InternalErrorException
    • updateBan

      BanOnResource updateBan(PerunSession sess, BanOnResource banOnResource)
      Update description and validity timestamp of specific ban.
      Parameters:
      sess -
      banOnResource - ban to be updated
      Returns:
      updated ban
      Throws:
      InternalErrorException
    • updateResource

      Resource updateResource(PerunSession perunSession, Resource resource)
      Updates Resource.
      Parameters:
      perunSession -
      resource -
      Returns:
      returns updated Resource
      Throws:
      InternalErrorException
    • updateResourceTag

      ResourceTag updateResourceTag(PerunSession perunSession, ResourceTag resourceTag)
      Update existing Resource tag.
      Parameters:
      perunSession -
      resourceTag -
      Returns:
      updated ResourceTag
      Throws:
      InternalErrorException