Package cz.metacentrum.perun.core.entry
Class ResourcesManagerEntry
java.lang.Object
cz.metacentrum.perun.core.entry.ResourcesManagerEntry
- All Implemented Interfaces:
ResourcesManager
- Author:
- Slavek Licehammer glory@ics.muni.cz
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateGroupResourceAssignment(PerunSession sess, Group group, Resource resource, boolean async) Try to activate the group-resource status.voidaddAdmin(PerunSession sess, Resource resource, Group group) Add role resource admin to group for the selected resource.voidaddAdmin(PerunSession sess, Resource resource, User user) Add role resource admin to user for the selected resource.voidaddResourceSelfServiceGroup(PerunSession sess, Resource resource, Group group) Sets ResourceSelfService role to given group for given resource.voidaddResourceSelfServiceUser(PerunSession sess, Resource resource, User user) Sets ResourceSelfService role to given user for given resource.voidassignGroupsToResource(PerunSession perunSession, List<Group> groups, Resource resource, boolean async, boolean assignInactive, boolean autoAssignSubgroups) Assign groups to a resource.voidassignGroupToResource(PerunSession sess, Group group, Resource resource, boolean async, boolean assignInactive, boolean autoAssignSubgroups) Assign group to a resource.voidassignGroupToResources(PerunSession perunSession, Group group, List<Resource> resources, boolean async, boolean assignInactive, boolean autoAssignSubgroups) Assign group to the resources.voidassignResourceTagsToResource(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) Assign existing ResourceTags on existing Resource.voidassignResourceTagToResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Assign existing ResourceTag on existing Resource.voidassignService(PerunSession sess, Resource resource, Service service) Assign service to resource.voidassignServices(PerunSession sess, Resource resource, List<Service> services) Assign services to resource.voidcopyAttributes(PerunSession sess, Resource sourceResource, Resource destinationResource) Copy all attributes of the source resource to the destination resource.voidcopyGroups(PerunSession sess, Resource sourceResource, Resource destinationResource) Copy all groups of the source resource to the destination resource.copyResource(PerunSession sess, Resource templateResource, Resource destinationResource, boolean withGroups) Copy "template" settings from user's another existing resource and create new resource with this template.voidcopyServices(PerunSession sess, Resource sourceResource, Resource destinationResource) Copy all services of the source resource to the destination resource.createResource(PerunSession sess, Resource resource, Vo vo, Facility facility) Inserts resource into DB.createResourceTag(PerunSession perunSession, ResourceTag resourceTag, Vo vo) Create new Resource tag for the vo.voiddeactivateGroupResourceAssignment(PerunSession sess, Group group, Resource resource) Deactivates the group-resource assignment.voiddeleteAllResources(PerunSession sess, Vo vo) Deletes all resources for the VO.voiddeleteAllResourcesTagsForVo(PerunSession perunSession, Vo vo) Delete all ResourcesTags for specific VO.voiddeleteResource(PerunSession sess, Resource resource) Deletes resource by id.voiddeleteResourceTag(PerunSession perunSession, ResourceTag resourceTag) Delete existing Resource tag.getAdminGroups(PerunSession sess, Resource resource) Gets list of all group administrators of the Resource.getAdmins(PerunSession perunSession, Resource resource, boolean onlyDirectAdmins) Gets list of all user administrators of the Resource.getAllowedMembers(PerunSession sess, Resource resource) Returns all members assigned to the resource.getAllowedResources(PerunSession sess, Member member) Get all resources which have the member access on.getAllowedUsers(PerunSession sess, Resource resource) Returns all users who is assigned with the resource.getAllResources(PerunSession sess) Get all resources from database.getAllResourcesByResourceTag(PerunSession perunSession, ResourceTag resourceTag) Get all resources in specific Vo (specific by resourceTag.getVoId) for existing resourceTaggetAllResourcesTagsForResource(PerunSession perunSession, Resource resource) Get all resourcesTags for existing ResourcegetAllResourcesTagsForVo(PerunSession perunSession, Vo vo) Get all resourcesTags for existing Vo.getAssignedGroups(PerunSession sess, Resource resource) List all groups associated with the resource.getAssignedGroups(PerunSession sess, Resource resource, Member member) List all groups associated with the resource and membergetAssignedMembers(PerunSession sess, Resource resource) Returns all members assigned to the resource.getAssignedMembersWithStatus(PerunSession sess, Resource resource) Returns members of groups assigned to resource with status of group-resource assignment.getAssignedResources(PerunSession sess, Group group) List all resources to which the group is assigned.getAssignedResources(PerunSession sess, Member member) Get all resources where the member is assigned.getAssignedResources(PerunSession sess, Member member, Service service) Get all resources where the member and the service are assigned.getAssignedResourcesWithStatus(PerunSession sess, Member member) Returns all assigned resources where member is assigned through the groups.getAssignedRichMembers(PerunSession sess, Resource resource) Returns all members assigned to the resource as RichMembers.getAssignedRichResources(PerunSession sess, Group group) List all rich resources associated with the group with facility property filled.getAssignedRichResources(PerunSession sess, Member member) Get all rich resources where the member is assigned with facility property filled.getAssignedRichResources(PerunSession sess, Member member, Service service) Get all rich resources where the service and the member are assigned with facility property filled.getAssignedServices(PerunSession sess, Resource resource) List all services associated with the resource.getBan(PerunSession sess, int memberId, int resourceId) Get ban by memberId and resource idgetBanById(PerunSession sess, int banId) Get Ban for member on resource by it's idgetBansForMember(PerunSession sess, int memberId) Get all bans for member on any resource.getBansForResource(PerunSession sess, int resourceId) Get all bans for members on the resource.getEnrichedBansForResource(PerunSession sess, int resourceId, List<String> attrNames) Get all enriched bans for members on the resource.getEnrichedBansForUser(PerunSession sess, int userId, List<String> attrNames) Get all enriched bans on resources for user.getEnrichedResourceById(PerunSession sess, int id, List<String> attrNames) Find resource for given id and returns it with given attributes.getEnrichedResourcesForFacility(PerunSession sess, Facility facility, List<String> attrNames) Find resources for given facility and attributes for given names.getEnrichedResourcesForVo(PerunSession sess, Vo vo, List<String> attrNames) Find resources for given vo and attributes for given names.getFacility(PerunSession sess, Resource resource) Get facility which belongs to the concrete resource.getGroupAssignments(PerunSession sess, Resource resource, List<String> attrNames) Lists all of the assigned groups for the given resource.getMailingServiceRichResourcesWithMember(PerunSession sess, Member member) Return all rich resources with mailing service(s) where given member is assigned.getResourceAssignments(PerunSession sess, Group group, List<String> attrNames) Lists all of the resource assignments for the given group.getResourceById(PerunSession sess, int id) Searches for the Resource with specified id.getResourceByName(PerunSession sess, Vo vo, Facility facility, String name) Return resource by its name.getResources(PerunSession sess, Vo vo) Get all VO resources.getResourcesByIds(PerunSession sess, List<Integer> ids) Search for the Resources with specific ids.intGet count of all resources.intgetResourcesCount(PerunSession sess, Vo vo) Get all VO resources count.Gets the resourcesManagerBl for this instance.getResourcesWhereGroupIsAdmin(PerunSession sess, Facility facility, Vo vo, Group authorizedGroup) Return all resources for the facility and the vo where the group is authorized as resource manager.getResourcesWhereUserIsAdmin(PerunSession sess, Facility facility, Vo vo, User authorizedUser) Return all resources for the facility and the vo where user is authorized as resource manager.getResourcesWhereUserIsAdmin(PerunSession sess, User user) Returns list of resources, where the user is an admin.getResourcesWhereUserIsAdmin(PerunSession sess, Vo vo, User authorizedUser) Return all resources for the vo where user is authorized as resource manager.getRichAdmins(PerunSession perunSession, Resource resource, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) Gets list of all richUser administrators of the Resource.getRichResourceById(PerunSession sess, int id) Search for the RichResource with specific id.getRichResources(PerunSession sess, Vo vo) Get all VO rich resources with facility property filled.getRichResourcesByIds(PerunSession sess, List<Integer> ids) Search for the RichResources with specific ids.getVo(PerunSession sess, Resource resource) Get Vo which is tied to specified resource.isResourceLastAssignedServices(PerunSession sess, Resource resource, List<Service> services) Checks whether the resource is the last one on the facility to have the provided services assigned.voidremoveAdmin(PerunSession sess, Resource resource, Group group) Remove role resource admin from group for the selected resource.voidremoveAdmin(PerunSession sess, Resource resource, User user) Remove role resource admin from user for the selected resource.voidremoveAllResourcesTagFromResource(PerunSession perunSession, Resource resource) Remove all Resource tags for specific resource.voidremoveBan(PerunSession sess, int banId) Remove specific ban by it's id.voidremoveBan(PerunSession sess, int memberId, int resourceId) Remove specific ban by memberId and resourceId.voidremoveGroupFromResource(PerunSession sess, Group group, Resource resource) Remove group from a resource.voidremoveGroupFromResources(PerunSession perunSession, Group group, List<Resource> resources) Remove group from the resources.voidremoveGroupsFromResource(PerunSession perunSession, List<Group> groups, Resource resource) Remove groups from a resource.voidremoveResourceSelfServiceGroup(PerunSession sess, Resource resource, Group group) Unset ResourceSelfService role to given group for given resource.voidremoveResourceSelfServiceUser(PerunSession sess, Resource resource, User user) Unset ResourceSelfService role to given user for given resource.voidremoveResourceTagFromResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Remove specific ResourceTag from existing Resource.voidremoveResourceTagsFromResource(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) Remove specific ResourceTags from existing Resource.voidremoveService(PerunSession sess, Resource resource, Service service) Remove service from resource.voidremoveService(PerunSession perunSession, List<Resource> resources, Service service) Remove service from multiple resources in the same facilityvoidremoveServices(PerunSession sess, Resource resource, List<Service> services, boolean removeTasks, boolean removeTaskResults, boolean removeDestinations) Remove services from resource.setBan(PerunSession sess, BanOnResource banOnResource) Set ban for member on resource.voidsetPerunBl(PerunBl perunBl) Sets the perunBl for this instance.voidsetResourcesManagerBl(ResourcesManagerBl resourcesManagerBl) Sets the resourcesManagerBl for this instance.updateBan(PerunSession sess, BanOnResource banOnResource) Update existing ban (description, validation timestamp)updateResource(PerunSession sess, Resource resource) Updates Resource.updateResourceTag(PerunSession perunSession, ResourceTag resourceTag) Update existing Resource tag.
-
Constructor Details
-
ResourcesManagerEntry
-
ResourcesManagerEntry
public ResourcesManagerEntry()
-
-
Method Details
-
activateGroupResourceAssignment
public void activateGroupResourceAssignment(PerunSession sess, Group group, Resource resource, boolean async) throws ResourceNotExistsException, GroupNotExistsException, PrivilegeException, WrongReferenceAttributeValueException, GroupNotDefinedOnResourceException, GroupResourceMismatchException, WrongAttributeValueException Description copied from interface:ResourcesManagerTry to activate the group-resource status. If the async is set to false, the validation is performed synchronously. The assignment will be either ACTIVE, in case of a successful synchronous call, or it will be PROCESSING in case of an asynchronous call. After the async validation, the state can be either ACTIVE or FAILED.- Specified by:
activateGroupResourceAssignmentin interfaceResourcesManager- Parameters:
sess-group- groupresource- resourceasync- if true the validation is performed asynchronously- Throws:
ResourceNotExistsException- when the resource doesn't existGroupNotExistsException- when the group doesn't existPrivilegeException- insufficient permissionsWrongReferenceAttributeValueException- when an attribute value has wrong/illegal semanticsGroupNotDefinedOnResourceException- when the group-resource assignment doesn't existGroupResourceMismatchException- when the given group and resource are not from the same VOWrongAttributeValueException- when an attribute value has wrong/illegal syntax
-
addAdmin
public void addAdmin(PerunSession sess, Resource resource, User user) throws UserNotExistsException, PrivilegeException, AlreadyAdminException, ResourceNotExistsException, RoleCannotBeManagedException, RoleCannotBeSetException Description copied from interface:ResourcesManagerAdd role resource admin to user for the selected resource.- Specified by:
addAdminin interfaceResourcesManager- Parameters:
sess-resource-user-- Throws:
UserNotExistsExceptionPrivilegeExceptionAlreadyAdminExceptionResourceNotExistsExceptionRoleCannotBeManagedExceptionRoleCannotBeSetException
-
addAdmin
public void addAdmin(PerunSession sess, Resource resource, Group group) throws GroupNotExistsException, PrivilegeException, AlreadyAdminException, ResourceNotExistsException, RoleCannotBeManagedException, RoleCannotBeSetException Description copied from interface:ResourcesManagerAdd role resource admin to group for the selected resource.- Specified by:
addAdminin interfaceResourcesManager- Parameters:
sess-resource-group-- Throws:
PrivilegeExceptionAlreadyAdminExceptionResourceNotExistsExceptionRoleCannotBeManagedExceptionGroupNotExistsExceptionRoleCannotBeSetException
-
addResourceSelfServiceGroup
public void addResourceSelfServiceGroup(PerunSession sess, Resource resource, Group group) throws PrivilegeException, AlreadyAdminException, ResourceNotExistsException, GroupNotExistsException Description copied from interface:ResourcesManagerSets ResourceSelfService role to given group for given resource.- Specified by:
addResourceSelfServiceGroupin interfaceResourcesManager- Parameters:
sess- sessionresource- resourcegroup- group- Throws:
PrivilegeException- insufficient permissionsAlreadyAdminException- already has the roleResourceNotExistsExceptionGroupNotExistsException
-
addResourceSelfServiceUser
public void addResourceSelfServiceUser(PerunSession sess, Resource resource, User user) throws PrivilegeException, AlreadyAdminException, ResourceNotExistsException, UserNotExistsException Description copied from interface:ResourcesManagerSets ResourceSelfService role to given user for given resource.- Specified by:
addResourceSelfServiceUserin interfaceResourcesManager- Parameters:
sess- sessionresource- resourceuser- user id- Throws:
PrivilegeException- insufficient permissionsAlreadyAdminException- already has the roleResourceNotExistsExceptionUserNotExistsException
-
assignGroupToResource
public void assignGroupToResource(PerunSession sess, Group group, Resource resource, boolean async, boolean assignInactive, boolean autoAssignSubgroups) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException, GroupResourceMismatchException Description copied from interface:ResourcesManagerAssign group to a resource. Check if attributes for each member form group are valid. Fill members' attributes with missing value. Work in sync/async mode. Provide options for creating inactive or automatic subgroups group-resource assignments.If the group is already assigned, nothing it performed.
- Specified by:
assignGroupToResourcein interfaceResourcesManager- Parameters:
sess-group-resource-async-assignInactive-autoAssignSubgroups-- Throws:
PrivilegeExceptionGroupNotExistsExceptionResourceNotExistsExceptionWrongAttributeValueExceptionWrongReferenceAttributeValueExceptionGroupResourceMismatchException
-
assignGroupToResources
public void assignGroupToResources(PerunSession perunSession, Group group, List<Resource> resources, boolean async, boolean assignInactive, boolean autoAssignSubgroups) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException, GroupResourceMismatchException Description copied from interface:ResourcesManagerAssign group to the resources. Check if attributes for each member from group are valid. Fill members' attributes with missing values. Work in sync/async mode. Provide options for creating inactive or automatic subgroups group-resource assignments.- Specified by:
assignGroupToResourcesin interfaceResourcesManager- Parameters:
perunSession-group- the groupresources- list of resourcesasync-assignInactive-autoAssignSubgroups-- Throws:
PrivilegeExceptionGroupNotExistsExceptionResourceNotExistsExceptionWrongAttributeValueExceptionWrongReferenceAttributeValueExceptionGroupResourceMismatchException
-
assignGroupsToResource
public void assignGroupsToResource(PerunSession perunSession, List<Group> groups, Resource resource, boolean async, boolean assignInactive, boolean autoAssignSubgroups) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException, GroupResourceMismatchException Description copied from interface:ResourcesManagerAssign groups to a resource. Check if attributes for each member from all groups are valid. Fill members' attributes with missing values. Work in sync/async mode. Provide options for creating inactive or automatic subgroups group-resource assignments.- Specified by:
assignGroupsToResourcein interfaceResourcesManager- Parameters:
perunSession-groups- list of resourcesresource-async-assignInactive-autoAssignSubgroups-- Throws:
PrivilegeExceptionGroupNotExistsExceptionResourceNotExistsExceptionWrongAttributeValueExceptionWrongReferenceAttributeValueExceptionGroupResourceMismatchException
-
assignResourceTagToResource
public void assignResourceTagToResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagAlreadyAssignedException Description copied from interface:ResourcesManagerAssign existing ResourceTag on existing Resource.- Specified by:
assignResourceTagToResourcein interfaceResourcesManager- Parameters:
perunSession-resourceTag-resource-- Throws:
PrivilegeExceptionResourceTagNotExistsExceptionResourceNotExistsExceptionResourceTagAlreadyAssignedException
-
assignResourceTagsToResource
public void assignResourceTagsToResource(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagAlreadyAssignedException Description copied from interface:ResourcesManagerAssign existing ResourceTags on existing Resource.- Specified by:
assignResourceTagsToResourcein interfaceResourcesManager- Parameters:
perunSession-resourceTags-resource-- Throws:
PrivilegeExceptionResourceTagNotExistsExceptionResourceNotExistsExceptionResourceTagAlreadyAssignedException
-
assignService
public void assignService(PerunSession sess, Resource resource, Service service) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceAlreadyAssignedException, WrongAttributeValueException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManagerAssign service to resource.- Specified by:
assignServicein interfaceResourcesManager- Parameters:
sess-resource-service-- Throws:
PrivilegeExceptionResourceNotExistsExceptionServiceNotExistsExceptionServiceAlreadyAssignedExceptionWrongAttributeValueExceptionWrongReferenceAttributeValueException
-
assignServices
public void assignServices(PerunSession sess, Resource resource, List<Service> services) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceAlreadyAssignedException, WrongAttributeValueException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManagerAssign services to resource.- Specified by:
assignServicesin interfaceResourcesManager- Parameters:
sess- perun sessionresource- resourceservices- services to be assigned- Throws:
PrivilegeExceptionResourceNotExistsExceptionServiceNotExistsExceptionServiceAlreadyAssignedExceptionWrongAttributeValueExceptionWrongReferenceAttributeValueException
-
copyAttributes
public void copyAttributes(PerunSession sess, Resource sourceResource, Resource destinationResource) throws PrivilegeException, ResourceNotExistsException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManagerCopy all attributes of the source resource to the destination resource. The attributes, that are in the destination resource and aren't in the source resource, are retained. The common attributes are replaced with the attributes from the source resource. The virtual attributes are not copied.- Specified by:
copyAttributesin interfaceResourcesManager- Parameters:
sess-sourceResource-destinationResource-- Throws:
PrivilegeExceptionResourceNotExistsExceptionWrongReferenceAttributeValueException
-
copyGroups
public void copyGroups(PerunSession sess, Resource sourceResource, Resource destinationResource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerCopy all groups of the source resource to the destination resource. The groups, that are in the destination resource and aren't in the source resource, are retained. The common groups are replaced with the groups from source resource.- Specified by:
copyGroupsin interfaceResourcesManager- Parameters:
sourceResource-destinationResource-- Throws:
ResourceNotExistsExceptionPrivilegeException
-
copyResource
public Resource copyResource(PerunSession sess, Resource templateResource, Resource destinationResource, boolean withGroups) throws ResourceNotExistsException, PrivilegeException, ResourceExistsException Description copied from interface:ResourcesManagerCopy "template" settings from user's another existing resource and create new resource with this template. The settings are attributes, services, tags (if the resources are from the same VO), groups and their members (if the resources are from the same VO and withGroups is true) Template Resource can be from any of user's facilities.- Specified by:
copyResourcein interfaceResourcesManager- Parameters:
sess-templateResource- template resource to copydestinationResource- 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:
ResourceNotExistsExceptionPrivilegeExceptionResourceExistsException
-
copyServices
public void copyServices(PerunSession sess, Resource sourceResource, Resource destinationResource) throws ResourceNotExistsException, PrivilegeException, WrongAttributeValueException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManagerCopy all services of the source resource to the destination resource. The services, that are in the destination resource and aren't in the source resource, are retained. The common services are replaced with the services from source resource.- Specified by:
copyServicesin interfaceResourcesManager- Parameters:
sourceResource-destinationResource-- Throws:
ResourceNotExistsExceptionPrivilegeExceptionWrongAttributeValueExceptionWrongReferenceAttributeValueException
-
createResource
public Resource createResource(PerunSession sess, Resource resource, Vo vo, Facility facility) throws PrivilegeException, VoNotExistsException, FacilityNotExistsException, ResourceExistsException Description copied from interface:ResourcesManagerInserts resource into DB.- Specified by:
createResourcein interfaceResourcesManager- Parameters:
resource- resource to createvo- virtual organizationfacility- facility- Throws:
PrivilegeExceptionVoNotExistsExceptionFacilityNotExistsExceptionResourceExistsException
-
createResourceTag
public ResourceTag createResourceTag(PerunSession perunSession, ResourceTag resourceTag, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ResourcesManagerCreate new Resource tag for the vo.- Specified by:
createResourceTagin interfaceResourcesManager- Parameters:
perunSession-resourceTag-vo-- Returns:
- new created resourceTag
- Throws:
PrivilegeExceptionVoNotExistsException
-
deactivateGroupResourceAssignment
public void deactivateGroupResourceAssignment(PerunSession sess, Group group, Resource resource) throws PrivilegeException, ResourceNotExistsException, GroupNotExistsException, GroupNotDefinedOnResourceException, GroupResourceStatusException Description copied from interface:ResourcesManagerDeactivates the group-resource assignment. The assignment will become INACTIVE and will not be used to allow users from the given group to the resource.- Specified by:
deactivateGroupResourceAssignmentin interfaceResourcesManager- Parameters:
group- groupresource- resource- Throws:
PrivilegeException- insufficient permissionsResourceNotExistsException- when the resource doesn't existGroupNotExistsException- when the group doesn't existGroupNotDefinedOnResourceException- when the group-resource assignment doesn't existGroupResourceStatusException- when trying to deactivate an assignment in PROCESSING state
-
deleteAllResources
public void deleteAllResources(PerunSession sess, Vo vo) throws VoNotExistsException, PrivilegeException, ResourceAlreadyRemovedException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerDeletes all resources for the VO.- Specified by:
deleteAllResourcesin interfaceResourcesManager- Parameters:
sess-vo-- Throws:
PrivilegeExceptionResourceAlreadyRemovedException- if there are at least 1 resource not affected by deleting from DBGroupAlreadyRemovedFromResourceException- if there is at least 1 group which is not affected by removing from DBVoNotExistsException
-
deleteAllResourcesTagsForVo
public void deleteAllResourcesTagsForVo(PerunSession perunSession, Vo vo) throws PrivilegeException, VoNotExistsException, ResourceTagAlreadyAssignedException Description copied from interface:ResourcesManagerDelete all ResourcesTags for specific VO.- Specified by:
deleteAllResourcesTagsForVoin interfaceResourcesManager- Parameters:
perunSession-vo-- Throws:
PrivilegeExceptionVoNotExistsException- ¨ResourceTagAlreadyAssignedException
-
deleteResource
public void deleteResource(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException, ResourceAlreadyRemovedException, GroupAlreadyRemovedFromResourceException, FacilityNotExistsException Description copied from interface:ResourcesManagerDeletes resource by id.- Specified by:
deleteResourcein interfaceResourcesManager- Parameters:
sess-resource-- Throws:
ResourceNotExistsExceptionPrivilegeExceptionResourceAlreadyRemovedException- if there are 0 rows affected by deleting from DBGroupAlreadyRemovedFromResourceException- if there is at least 1 group which is not affected by removing from DBFacilityNotExistsException- if facility of this resource not exists
-
deleteResourceTag
public void deleteResourceTag(PerunSession perunSession, ResourceTag resourceTag) throws PrivilegeException, VoNotExistsException, ResourceTagAlreadyAssignedException, ResourceTagNotExistsException Description copied from interface:ResourcesManagerDelete existing Resource tag.- Specified by:
deleteResourceTagin interfaceResourcesManager- Parameters:
perunSession-resourceTag-- Throws:
PrivilegeExceptionVoNotExistsExceptionResourceTagAlreadyAssignedExceptionResourceTagNotExistsException
-
getAdminGroups
public List<Group> getAdminGroups(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerGets list of all group administrators of the Resource.- Specified by:
getAdminGroupsin interfaceResourcesManager- Parameters:
sess-resource-- Returns:
- list of Group that are admins in the resource.
- Throws:
PrivilegeExceptionResourceNotExistsException
-
getAdmins
public List<User> getAdmins(PerunSession perunSession, Resource resource, boolean onlyDirectAdmins) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerGets list of all user administrators of the Resource. If some group is administrator of the given resource, all VALID members are included in the list.If onlyDirectAdmins is true, return only direct users of the group for supported role.
Supported roles: ResourceAdmin, VOAdmin
- Specified by:
getAdminsin interfaceResourcesManager- 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:
PrivilegeExceptionResourceNotExistsException
-
getAllResources
Description copied from interface:ResourcesManagerGet all resources from database. Returned resources are filtered based on the principal rights.- Specified by:
getAllResourcesin interfaceResourcesManager- Parameters:
sess- Perun session- Returns:
- list of all resources
- Throws:
PrivilegeException- if the principal has insufficient permission
-
getAllResourcesByResourceTag
public List<Resource> getAllResourcesByResourceTag(PerunSession perunSession, ResourceTag resourceTag) throws PrivilegeException, VoNotExistsException, ResourceTagNotExistsException Description copied from interface:ResourcesManagerGet all resources in specific Vo (specific by resourceTag.getVoId) for existing resourceTag- Specified by:
getAllResourcesByResourceTagin interfaceResourcesManager- Parameters:
perunSession-resourceTag-- Returns:
- list of Resources
- Throws:
PrivilegeExceptionVoNotExistsExceptionResourceTagNotExistsException- ¨
-
getAllResourcesTagsForResource
public List<ResourceTag> getAllResourcesTagsForResource(PerunSession perunSession, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerGet all resourcesTags for existing Resource- Specified by:
getAllResourcesTagsForResourcein interfaceResourcesManager- Parameters:
perunSession-resource-- Returns:
- list of ResourcesTags
- Throws:
ResourceNotExistsExceptionPrivilegeException
-
getAllResourcesTagsForVo
public List<ResourceTag> getAllResourcesTagsForVo(PerunSession perunSession, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ResourcesManagerGet all resourcesTags for existing Vo.- Specified by:
getAllResourcesTagsForVoin interfaceResourcesManager- Parameters:
perunSession-vo-- Returns:
- list of all resourcesTags for existing Vo
- Throws:
PrivilegeExceptionVoNotExistsException- ¨
-
getAllowedMembers
public List<Member> getAllowedMembers(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerReturns all members assigned to the resource.- Specified by:
getAllowedMembersin interfaceResourcesManager- Parameters:
sess-resource-- Returns:
- list of members assigned to the resource
- Throws:
ResourceNotExistsExceptionPrivilegeException
-
getAllowedResources
public List<Resource> getAllowedResources(PerunSession sess, Member member) throws MemberNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerGet all resources which have the member access on.- Specified by:
getAllowedResourcesin interfaceResourcesManager- Parameters:
sess-member-- Returns:
- list of resources which have the member acess on
- Throws:
MemberNotExistsExceptionPrivilegeException
-
getAllowedUsers
public List<User> getAllowedUsers(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerReturns all users who is assigned with the resource.- Specified by:
getAllowedUsersin interfaceResourcesManager- Parameters:
sess-resource-- Returns:
- list of users
- Throws:
ResourceNotExistsExceptionPrivilegeException
-
getAssignedGroups
public List<Group> getAssignedGroups(PerunSession sess, Resource resource) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerList all groups associated with the resource.- Specified by:
getAssignedGroupsin interfaceResourcesManager- Parameters:
sess-resource-- Returns:
- list of assigned group
- Throws:
PrivilegeExceptionResourceNotExistsException
-
getAssignedGroups
public List<Group> getAssignedGroups(PerunSession sess, Resource resource, Member member) throws PrivilegeException, ResourceNotExistsException, MemberNotExistsException Description copied from interface:ResourcesManagerList all groups associated with the resource and member- Specified by:
getAssignedGroupsin interfaceResourcesManager- Parameters:
sess-resource-member-- Returns:
- list of assigned groups associated with the resource and member
- Throws:
PrivilegeExceptionResourceNotExistsExceptionMemberNotExistsException
-
getAssignedMembers
public List<Member> getAssignedMembers(PerunSession sess, Resource resource) throws PrivilegeException Description copied from interface:ResourcesManagerReturns all members assigned to the resource.- Specified by:
getAssignedMembersin interfaceResourcesManager- Parameters:
sess-resource-- Returns:
- list of assigned members
- Throws:
PrivilegeException
-
getAssignedMembersWithStatus
public List<AssignedMember> getAssignedMembersWithStatus(PerunSession sess, Resource resource) throws PrivilegeException Description copied from interface:ResourcesManagerReturns members of groups assigned to resource with status of group-resource assignment.- Specified by:
getAssignedMembersWithStatusin interfaceResourcesManager- Parameters:
sess- perunSessionresource- resource- Returns:
- list of members of groups assigned to given resource
- Throws:
PrivilegeException
-
getAssignedResources
public List<Resource> getAssignedResources(PerunSession sess, Group group) throws GroupNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerList all resources to which the group is assigned.- Specified by:
getAssignedResourcesin interfaceResourcesManager- Parameters:
sess-group-- Returns:
- list of assigned resources
- Throws:
GroupNotExistsExceptionPrivilegeException
-
getAssignedResources
public List<Resource> getAssignedResources(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:ResourcesManagerGet all resources where the member is assigned.- Specified by:
getAssignedResourcesin interfaceResourcesManager- Parameters:
sess-member-- Returns:
- Throws:
PrivilegeExceptionMemberNotExistsException
-
getAssignedResources
public List<Resource> getAssignedResources(PerunSession sess, Member member, Service service) throws PrivilegeException, MemberNotExistsException, ServiceNotExistsException Description copied from interface:ResourcesManagerGet all resources where the member and the service are assigned.- Specified by:
getAssignedResourcesin interfaceResourcesManager- Parameters:
sess-member-service-- Returns:
- list of resources
- Throws:
PrivilegeExceptionMemberNotExistsExceptionServiceNotExistsException
-
getAssignedResourcesWithStatus
public List<AssignedResource> getAssignedResourcesWithStatus(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:ResourcesManagerReturns all assigned resources where member is assigned through the groups.- Specified by:
getAssignedResourcesWithStatusin interfaceResourcesManager- Parameters:
sess- perun sessionmember- member- Returns:
- list of assigned resources
- Throws:
PrivilegeExceptionMemberNotExistsException- if the member does not exist
-
getAssignedRichMembers
public List<RichMember> getAssignedRichMembers(PerunSession sess, Resource resource) throws PrivilegeException Description copied from interface:ResourcesManagerReturns all members assigned to the resource as RichMembers.- Specified by:
getAssignedRichMembersin interfaceResourcesManager- Parameters:
sess-resource-- Returns:
- list of assigned rich members
- Throws:
PrivilegeException
-
getAssignedRichResources
public List<RichResource> getAssignedRichResources(PerunSession sess, Group group) throws GroupNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerList all rich resources associated with the group with facility property filled.- Specified by:
getAssignedRichResourcesin interfaceResourcesManager- Parameters:
sess-group-- Returns:
- list of assigned rich resources
- Throws:
GroupNotExistsExceptionPrivilegeException
-
getAssignedRichResources
public List<RichResource> getAssignedRichResources(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:ResourcesManagerGet all rich resources where the member is assigned with facility property filled.- Specified by:
getAssignedRichResourcesin interfaceResourcesManager- Parameters:
sess-member-- Returns:
- list of rich resources
- Throws:
PrivilegeExceptionMemberNotExistsException
-
getAssignedRichResources
public List<RichResource> getAssignedRichResources(PerunSession sess, Member member, Service service) throws PrivilegeException, MemberNotExistsException, ServiceNotExistsException Description copied from interface:ResourcesManagerGet all rich resources where the service and the member are assigned with facility property filled.- Specified by:
getAssignedRichResourcesin interfaceResourcesManager- Parameters:
sess-member-service-- Returns:
- list of rich resources
- Throws:
PrivilegeExceptionMemberNotExistsExceptionServiceNotExistsException
-
getAssignedServices
public List<Service> getAssignedServices(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerList all services associated with the resource.- Specified by:
getAssignedServicesin interfaceResourcesManager- Parameters:
sess-resource-- Returns:
- list of assigned resources
- Throws:
ResourceNotExistsExceptionPrivilegeException
-
getBan
public BanOnResource getBan(PerunSession sess, int memberId, int resourceId) throws BanNotExistsException, PrivilegeException, MemberNotExistsException, ResourceNotExistsException Description copied from interface:ResourcesManagerGet ban by memberId and resource id- Specified by:
getBanin interfaceResourcesManager- Parameters:
sess-memberId- the id of memberresourceId- the id of resource- Returns:
- specific ban for member on resource
- Throws:
BanNotExistsExceptionPrivilegeExceptionMemberNotExistsExceptionResourceNotExistsException
-
getBanById
public BanOnResource getBanById(PerunSession sess, int banId) throws BanNotExistsException, PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerGet Ban for member on resource by it's id- Specified by:
getBanByIdin interfaceResourcesManager- Parameters:
sess-banId- the id of ban- Returns:
- resource ban by it's id
- Throws:
BanNotExistsExceptionPrivilegeExceptionResourceNotExistsException
-
getBansForMember
public List<BanOnResource> getBansForMember(PerunSession sess, int memberId) throws MemberNotExistsException, ResourceNotExistsException Description copied from interface:ResourcesManagerGet all bans for member on any resource.- Specified by:
getBansForMemberin interfaceResourcesManager- Parameters:
sess-memberId- the id of member- Returns:
- list of bans for member on any resource
- Throws:
MemberNotExistsExceptionResourceNotExistsException
-
getBansForResource
public List<BanOnResource> getBansForResource(PerunSession sess, int resourceId) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerGet all bans for members on the resource.- Specified by:
getBansForResourcein interfaceResourcesManager- Parameters:
sess-resourceId- the id of resource- Returns:
- list of all members bans on the resource
- Throws:
PrivilegeExceptionResourceNotExistsException
-
getEnrichedBansForResource
public List<EnrichedBanOnResource> getEnrichedBansForResource(PerunSession sess, int resourceId, List<String> attrNames) throws PrivilegeException, ResourceNotExistsException, AttributeNotExistsException Description copied from interface:ResourcesManagerGet all enriched bans for members on the resource.- Specified by:
getEnrichedBansForResourcein interfaceResourcesManager- Parameters:
sess-resourceId- the id of resourceattrNames- list of attributes names, returns all user/member attributes if null or empty- Returns:
- list of all enriched bans on resource
- Throws:
PrivilegeExceptionResourceNotExistsExceptionAttributeNotExistsException
-
getEnrichedBansForUser
public List<EnrichedBanOnResource> getEnrichedBansForUser(PerunSession sess, int userId, List<String> attrNames) throws PrivilegeException, UserNotExistsException, AttributeNotExistsException Description copied from interface:ResourcesManagerGet all enriched bans on resources for user.- Specified by:
getEnrichedBansForUserin interfaceResourcesManager- Parameters:
sess-userId- id of user- Returns:
- attrNames list of attributes names, returns all user/member attributes if null or empty
- Throws:
PrivilegeExceptionUserNotExistsExceptionAttributeNotExistsException
-
getEnrichedResourceById
public EnrichedResource getEnrichedResourceById(PerunSession sess, int id, List<String> attrNames) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerFind resource for given id and returns it with given attributes. If attrNames are null or empty, all resource attributes are returned.- Specified by:
getEnrichedResourceByIdin interfaceResourcesManager- Parameters:
sess- sessionid- resource idattrNames- names of attributes to return- Returns:
- resource for given id with desired attributes
- Throws:
PrivilegeException- insufficient permissionsResourceNotExistsException- if there is no resource with given id
-
getEnrichedResourcesForFacility
public List<EnrichedResource> getEnrichedResourcesForFacility(PerunSession sess, Facility facility, List<String> attrNames) throws FacilityNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerFind resources for given facility and attributes for given names. If the attrNames are empty or null, return all attributes.- Specified by:
getEnrichedResourcesForFacilityin interfaceResourcesManager- Parameters:
sess- sessionfacility- facilityattrNames- names of attributes to return- Returns:
- resources with desired attributes
- Throws:
FacilityNotExistsException- if there is not facility with given idPrivilegeException- insufficient permissions
-
getEnrichedResourcesForVo
public List<EnrichedResource> getEnrichedResourcesForVo(PerunSession sess, Vo vo, List<String> attrNames) throws VoNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerFind resources for given vo and attributes for given names. If the attrNames are empty or null, return all attributes.- Specified by:
getEnrichedResourcesForVoin interfaceResourcesManager- Parameters:
sess- sessionvo- voattrNames- names of attributes to return- Returns:
- resources with desired attributes
- Throws:
VoNotExistsException- if there is no vo with given idPrivilegeException- insufficient permissions
-
getFacility
public Facility getFacility(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerGet facility which belongs to the concrete resource.- Specified by:
getFacilityin interfaceResourcesManager- Parameters:
sess-resource-- Returns:
- facility belonging to the resource
- Throws:
ResourceNotExistsExceptionPrivilegeException
-
getGroupAssignments
public List<AssignedGroup> getGroupAssignments(PerunSession sess, Resource resource, List<String> attrNames) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerLists all of the assigned groups for the given resource. Also, returns specified attributes for the groups. If attrNames are null, all group attributes are returned.- Specified by:
getGroupAssignmentsin interfaceResourcesManager- Parameters:
sess-resource- resourceattrNames- names of attributes to return- Returns:
- list of assigned groups for given resource with specified attributes
- Throws:
PrivilegeException- insufficient permissionsResourceNotExistsException- when the resource doesn't exist
-
getMailingServiceRichResourcesWithMember
public List<RichResource> getMailingServiceRichResourcesWithMember(PerunSession sess, Member member) throws MemberNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerReturn all rich resources with mailing service(s) where given member is assigned.- Specified by:
getMailingServiceRichResourcesWithMemberin interfaceResourcesManager- Parameters:
sess- sessionmember- member- Returns:
- list of corresponding rich resources
- Throws:
MemberNotExistsException- if member is not present (does not exist)PrivilegeException
-
getPerunBl
-
getResourceAssignments
public List<AssignedResource> getResourceAssignments(PerunSession sess, Group group, List<String> attrNames) throws PrivilegeException, GroupNotExistsException Description copied from interface:ResourcesManagerLists all of the resource assignments for the given group. Also, returns specified attributes and resource tags for the resources. If attrNames are null or empty, all resource attributes are returned.- Specified by:
getResourceAssignmentsin interfaceResourcesManager- Parameters:
sess- sessiongroup- groupattrNames- names of attributes to return- Returns:
- list of assigned resources for given group with specified attributes and resource tags
- Throws:
PrivilegeException- insufficient permissionsGroupNotExistsException- when the group doesn't exist
-
getResourceById
public Resource getResourceById(PerunSession sess, int id) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerSearches for the Resource with specified id.- Specified by:
getResourceByIdin interfaceResourcesManager- Parameters:
sess-id-- Returns:
- Resource with specified id
- Throws:
PrivilegeExceptionResourceNotExistsException
-
getResourceByName
public Resource getResourceByName(PerunSession sess, Vo vo, Facility facility, String name) throws PrivilegeException, ResourceNotExistsException, VoNotExistsException, FacilityNotExistsException Description copied from interface:ResourcesManagerReturn resource by its name.- Specified by:
getResourceByNamein interfaceResourcesManager- Parameters:
sess-vo-facility-name-- Returns:
- resource
- Throws:
PrivilegeExceptionResourceNotExistsExceptionVoNotExistsExceptionFacilityNotExistsException
-
getResources
public List<Resource> getResources(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ResourcesManagerGet all VO resources. If called by resourceAdmin it returns only those resources of which is he admin.- Specified by:
getResourcesin interfaceResourcesManager- Parameters:
sess-vo-- Returns:
- list of resources
- Throws:
PrivilegeExceptionVoNotExistsException
-
getResourcesByIds
public List<Resource> getResourcesByIds(PerunSession sess, List<Integer> ids) throws PrivilegeException Description copied from interface:ResourcesManagerSearch for the Resources with specific ids.- Specified by:
getResourcesByIdsin interfaceResourcesManager- Parameters:
sess-ids-- Returns:
- Resources with specified ids
- Throws:
PrivilegeException
-
getResourcesCount
public int getResourcesCount(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ResourcesManagerGet all VO resources count.- Specified by:
getResourcesCountin interfaceResourcesManager- Parameters:
sess-vo-- Returns:
- count of vo resources
- Throws:
PrivilegeExceptionVoNotExistsException
-
getResourcesCount
Description copied from interface:ResourcesManagerGet count of all resources.- Specified by:
getResourcesCountin interfaceResourcesManager- Parameters:
sess-- Returns:
- count of all resources
-
getResourcesManagerBl
Gets the resourcesManagerBl for this instance.- Returns:
- The resourcesManagerBl.
-
getResourcesWhereGroupIsAdmin
public List<Resource> getResourcesWhereGroupIsAdmin(PerunSession sess, Facility facility, Vo vo, Group authorizedGroup) throws PrivilegeException, GroupNotExistsException, FacilityNotExistsException, VoNotExistsException Description copied from interface:ResourcesManagerReturn all resources for the facility and the vo where the group is authorized as resource manager.- Specified by:
getResourcesWhereGroupIsAdminin interfaceResourcesManager- Parameters:
sess-facility- the facility to which resources should be assigned tovo- the vo to which resources should be assigned toauthorizedGroup- group with resource manager role for all those resources- Returns:
- list of defined resources where groups has role resource manager
- Throws:
PrivilegeExceptionGroupNotExistsExceptionFacilityNotExistsExceptionVoNotExistsException
-
getResourcesWhereUserIsAdmin
public List<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, User user) throws UserNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerReturns list of resources, where the user is an admin. Including resources, where the user is a VALID member of authorized group.- Specified by:
getResourcesWhereUserIsAdminin interfaceResourcesManager- Parameters:
sess-user-- Returns:
- list of resources, where the user is an admin.
- Throws:
UserNotExistsExceptionPrivilegeException
-
getResourcesWhereUserIsAdmin
public List<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, Facility facility, Vo vo, User authorizedUser) throws PrivilegeException, UserNotExistsException, FacilityNotExistsException, VoNotExistsException Description copied from interface:ResourcesManagerReturn all resources for the facility and the vo where user is authorized as resource manager. Including resources, where the user is a VALID member of authorized group.- Specified by:
getResourcesWhereUserIsAdminin interfaceResourcesManager- Parameters:
sess-facility- the facility to which resources should be assigned tovo- the vo to which resources should be assigned toauthorizedUser- user with resource manager role for all those resources- Returns:
- list of defined resources where user has role resource manager
- Throws:
PrivilegeExceptionUserNotExistsExceptionFacilityNotExistsExceptionVoNotExistsException
-
getResourcesWhereUserIsAdmin
public List<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, Vo vo, User authorizedUser) throws PrivilegeException, UserNotExistsException, VoNotExistsException Description copied from interface:ResourcesManagerReturn all resources for the vo where user is authorized as resource manager. Including resources, where the user is a VALID member of authorized group.- Specified by:
getResourcesWhereUserIsAdminin interfaceResourcesManager- Parameters:
sess-vo- the vo to which resources should be assigned toauthorizedUser- user with resource manager role for all those resources- Returns:
- list of defined resources where user has role resource manager
- Throws:
PrivilegeExceptionUserNotExistsExceptionVoNotExistsException
-
getRichAdmins
public List<RichUser> getRichAdmins(PerunSession perunSession, Resource resource, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) throws UserNotExistsException, PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerGets list of all richUser administrators of the Resource. If some group is administrator of the given resource, all VALID members are included in the list.Supported roles: ResourceAdmin, VOAdmin
If "onlyDirectAdmins" is "true", return only direct users of the group for supported role with specific attributes. If "allUserAttributes" is "true", do not specify attributes through list and return them all in objects richUser . Ignoring list of specific attributes.
- Specified by:
getRichAdminsin interfaceResourcesManager- Parameters:
perunSession-resource-specificAttributes- list of specified attributes which are needed in object richUserallUserAttributes- 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:
UserNotExistsExceptionPrivilegeExceptionResourceNotExistsException
-
getRichResourceById
public RichResource getRichResourceById(PerunSession sess, int id) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerSearch for the RichResource with specific id.- Specified by:
getRichResourceByIdin interfaceResourcesManager- Parameters:
sess-id-- Returns:
- RichResource with specified id
- Throws:
PrivilegeExceptionResourceNotExistsException
-
getRichResources
public List<RichResource> getRichResources(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ResourcesManagerGet all VO rich resources with facility property filled. If called by resourceAdmin it returns only those resources of which is he admin.- Specified by:
getRichResourcesin interfaceResourcesManager- Parameters:
sess-vo-- Returns:
- list of rich resources
- Throws:
PrivilegeExceptionVoNotExistsException
-
getRichResourcesByIds
public List<RichResource> getRichResourcesByIds(PerunSession sess, List<Integer> ids) throws PrivilegeException Description copied from interface:ResourcesManagerSearch for the RichResources with specific ids.- Specified by:
getRichResourcesByIdsin interfaceResourcesManager- Parameters:
sess-ids-- Returns:
- RichResources with specified ids
- Throws:
PrivilegeException
-
getVo
public Vo getVo(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManagerGet Vo which is tied to specified resource.- Specified by:
getVoin interfaceResourcesManager- Parameters:
sess-resource-- Returns:
- vo tied to specified resource
- Throws:
ResourceNotExistsExceptionPrivilegeException
-
isResourceLastAssignedServices
public List<Service> isResourceLastAssignedServices(PerunSession sess, Resource resource, List<Service> services) throws FacilityNotExistsException, ResourceNotExistsException, PrivilegeException, ServiceNotExistsException Description copied from interface:ResourcesManagerChecks whether the resource is the last one on the facility to have the provided services assigned. Returns the services where this is the case.- Specified by:
isResourceLastAssignedServicesin interfaceResourcesManager- Parameters:
sess-resource-services-- Returns:
- list of services where the provided resource is last to have them assigned on its facility.
- Throws:
FacilityNotExistsExceptionResourceNotExistsExceptionPrivilegeExceptionServiceNotExistsException
-
removeAdmin
public void removeAdmin(PerunSession sess, Resource resource, User user) throws UserNotExistsException, PrivilegeException, UserNotAdminException, ResourceNotExistsException, RoleCannotBeManagedException Description copied from interface:ResourcesManagerRemove role resource admin from user for the selected resource.- Specified by:
removeAdminin interfaceResourcesManager- Parameters:
sess-resource-user-- Throws:
UserNotExistsExceptionPrivilegeExceptionResourceNotExistsExceptionUserNotAdminExceptionRoleCannotBeManagedException
-
removeAdmin
public void removeAdmin(PerunSession sess, Resource resource, Group group) throws GroupNotExistsException, PrivilegeException, GroupNotAdminException, ResourceNotExistsException, RoleCannotBeManagedException Description copied from interface:ResourcesManagerRemove role resource admin from group for the selected resource.- Specified by:
removeAdminin interfaceResourcesManager- Parameters:
sess-resource-group-- Throws:
GroupNotExistsExceptionPrivilegeExceptionGroupNotAdminExceptionResourceNotExistsExceptionRoleCannotBeManagedException
-
removeAllResourcesTagFromResource
public void removeAllResourcesTagFromResource(PerunSession perunSession, Resource resource) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerRemove all Resource tags for specific resource.- Specified by:
removeAllResourcesTagFromResourcein interfaceResourcesManager- Parameters:
perunSession-resource-- Throws:
PrivilegeExceptionResourceNotExistsException
-
removeBan
public void removeBan(PerunSession sess, int banId) throws PrivilegeException, BanNotExistsException, ResourceNotExistsException Description copied from interface:ResourcesManagerRemove specific ban by it's id.- Specified by:
removeBanin interfaceResourcesManager- Parameters:
sess-banId- the id of ban- Throws:
PrivilegeExceptionBanNotExistsExceptionResourceNotExistsException
-
removeBan
public void removeBan(PerunSession sess, int memberId, int resourceId) throws BanNotExistsException, PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManagerRemove specific ban by memberId and resourceId.- Specified by:
removeBanin interfaceResourcesManager- Parameters:
sess-memberId- the id of memberresourceId- the id of resource- Throws:
BanNotExistsExceptionPrivilegeExceptionResourceNotExistsException
-
removeGroupFromResource
public void removeGroupFromResource(PerunSession sess, Group group, Resource resource) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, GroupNotDefinedOnResourceException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerRemove group from a resource. After removing, check attributes and fix them if it is needed.- Specified by:
removeGroupFromResourcein interfaceResourcesManager- Parameters:
sess-group-resource-- Throws:
PrivilegeExceptionResourceNotExistsExceptionGroupNotDefinedOnResourceException- Group was never assigned to this resourceGroupAlreadyRemovedFromResourceException- if there are 0 rows affected by deleting from DBGroupNotExistsException
-
removeGroupFromResources
public void removeGroupFromResources(PerunSession perunSession, Group group, List<Resource> resources) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, GroupNotDefinedOnResourceException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerRemove group from the resources. After removing, check attributes and fix them if it is needed.- Specified by:
removeGroupFromResourcesin interfaceResourcesManager- Parameters:
perunSession-group- list of groupsresources- list of resources- Throws:
PrivilegeExceptionGroupNotExistsExceptionResourceNotExistsExceptionGroupNotDefinedOnResourceExceptionGroupAlreadyRemovedFromResourceException
-
removeGroupsFromResource
public void removeGroupsFromResource(PerunSession perunSession, List<Group> groups, Resource resource) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, GroupNotDefinedOnResourceException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManagerRemove groups from a resource. After removing, check attributes and fix them if it is needed.- Specified by:
removeGroupsFromResourcein interfaceResourcesManager- Parameters:
perunSession-groups- list of groupsresource-- Throws:
PrivilegeExceptionGroupNotExistsExceptionResourceNotExistsExceptionGroupNotDefinedOnResourceExceptionGroupAlreadyRemovedFromResourceException
-
removeResourceSelfServiceGroup
public void removeResourceSelfServiceGroup(PerunSession sess, Resource resource, Group group) throws PrivilegeException, GroupNotAdminException, ResourceNotExistsException, GroupNotExistsException Description copied from interface:ResourcesManagerUnset ResourceSelfService role to given group for given resource.- Specified by:
removeResourceSelfServiceGroupin interfaceResourcesManager- Parameters:
sess- sessionresource- resourcegroup- group- Throws:
PrivilegeException- insufficient permissionsGroupNotAdminException- group did not have the roleResourceNotExistsExceptionGroupNotExistsException
-
removeResourceSelfServiceUser
public void removeResourceSelfServiceUser(PerunSession sess, Resource resource, User user) throws PrivilegeException, UserNotAdminException, ResourceNotExistsException, UserNotExistsException Description copied from interface:ResourcesManagerUnset ResourceSelfService role to given user for given resource.- Specified by:
removeResourceSelfServiceUserin interfaceResourcesManager- Parameters:
sess- sessionresource- resourceuser- user- Throws:
PrivilegeException- insufficient permissionsUserNotAdminException- user did not have the roleResourceNotExistsExceptionUserNotExistsException
-
removeResourceTagFromResource
public void removeResourceTagFromResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagNotAssignedException Description copied from interface:ResourcesManagerRemove specific ResourceTag from existing Resource.- Specified by:
removeResourceTagFromResourcein interfaceResourcesManager- Parameters:
perunSession-resourceTag-resource-- Throws:
PrivilegeExceptionResourceTagNotExistsExceptionResourceNotExistsExceptionResourceTagNotAssignedException
-
removeResourceTagsFromResource
public void removeResourceTagsFromResource(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagNotAssignedException Description copied from interface:ResourcesManagerRemove specific ResourceTags from existing Resource.- Specified by:
removeResourceTagsFromResourcein interfaceResourcesManager- Parameters:
perunSession-resourceTags-resource-- Throws:
PrivilegeExceptionResourceTagNotExistsExceptionResourceNotExistsExceptionResourceTagNotAssignedException
-
removeService
public void removeService(PerunSession sess, Resource resource, Service service) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceNotAssignedException Description copied from interface:ResourcesManagerRemove service from resource.- Specified by:
removeServicein interfaceResourcesManager- Parameters:
sess-resource-service-- Throws:
PrivilegeExceptionResourceNotExistsExceptionServiceNotExistsExceptionServiceNotAssignedException
-
removeService
public void removeService(PerunSession perunSession, List<Resource> resources, Service service) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceNotAssignedException, FacilityNotExistsException, FacilityMismatchException Description copied from interface:ResourcesManagerRemove service from multiple resources in the same facility- Specified by:
removeServicein interfaceResourcesManager- Parameters:
perunSession-resources-service-- Throws:
PrivilegeExceptionResourceNotExistsExceptionServiceNotExistsExceptionServiceNotAssignedExceptionFacilityNotExistsExceptionFacilityMismatchException
-
removeServices
public void removeServices(PerunSession sess, Resource resource, List<Service> services, boolean removeTasks, boolean removeTaskResults, boolean removeDestinations) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceNotAssignedException, FacilityNotExistsException Description copied from interface:ResourcesManagerRemove services from resource. Optionally also removes tasks, their results or destinations associated with the services on the resource's facility. This only happens for services which are not assigned to other resources on the facility.- Specified by:
removeServicesin interfaceResourcesManager- Parameters:
sess-resource-services-removeTasks-removeTaskResults-removeDestinations-- Throws:
PrivilegeExceptionResourceNotExistsExceptionServiceNotExistsExceptionServiceNotAssignedExceptionFacilityNotExistsException
-
setBan
public BanOnResource setBan(PerunSession sess, BanOnResource banOnResource) throws PrivilegeException, BanAlreadyExistsException, ResourceNotExistsException Description copied from interface:ResourcesManagerSet ban for member on resource.- Specified by:
setBanin interfaceResourcesManager- Parameters:
sess-banOnResource- the ban- Returns:
- ban on resource
- Throws:
PrivilegeExceptionBanAlreadyExistsExceptionResourceNotExistsException
-
setPerunBl
Sets the perunBl for this instance.- Parameters:
perunBl- The perunBl.
-
setResourcesManagerBl
Sets the resourcesManagerBl for this instance.- Parameters:
resourcesManagerBl- The resourcesManagerBl.
-
updateBan
public BanOnResource updateBan(PerunSession sess, BanOnResource banOnResource) throws PrivilegeException, MemberNotExistsException, BanNotExistsException, ResourceNotExistsException Description copied from interface:ResourcesManagerUpdate existing ban (description, validation timestamp)- Specified by:
updateBanin interfaceResourcesManager- Parameters:
sess-banOnResource- the specific ban- Returns:
- updated ban
- Throws:
PrivilegeExceptionMemberNotExistsExceptionBanNotExistsExceptionResourceNotExistsException
-
updateResource
public Resource updateResource(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException, ResourceExistsException Description copied from interface:ResourcesManagerUpdates Resource.- Specified by:
updateResourcein interfaceResourcesManager- Parameters:
sess-resource-- Returns:
- returns updated Resource
- Throws:
ResourceNotExistsExceptionPrivilegeExceptionResourceExistsException
-
updateResourceTag
public ResourceTag updateResourceTag(PerunSession perunSession, ResourceTag resourceTag) throws PrivilegeException, ResourceTagNotExistsException, VoNotExistsException Description copied from interface:ResourcesManagerUpdate existing Resource tag.- Specified by:
updateResourceTagin interfaceResourcesManager- Parameters:
perunSession-resourceTag-- Returns:
- updated ResourceTag
- Throws:
PrivilegeExceptionResourceTagNotExistsExceptionVoNotExistsException
-