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 TypeMethodDescriptionvoid
activateGroupResourceAssignment
(PerunSession sess, Group group, Resource resource, boolean async) Try to activate the group-resource status.void
addAdmin
(PerunSession sess, Resource resource, Group group) Add role resource admin to group for the selected resource.void
addAdmin
(PerunSession sess, Resource resource, User user) Add role resource admin to user for the selected resource.void
addResourceSelfServiceGroup
(PerunSession sess, Resource resource, Group group) Sets ResourceSelfService role to given group for given resource.void
addResourceSelfServiceUser
(PerunSession sess, Resource resource, User user) Sets ResourceSelfService role to given user for given resource.void
assignGroupsToResource
(PerunSession perunSession, List<Group> groups, Resource resource, boolean async, boolean assignInactive, boolean autoAssignSubgroups) Assign groups to a resource.void
assignGroupToResource
(PerunSession sess, Group group, Resource resource, boolean async, boolean assignInactive, boolean autoAssignSubgroups) Assign group to a resource.void
assignGroupToResources
(PerunSession perunSession, Group group, List<Resource> resources, boolean async, boolean assignInactive, boolean autoAssignSubgroups) Assign group to the resources.void
assignResourceTagsToResource
(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) Assign existing ResourceTags on existing Resource.void
assignResourceTagToResource
(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Assign existing ResourceTag on existing Resource.void
assignService
(PerunSession sess, Resource resource, Service service) Assign service to resource.void
assignServices
(PerunSession sess, Resource resource, List<Service> services) Assign services to resource.void
assignServicesPackage
(PerunSession sess, Resource resource, ServicesPackage servicesPackage) Assign all services from services package to resouce.void
copyAttributes
(PerunSession sess, Resource sourceResource, Resource destinationResource) Copy all attributes of the source resource to the destination resource.void
copyGroups
(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.void
copyServices
(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.void
deactivateGroupResourceAssignment
(PerunSession sess, Group group, Resource resource) Deactivates the group-resource assignment.void
deleteAllResources
(PerunSession sess, Vo vo) Deletes all resources for the VO.void
deleteAllResourcesTagsForVo
(PerunSession perunSession, Vo vo) Delete all ResourcesTags for specific VO.void
deleteResource
(PerunSession sess, Resource resource) Deletes resource by id.void
deleteResourceTag
(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.int
Get count of all resources.int
getResourcesCount
(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.void
removeAdmin
(PerunSession sess, Resource resource, Group group) Remove role resource admin from group for the selected resource.void
removeAdmin
(PerunSession sess, Resource resource, User user) Remove role resource admin from user for the selected resource.void
removeAllResourcesTagFromResource
(PerunSession perunSession, Resource resource) Remove all Resource tags for specific resource.void
removeBan
(PerunSession sess, int banId) Remove specific ban by it's id.void
removeBan
(PerunSession sess, int memberId, int resourceId) Remove specific ban by memberId and resourceId.void
removeGroupFromResource
(PerunSession sess, Group group, Resource resource) Remove group from a resource.void
removeGroupFromResources
(PerunSession perunSession, Group group, List<Resource> resources) Remove group from the resources.void
removeGroupsFromResource
(PerunSession perunSession, List<Group> groups, Resource resource) Remove groups from a resource.void
removeResourceSelfServiceGroup
(PerunSession sess, Resource resource, Group group) Unset ResourceSelfService role to given group for given resource.void
removeResourceSelfServiceUser
(PerunSession sess, Resource resource, User user) Unset ResourceSelfService role to given user for given resource.void
removeResourceTagFromResource
(PerunSession perunSession, ResourceTag resourceTag, Resource resource) Remove specific ResourceTag from existing Resource.void
removeResourceTagsFromResource
(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) Remove specific ResourceTags from existing Resource.void
removeService
(PerunSession sess, Resource resource, Service service) Remove service from resource.void
removeService
(PerunSession perunSession, List<Resource> resources, Service service) Remove service from multiple resources in the same facilityvoid
removeServices
(PerunSession sess, Resource resource, List<Service> services) Remove services from resource.void
removeServicesPackage
(PerunSession sess, Resource resource, ServicesPackage servicesPackage) Remove from resource all services from services package.setBan
(PerunSession sess, BanOnResource banOnResource) Set ban for member on resource.void
setPerunBl
(PerunBl perunBl) Sets the perunBl for this instance.void
setResourcesManagerBl
(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:ResourcesManager
Try to activate the group-resource status. If the async is set to false, the validation is performed synchronously. The assignment will be either ACTIVE, in case of a successful synchronous call, or it will be PROCESSING in case of an asynchronous call. After the async validation, the state can be either ACTIVE or FAILED.- Specified by:
activateGroupResourceAssignment
in 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:ResourcesManager
Add role resource admin to user for the selected resource.- Specified by:
addAdmin
in interfaceResourcesManager
- Parameters:
sess
-resource
-user
-- Throws:
UserNotExistsException
PrivilegeException
AlreadyAdminException
ResourceNotExistsException
RoleCannotBeManagedException
RoleCannotBeSetException
-
addAdmin
public void addAdmin(PerunSession sess, Resource resource, Group group) throws GroupNotExistsException, PrivilegeException, AlreadyAdminException, ResourceNotExistsException, RoleCannotBeManagedException, RoleCannotBeSetException Description copied from interface:ResourcesManager
Add role resource admin to group for the selected resource.- Specified by:
addAdmin
in interfaceResourcesManager
- Parameters:
sess
-resource
-group
-- Throws:
PrivilegeException
AlreadyAdminException
ResourceNotExistsException
RoleCannotBeManagedException
GroupNotExistsException
RoleCannotBeSetException
-
addResourceSelfServiceGroup
public void addResourceSelfServiceGroup(PerunSession sess, Resource resource, Group group) throws PrivilegeException, AlreadyAdminException, ResourceNotExistsException, GroupNotExistsException Description copied from interface:ResourcesManager
Sets ResourceSelfService role to given group for given resource.- Specified by:
addResourceSelfServiceGroup
in interfaceResourcesManager
- Parameters:
sess
- sessionresource
- resourcegroup
- group- Throws:
PrivilegeException
- insufficient permissionsAlreadyAdminException
- already has the roleResourceNotExistsException
GroupNotExistsException
-
addResourceSelfServiceUser
public void addResourceSelfServiceUser(PerunSession sess, Resource resource, User user) throws PrivilegeException, AlreadyAdminException, ResourceNotExistsException, UserNotExistsException Description copied from interface:ResourcesManager
Sets ResourceSelfService role to given user for given resource.- Specified by:
addResourceSelfServiceUser
in interfaceResourcesManager
- Parameters:
sess
- sessionresource
- resourceuser
- user id- Throws:
PrivilegeException
- insufficient permissionsAlreadyAdminException
- already has the roleResourceNotExistsException
UserNotExistsException
-
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:ResourcesManager
Assign group to a resource. Check if attributes for each member form group are valid. Fill members' attributes with missing value. Work in sync/async mode. Provide options for creating inactive or automatic subgroups group-resource assignments.If the group is already assigned, nothing it performed.
- Specified by:
assignGroupToResource
in interfaceResourcesManager
- Parameters:
sess
-group
-resource
-async
-assignInactive
-autoAssignSubgroups
-- Throws:
PrivilegeException
GroupNotExistsException
ResourceNotExistsException
WrongAttributeValueException
WrongReferenceAttributeValueException
GroupResourceMismatchException
-
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:ResourcesManager
Assign group to the resources. Check if attributes for each member from group are valid. Fill members' attributes with missing values. Work in sync/async mode. Provide options for creating inactive or automatic subgroups group-resource assignments.- Specified by:
assignGroupToResources
in interfaceResourcesManager
- Parameters:
perunSession
-group
- the groupresources
- list of resourcesasync
-assignInactive
-autoAssignSubgroups
-- Throws:
PrivilegeException
GroupNotExistsException
ResourceNotExistsException
WrongAttributeValueException
WrongReferenceAttributeValueException
GroupResourceMismatchException
-
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:ResourcesManager
Assign groups to a resource. Check if attributes for each member from all groups are valid. Fill members' attributes with missing values. Work in sync/async mode. Provide options for creating inactive or automatic subgroups group-resource assignments.- Specified by:
assignGroupsToResource
in interfaceResourcesManager
- Parameters:
perunSession
-groups
- list of resourcesresource
-async
-assignInactive
-autoAssignSubgroups
-- Throws:
PrivilegeException
GroupNotExistsException
ResourceNotExistsException
WrongAttributeValueException
WrongReferenceAttributeValueException
GroupResourceMismatchException
-
assignResourceTagToResource
public void assignResourceTagToResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagAlreadyAssignedException Description copied from interface:ResourcesManager
Assign existing ResourceTag on existing Resource.- Specified by:
assignResourceTagToResource
in interfaceResourcesManager
- Parameters:
perunSession
-resourceTag
-resource
-- Throws:
PrivilegeException
ResourceTagNotExistsException
ResourceNotExistsException
ResourceTagAlreadyAssignedException
-
assignResourceTagsToResource
public void assignResourceTagsToResource(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagAlreadyAssignedException Description copied from interface:ResourcesManager
Assign existing ResourceTags on existing Resource.- Specified by:
assignResourceTagsToResource
in interfaceResourcesManager
- Parameters:
perunSession
-resourceTags
-resource
-- Throws:
PrivilegeException
ResourceTagNotExistsException
ResourceNotExistsException
ResourceTagAlreadyAssignedException
-
assignService
public void assignService(PerunSession sess, Resource resource, Service service) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceAlreadyAssignedException, WrongAttributeValueException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManager
Assign service to resource.- Specified by:
assignService
in interfaceResourcesManager
- Parameters:
sess
-resource
-service
-- Throws:
PrivilegeException
ResourceNotExistsException
ServiceNotExistsException
ServiceAlreadyAssignedException
WrongAttributeValueException
WrongReferenceAttributeValueException
-
assignServices
public void assignServices(PerunSession sess, Resource resource, List<Service> services) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceAlreadyAssignedException, WrongAttributeValueException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManager
Assign services to resource.- Specified by:
assignServices
in interfaceResourcesManager
- Parameters:
sess
- perun sessionresource
- resourceservices
- services to be assigned- Throws:
PrivilegeException
ResourceNotExistsException
ServiceNotExistsException
ServiceAlreadyAssignedException
WrongAttributeValueException
WrongReferenceAttributeValueException
-
assignServicesPackage
public void assignServicesPackage(PerunSession sess, Resource resource, ServicesPackage servicesPackage) throws PrivilegeException, ResourceNotExistsException, ServicesPackageNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManager
Assign all services from services package to resouce.- Specified by:
assignServicesPackage
in interfaceResourcesManager
- Parameters:
sess
-resource
-servicesPackage
-- Throws:
PrivilegeException
ResourceNotExistsException
ServicesPackageNotExistsException
WrongAttributeValueException
WrongReferenceAttributeValueException
-
copyAttributes
public void copyAttributes(PerunSession sess, Resource sourceResource, Resource destinationResource) throws PrivilegeException, ResourceNotExistsException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManager
Copy all attributes of the source resource to the destination resource. The attributes, that are in the destination resource and aren't in the source resource, are retained. The common attributes are replaced with the attributes from the source resource. The virtual attributes are not copied.- Specified by:
copyAttributes
in interfaceResourcesManager
- Parameters:
sess
-sourceResource
-destinationResource
-- Throws:
PrivilegeException
ResourceNotExistsException
WrongReferenceAttributeValueException
-
copyGroups
public void copyGroups(PerunSession sess, Resource sourceResource, Resource destinationResource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManager
Copy all groups of the source resource to the destination resource. The groups, that are in the destination resource and aren't in the source resource, are retained. The common groups are replaced with the groups from source resource.- Specified by:
copyGroups
in interfaceResourcesManager
- Parameters:
sourceResource
-destinationResource
-- Throws:
ResourceNotExistsException
PrivilegeException
-
copyResource
public Resource copyResource(PerunSession sess, Resource templateResource, Resource destinationResource, boolean withGroups) throws ResourceNotExistsException, PrivilegeException, ResourceExistsException Description copied from interface:ResourcesManager
Copy "template" settings from user's another existing resource and create new resource with this template. The settings are attributes, services, tags (if exists), groups and their members (if the resources are from the same VO and withGroups is true) Template Resource can be from any of user's facilities.- Specified by:
copyResource
in 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:
ResourceNotExistsException
PrivilegeException
ResourceExistsException
-
copyServices
public void copyServices(PerunSession sess, Resource sourceResource, Resource destinationResource) throws ResourceNotExistsException, PrivilegeException, WrongAttributeValueException, WrongReferenceAttributeValueException Description copied from interface:ResourcesManager
Copy all services of the source resource to the destination resource. The services, that are in the destination resource and aren't in the source resource, are retained. The common services are replaced with the services from source resource.- Specified by:
copyServices
in interfaceResourcesManager
- Parameters:
sourceResource
-destinationResource
-- Throws:
ResourceNotExistsException
PrivilegeException
WrongAttributeValueException
WrongReferenceAttributeValueException
-
createResource
public Resource createResource(PerunSession sess, Resource resource, Vo vo, Facility facility) throws PrivilegeException, VoNotExistsException, FacilityNotExistsException, ResourceExistsException Description copied from interface:ResourcesManager
Inserts resource into DB.- Specified by:
createResource
in interfaceResourcesManager
- Parameters:
resource
- resource to createvo
- virtual organizationfacility
- facility- Throws:
PrivilegeException
VoNotExistsException
FacilityNotExistsException
ResourceExistsException
-
createResourceTag
public ResourceTag createResourceTag(PerunSession perunSession, ResourceTag resourceTag, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ResourcesManager
Create new Resource tag for the vo.- Specified by:
createResourceTag
in interfaceResourcesManager
- Parameters:
perunSession
-resourceTag
-vo
-- Returns:
- new created resourceTag
- Throws:
PrivilegeException
VoNotExistsException
-
deactivateGroupResourceAssignment
public void deactivateGroupResourceAssignment(PerunSession sess, Group group, Resource resource) throws PrivilegeException, ResourceNotExistsException, GroupNotExistsException, GroupNotDefinedOnResourceException, GroupResourceStatusException Description copied from interface:ResourcesManager
Deactivates the group-resource assignment. The assignment will become INACTIVE and will not be used to allow users from the given group to the resource.- Specified by:
deactivateGroupResourceAssignment
in 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:ResourcesManager
Deletes all resources for the VO.- Specified by:
deleteAllResources
in interfaceResourcesManager
- Parameters:
sess
-vo
-- Throws:
PrivilegeException
ResourceAlreadyRemovedException
- 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:ResourcesManager
Delete all ResourcesTags for specific VO.- Specified by:
deleteAllResourcesTagsForVo
in interfaceResourcesManager
- Parameters:
perunSession
-vo
-- Throws:
PrivilegeException
VoNotExistsException
- ¨ResourceTagAlreadyAssignedException
-
deleteResource
public void deleteResource(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException, ResourceAlreadyRemovedException, GroupAlreadyRemovedFromResourceException, FacilityNotExistsException Description copied from interface:ResourcesManager
Deletes resource by id.- Specified by:
deleteResource
in interfaceResourcesManager
- Parameters:
sess
-resource
-- Throws:
ResourceNotExistsException
PrivilegeException
ResourceAlreadyRemovedException
- 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:ResourcesManager
Delete existing Resource tag.- Specified by:
deleteResourceTag
in interfaceResourcesManager
- Parameters:
perunSession
-resourceTag
-- Throws:
PrivilegeException
VoNotExistsException
ResourceTagAlreadyAssignedException
ResourceTagNotExistsException
-
getAdminGroups
public List<Group> getAdminGroups(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManager
Gets list of all group administrators of the Resource.- Specified by:
getAdminGroups
in interfaceResourcesManager
- Parameters:
sess
-resource
-- Returns:
- list of Group that are admins in the resource.
- Throws:
PrivilegeException
ResourceNotExistsException
-
getAdmins
public List<User> getAdmins(PerunSession perunSession, Resource resource, boolean onlyDirectAdmins) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManager
Gets list of all user administrators of the Resource. If some group is administrator of the given resource, all VALID members are included in the list.If onlyDirectAdmins is true, return only direct users of the group for supported role.
Supported roles: ResourceAdmin, VOAdmin
- Specified by:
getAdmins
in 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:
PrivilegeException
ResourceNotExistsException
-
getAllResources
Description copied from interface:ResourcesManager
Get all resources from database. Returned resources are filtered based on the principal rights.- Specified by:
getAllResources
in 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:ResourcesManager
Get all resources in specific Vo (specific by resourceTag.getVoId) for existing resourceTag- Specified by:
getAllResourcesByResourceTag
in interfaceResourcesManager
- Parameters:
perunSession
-resourceTag
-- Returns:
- list of Resources
- Throws:
PrivilegeException
VoNotExistsException
ResourceTagNotExistsException
- ¨
-
getAllResourcesTagsForResource
public List<ResourceTag> getAllResourcesTagsForResource(PerunSession perunSession, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManager
Get all resourcesTags for existing Resource- Specified by:
getAllResourcesTagsForResource
in interfaceResourcesManager
- Parameters:
perunSession
-resource
-- Returns:
- list of ResourcesTags
- Throws:
ResourceNotExistsException
PrivilegeException
-
getAllResourcesTagsForVo
public List<ResourceTag> getAllResourcesTagsForVo(PerunSession perunSession, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ResourcesManager
Get all resourcesTags for existing Vo.- Specified by:
getAllResourcesTagsForVo
in interfaceResourcesManager
- Parameters:
perunSession
-vo
-- Returns:
- list of all resourcesTags for existing Vo
- Throws:
PrivilegeException
VoNotExistsException
- ¨
-
getAllowedMembers
public List<Member> getAllowedMembers(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManager
Returns all members assigned to the resource.- Specified by:
getAllowedMembers
in interfaceResourcesManager
- Parameters:
sess
-resource
-- Returns:
- list of members assigned to the resource
- Throws:
ResourceNotExistsException
PrivilegeException
-
getAllowedResources
public List<Resource> getAllowedResources(PerunSession sess, Member member) throws MemberNotExistsException, PrivilegeException Description copied from interface:ResourcesManager
Get all resources which have the member access on.- Specified by:
getAllowedResources
in interfaceResourcesManager
- Parameters:
sess
-member
-- Returns:
- list of resources which have the member acess on
- Throws:
MemberNotExistsException
PrivilegeException
-
getAllowedUsers
public List<User> getAllowedUsers(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManager
Returns all users who is assigned with the resource.- Specified by:
getAllowedUsers
in interfaceResourcesManager
- Parameters:
sess
-resource
-- Returns:
- list of users
- Throws:
ResourceNotExistsException
PrivilegeException
-
getAssignedGroups
public List<Group> getAssignedGroups(PerunSession sess, Resource resource) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManager
List all groups associated with the resource.- Specified by:
getAssignedGroups
in interfaceResourcesManager
- Parameters:
sess
-resource
-- Returns:
- list of assigned group
- Throws:
PrivilegeException
ResourceNotExistsException
-
getAssignedGroups
public List<Group> getAssignedGroups(PerunSession sess, Resource resource, Member member) throws PrivilegeException, ResourceNotExistsException, MemberNotExistsException Description copied from interface:ResourcesManager
List all groups associated with the resource and member- Specified by:
getAssignedGroups
in interfaceResourcesManager
- Parameters:
sess
-resource
-member
-- Returns:
- list of assigned groups associated with the resource and member
- Throws:
PrivilegeException
ResourceNotExistsException
MemberNotExistsException
-
getAssignedMembers
public List<Member> getAssignedMembers(PerunSession sess, Resource resource) throws PrivilegeException Description copied from interface:ResourcesManager
Returns all members assigned to the resource.- Specified by:
getAssignedMembers
in 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:ResourcesManager
Returns members of groups assigned to resource with status of group-resource assignment.- Specified by:
getAssignedMembersWithStatus
in 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:ResourcesManager
List all resources to which the group is assigned.- Specified by:
getAssignedResources
in interfaceResourcesManager
- Parameters:
sess
-group
-- Returns:
- list of assigned resources
- Throws:
GroupNotExistsException
PrivilegeException
-
getAssignedResources
public List<Resource> getAssignedResources(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:ResourcesManager
Get all resources where the member is assigned.- Specified by:
getAssignedResources
in interfaceResourcesManager
- Parameters:
sess
-member
-- Returns:
- Throws:
PrivilegeException
MemberNotExistsException
-
getAssignedResources
public List<Resource> getAssignedResources(PerunSession sess, Member member, Service service) throws PrivilegeException, MemberNotExistsException, ServiceNotExistsException Description copied from interface:ResourcesManager
Get all resources where the member and the service are assigned.- Specified by:
getAssignedResources
in interfaceResourcesManager
- Parameters:
sess
-member
-service
-- Returns:
- list of resources
- Throws:
PrivilegeException
MemberNotExistsException
ServiceNotExistsException
-
getAssignedResourcesWithStatus
public List<AssignedResource> getAssignedResourcesWithStatus(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:ResourcesManager
Returns all assigned resources where member is assigned through the groups.- Specified by:
getAssignedResourcesWithStatus
in interfaceResourcesManager
- Parameters:
sess
- perun sessionmember
- member- Returns:
- list of assigned resources
- Throws:
PrivilegeException
MemberNotExistsException
- if the member does not exist
-
getAssignedRichMembers
public List<RichMember> getAssignedRichMembers(PerunSession sess, Resource resource) throws PrivilegeException Description copied from interface:ResourcesManager
Returns all members assigned to the resource as RichMembers.- Specified by:
getAssignedRichMembers
in 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:ResourcesManager
List all rich resources associated with the group with facility property filled.- Specified by:
getAssignedRichResources
in interfaceResourcesManager
- Parameters:
sess
-group
-- Returns:
- list of assigned rich resources
- Throws:
GroupNotExistsException
PrivilegeException
-
getAssignedRichResources
public List<RichResource> getAssignedRichResources(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:ResourcesManager
Get all rich resources where the member is assigned with facility property filled.- Specified by:
getAssignedRichResources
in interfaceResourcesManager
- Parameters:
sess
-member
-- Returns:
- list of rich resources
- Throws:
PrivilegeException
MemberNotExistsException
-
getAssignedRichResources
public List<RichResource> getAssignedRichResources(PerunSession sess, Member member, Service service) throws PrivilegeException, MemberNotExistsException, ServiceNotExistsException Description copied from interface:ResourcesManager
Get all rich resources where the service and the member are assigned with facility property filled.- Specified by:
getAssignedRichResources
in interfaceResourcesManager
- Parameters:
sess
-member
-service
-- Returns:
- list of rich resources
- Throws:
PrivilegeException
MemberNotExistsException
ServiceNotExistsException
-
getAssignedServices
public List<Service> getAssignedServices(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException Description copied from interface:ResourcesManager
List all services associated with the resource.- Specified by:
getAssignedServices
in interfaceResourcesManager
- Parameters:
sess
-resource
-- Returns:
- list of assigned resources
- Throws:
ResourceNotExistsException
PrivilegeException
-
getBan
public BanOnResource getBan(PerunSession sess, int memberId, int resourceId) throws BanNotExistsException, PrivilegeException, MemberNotExistsException, ResourceNotExistsException Description copied from interface:ResourcesManager
Get ban by memberId and resource id- Specified by:
getBan
in interfaceResourcesManager
- Parameters:
sess
-memberId
- the id of memberresourceId
- the id of resource- Returns:
- specific ban for member on resource
- Throws:
BanNotExistsException
PrivilegeException
MemberNotExistsException
ResourceNotExistsException
-
getBanById
public BanOnResource getBanById(PerunSession sess, int banId) throws BanNotExistsException, PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManager
Get Ban for member on resource by it's id- Specified by:
getBanById
in interfaceResourcesManager
- Parameters:
sess
-banId
- the id of ban- Returns:
- resource ban by it's id
- Throws:
BanNotExistsException
PrivilegeException
ResourceNotExistsException
-
getBansForMember
public List<BanOnResource> getBansForMember(PerunSession sess, int memberId) throws MemberNotExistsException, ResourceNotExistsException Description copied from interface:ResourcesManager
Get all bans for member on any resource.- Specified by:
getBansForMember
in interfaceResourcesManager
- Parameters:
sess
-memberId
- the id of member- Returns:
- list of bans for member on any resource
- Throws:
MemberNotExistsException
ResourceNotExistsException
-
getBansForResource
public List<BanOnResource> getBansForResource(PerunSession sess, int resourceId) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManager
Get all bans for members on the resource.- Specified by:
getBansForResource
in interfaceResourcesManager
- Parameters:
sess
-resourceId
- the id of resource- Returns:
- list of all members bans on the resource
- Throws:
PrivilegeException
ResourceNotExistsException
-
getEnrichedBansForResource
public List<EnrichedBanOnResource> getEnrichedBansForResource(PerunSession sess, int resourceId, List<String> attrNames) throws PrivilegeException, ResourceNotExistsException, AttributeNotExistsException Description copied from interface:ResourcesManager
Get all enriched bans for members on the resource.- Specified by:
getEnrichedBansForResource
in 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:
PrivilegeException
ResourceNotExistsException
AttributeNotExistsException
-
getEnrichedBansForUser
public List<EnrichedBanOnResource> getEnrichedBansForUser(PerunSession sess, int userId, List<String> attrNames) throws PrivilegeException, UserNotExistsException, AttributeNotExistsException Description copied from interface:ResourcesManager
Get all enriched bans on resources for user.- Specified by:
getEnrichedBansForUser
in interfaceResourcesManager
- Parameters:
sess
-userId
- id of user- Returns:
- attrNames list of attributes names, returns all user/member attributes if null or empty
- Throws:
PrivilegeException
UserNotExistsException
AttributeNotExistsException
-
getEnrichedResourceById
public EnrichedResource getEnrichedResourceById(PerunSession sess, int id, List<String> attrNames) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManager
Find resource for given id and returns it with given attributes. If attrNames are null or empty, all resource attributes are returned.- Specified by:
getEnrichedResourceById
in 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:ResourcesManager
Find resources for given facility and attributes for given names. If the attrNames are empty or null, return all attributes.- Specified by:
getEnrichedResourcesForFacility
in 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:ResourcesManager
Find resources for given vo and attributes for given names. If the attrNames are empty or null, return all attributes.- Specified by:
getEnrichedResourcesForVo
in 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:ResourcesManager
Get facility which belongs to the concrete resource.- Specified by:
getFacility
in interfaceResourcesManager
- Parameters:
sess
-resource
-- Returns:
- facility belonging to the resource
- Throws:
ResourceNotExistsException
PrivilegeException
-
getGroupAssignments
public List<AssignedGroup> getGroupAssignments(PerunSession sess, Resource resource, List<String> attrNames) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManager
Lists all of the assigned groups for the given resource. Also, returns specified attributes for the groups. If attrNames are null, all group attributes are returned.- Specified by:
getGroupAssignments
in 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:ResourcesManager
Return all rich resources with mailing service(s) where given member is assigned.- Specified by:
getMailingServiceRichResourcesWithMember
in 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:ResourcesManager
Lists all of the resource assignments for the given group. Also, returns specified attributes and resource tags for the resources. If attrNames are null or empty, all resource attributes are returned.- Specified by:
getResourceAssignments
in 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:ResourcesManager
Searches for the Resource with specified id.- Specified by:
getResourceById
in interfaceResourcesManager
- Parameters:
sess
-id
-- Returns:
- Resource with specified id
- Throws:
PrivilegeException
ResourceNotExistsException
-
getResourceByName
public Resource getResourceByName(PerunSession sess, Vo vo, Facility facility, String name) throws PrivilegeException, ResourceNotExistsException, VoNotExistsException, FacilityNotExistsException Description copied from interface:ResourcesManager
Return resource by its name.- Specified by:
getResourceByName
in interfaceResourcesManager
- Parameters:
sess
-vo
-facility
-name
-- Returns:
- resource
- Throws:
PrivilegeException
ResourceNotExistsException
VoNotExistsException
FacilityNotExistsException
-
getResources
public List<Resource> getResources(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ResourcesManager
Get all VO resources. If called by resourceAdmin it returns only those resources of which is he admin.- Specified by:
getResources
in interfaceResourcesManager
- Parameters:
sess
-vo
-- Returns:
- list of resources
- Throws:
PrivilegeException
VoNotExistsException
-
getResourcesByIds
public List<Resource> getResourcesByIds(PerunSession sess, List<Integer> ids) throws PrivilegeException Description copied from interface:ResourcesManager
Search for the Resources with specific ids.- Specified by:
getResourcesByIds
in 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:ResourcesManager
Get all VO resources count.- Specified by:
getResourcesCount
in interfaceResourcesManager
- Parameters:
sess
-vo
-- Returns:
- count of vo resources
- Throws:
PrivilegeException
VoNotExistsException
-
getResourcesCount
Description copied from interface:ResourcesManager
Get count of all resources.- Specified by:
getResourcesCount
in 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:ResourcesManager
Return all resources for the facility and the vo where the group is authorized as resource manager.- Specified by:
getResourcesWhereGroupIsAdmin
in 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:
PrivilegeException
GroupNotExistsException
FacilityNotExistsException
VoNotExistsException
-
getResourcesWhereUserIsAdmin
public List<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, User user) throws UserNotExistsException, PrivilegeException Description copied from interface:ResourcesManager
Returns list of resources, where the user is an admin. Including resources, where the user is a VALID member of authorized group.- Specified by:
getResourcesWhereUserIsAdmin
in interfaceResourcesManager
- Parameters:
sess
-user
-- Returns:
- list of resources, where the user is an admin.
- Throws:
UserNotExistsException
PrivilegeException
-
getResourcesWhereUserIsAdmin
public List<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, Facility facility, Vo vo, User authorizedUser) throws PrivilegeException, UserNotExistsException, FacilityNotExistsException, VoNotExistsException Description copied from interface:ResourcesManager
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.- Specified by:
getResourcesWhereUserIsAdmin
in 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:
PrivilegeException
UserNotExistsException
FacilityNotExistsException
VoNotExistsException
-
getResourcesWhereUserIsAdmin
public List<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, Vo vo, User authorizedUser) throws PrivilegeException, UserNotExistsException, VoNotExistsException Description copied from interface:ResourcesManager
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.- Specified by:
getResourcesWhereUserIsAdmin
in 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:
PrivilegeException
UserNotExistsException
VoNotExistsException
-
getRichAdmins
public List<RichUser> getRichAdmins(PerunSession perunSession, Resource resource, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) throws UserNotExistsException, PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManager
Gets list of all richUser administrators of the Resource. If some group is administrator of the given resource, all VALID members are included in the list.Supported roles: ResourceAdmin, VOAdmin
If "onlyDirectAdmins" is "true", return only direct users of the group for supported role with specific attributes. If "allUserAttributes" is "true", do not specify attributes through list and return them all in objects richUser . Ignoring list of specific attributes.
- Specified by:
getRichAdmins
in 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:
UserNotExistsException
PrivilegeException
ResourceNotExistsException
-
getRichResourceById
public RichResource getRichResourceById(PerunSession sess, int id) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManager
Search for the RichResource with specific id.- Specified by:
getRichResourceById
in interfaceResourcesManager
- Parameters:
sess
-id
-- Returns:
- RichResource with specified id
- Throws:
PrivilegeException
ResourceNotExistsException
-
getRichResources
public List<RichResource> getRichResources(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:ResourcesManager
Get all VO rich resources with facility property filled. If called by resourceAdmin it returns only those resources of which is he admin.- Specified by:
getRichResources
in interfaceResourcesManager
- Parameters:
sess
-vo
-- Returns:
- list of rich resources
- Throws:
PrivilegeException
VoNotExistsException
-
getRichResourcesByIds
public List<RichResource> getRichResourcesByIds(PerunSession sess, List<Integer> ids) throws PrivilegeException Description copied from interface:ResourcesManager
Search for the RichResources with specific ids.- Specified by:
getRichResourcesByIds
in 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:ResourcesManager
Get Vo which is tied to specified resource.- Specified by:
getVo
in interfaceResourcesManager
- Parameters:
sess
-resource
-- Returns:
- vo tied to specified resource
- Throws:
ResourceNotExistsException
PrivilegeException
-
removeAdmin
public void removeAdmin(PerunSession sess, Resource resource, User user) throws UserNotExistsException, PrivilegeException, UserNotAdminException, ResourceNotExistsException, RoleCannotBeManagedException Description copied from interface:ResourcesManager
Remove role resource admin from user for the selected resource.- Specified by:
removeAdmin
in interfaceResourcesManager
- Parameters:
sess
-resource
-user
-- Throws:
UserNotExistsException
PrivilegeException
ResourceNotExistsException
UserNotAdminException
RoleCannotBeManagedException
-
removeAdmin
public void removeAdmin(PerunSession sess, Resource resource, Group group) throws GroupNotExistsException, PrivilegeException, GroupNotAdminException, ResourceNotExistsException, RoleCannotBeManagedException Description copied from interface:ResourcesManager
Remove role resource admin from group for the selected resource.- Specified by:
removeAdmin
in interfaceResourcesManager
- Parameters:
sess
-resource
-group
-- Throws:
GroupNotExistsException
PrivilegeException
GroupNotAdminException
ResourceNotExistsException
RoleCannotBeManagedException
-
removeAllResourcesTagFromResource
public void removeAllResourcesTagFromResource(PerunSession perunSession, Resource resource) throws PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManager
Remove all Resource tags for specific resource.- Specified by:
removeAllResourcesTagFromResource
in interfaceResourcesManager
- Parameters:
perunSession
-resource
-- Throws:
PrivilegeException
ResourceNotExistsException
-
removeBan
public void removeBan(PerunSession sess, int banId) throws PrivilegeException, BanNotExistsException, ResourceNotExistsException Description copied from interface:ResourcesManager
Remove specific ban by it's id.- Specified by:
removeBan
in interfaceResourcesManager
- Parameters:
sess
-banId
- the id of ban- Throws:
PrivilegeException
BanNotExistsException
ResourceNotExistsException
-
removeBan
public void removeBan(PerunSession sess, int memberId, int resourceId) throws BanNotExistsException, PrivilegeException, ResourceNotExistsException Description copied from interface:ResourcesManager
Remove specific ban by memberId and resourceId.- Specified by:
removeBan
in interfaceResourcesManager
- Parameters:
sess
-memberId
- the id of memberresourceId
- the id of resource- Throws:
BanNotExistsException
PrivilegeException
ResourceNotExistsException
-
removeGroupFromResource
public void removeGroupFromResource(PerunSession sess, Group group, Resource resource) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, GroupNotDefinedOnResourceException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManager
Remove group from a resource. After removing, check attributes and fix them if it is needed.- Specified by:
removeGroupFromResource
in interfaceResourcesManager
- Parameters:
sess
-group
-resource
-- Throws:
PrivilegeException
ResourceNotExistsException
GroupNotDefinedOnResourceException
- 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:ResourcesManager
Remove group from the resources. After removing, check attributes and fix them if it is needed.- Specified by:
removeGroupFromResources
in interfaceResourcesManager
- Parameters:
perunSession
-group
- list of groupsresources
- list of resources- Throws:
PrivilegeException
GroupNotExistsException
ResourceNotExistsException
GroupNotDefinedOnResourceException
GroupAlreadyRemovedFromResourceException
-
removeGroupsFromResource
public void removeGroupsFromResource(PerunSession perunSession, List<Group> groups, Resource resource) throws PrivilegeException, GroupNotExistsException, ResourceNotExistsException, GroupNotDefinedOnResourceException, GroupAlreadyRemovedFromResourceException Description copied from interface:ResourcesManager
Remove groups from a resource. After removing, check attributes and fix them if it is needed.- Specified by:
removeGroupsFromResource
in interfaceResourcesManager
- Parameters:
perunSession
-groups
- list of groupsresource
-- Throws:
PrivilegeException
GroupNotExistsException
ResourceNotExistsException
GroupNotDefinedOnResourceException
GroupAlreadyRemovedFromResourceException
-
removeResourceSelfServiceGroup
public void removeResourceSelfServiceGroup(PerunSession sess, Resource resource, Group group) throws PrivilegeException, GroupNotAdminException, ResourceNotExistsException, GroupNotExistsException Description copied from interface:ResourcesManager
Unset ResourceSelfService role to given group for given resource.- Specified by:
removeResourceSelfServiceGroup
in interfaceResourcesManager
- Parameters:
sess
- sessionresource
- resourcegroup
- group- Throws:
PrivilegeException
- insufficient permissionsGroupNotAdminException
- group did not have the roleResourceNotExistsException
GroupNotExistsException
-
removeResourceSelfServiceUser
public void removeResourceSelfServiceUser(PerunSession sess, Resource resource, User user) throws PrivilegeException, UserNotAdminException, ResourceNotExistsException, UserNotExistsException Description copied from interface:ResourcesManager
Unset ResourceSelfService role to given user for given resource.- Specified by:
removeResourceSelfServiceUser
in interfaceResourcesManager
- Parameters:
sess
- sessionresource
- resourceuser
- user- Throws:
PrivilegeException
- insufficient permissionsUserNotAdminException
- user did not have the roleResourceNotExistsException
UserNotExistsException
-
removeResourceTagFromResource
public void removeResourceTagFromResource(PerunSession perunSession, ResourceTag resourceTag, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagNotAssignedException Description copied from interface:ResourcesManager
Remove specific ResourceTag from existing Resource.- Specified by:
removeResourceTagFromResource
in interfaceResourcesManager
- Parameters:
perunSession
-resourceTag
-resource
-- Throws:
PrivilegeException
ResourceTagNotExistsException
ResourceNotExistsException
ResourceTagNotAssignedException
-
removeResourceTagsFromResource
public void removeResourceTagsFromResource(PerunSession perunSession, List<ResourceTag> resourceTags, Resource resource) throws PrivilegeException, ResourceTagNotExistsException, ResourceNotExistsException, ResourceTagNotAssignedException Description copied from interface:ResourcesManager
Remove specific ResourceTags from existing Resource.- Specified by:
removeResourceTagsFromResource
in interfaceResourcesManager
- Parameters:
perunSession
-resourceTags
-resource
-- Throws:
PrivilegeException
ResourceTagNotExistsException
ResourceNotExistsException
ResourceTagNotAssignedException
-
removeService
public void removeService(PerunSession sess, Resource resource, Service service) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceNotAssignedException Description copied from interface:ResourcesManager
Remove service from resource.- Specified by:
removeService
in interfaceResourcesManager
- Parameters:
sess
-resource
-service
-- Throws:
PrivilegeException
ResourceNotExistsException
ServiceNotExistsException
ServiceNotAssignedException
-
removeService
public void removeService(PerunSession perunSession, List<Resource> resources, Service service) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceNotAssignedException, FacilityNotExistsException, FacilityMismatchException Description copied from interface:ResourcesManager
Remove service from multiple resources in the same facility- Specified by:
removeService
in interfaceResourcesManager
- Parameters:
perunSession
-resources
-service
-- Throws:
PrivilegeException
ResourceNotExistsException
ServiceNotExistsException
ServiceNotAssignedException
FacilityNotExistsException
FacilityMismatchException
-
removeServices
public void removeServices(PerunSession sess, Resource resource, List<Service> services) throws PrivilegeException, ResourceNotExistsException, ServiceNotExistsException, ServiceNotAssignedException Description copied from interface:ResourcesManager
Remove services from resource.- Specified by:
removeServices
in interfaceResourcesManager
- Parameters:
sess
-resource
-services
-- Throws:
PrivilegeException
ResourceNotExistsException
ServiceNotExistsException
ServiceNotAssignedException
-
removeServicesPackage
public void removeServicesPackage(PerunSession sess, Resource resource, ServicesPackage servicesPackage) throws PrivilegeException, ResourceNotExistsException, ServicesPackageNotExistsException Description copied from interface:ResourcesManager
Remove from resource all services from services package.- Specified by:
removeServicesPackage
in interfaceResourcesManager
- Parameters:
sess
-resource
-servicesPackage
-- Throws:
PrivilegeException
ResourceNotExistsException
ServicesPackageNotExistsException
-
setBan
public BanOnResource setBan(PerunSession sess, BanOnResource banOnResource) throws PrivilegeException, BanAlreadyExistsException, ResourceNotExistsException Description copied from interface:ResourcesManager
Set ban for member on resource.- Specified by:
setBan
in interfaceResourcesManager
- Parameters:
sess
-banOnResource
- the ban- Returns:
- ban on resource
- Throws:
PrivilegeException
BanAlreadyExistsException
ResourceNotExistsException
-
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:ResourcesManager
Update existing ban (description, validation timestamp)- Specified by:
updateBan
in interfaceResourcesManager
- Parameters:
sess
-banOnResource
- the specific ban- Returns:
- updated ban
- Throws:
PrivilegeException
MemberNotExistsException
BanNotExistsException
ResourceNotExistsException
-
updateResource
public Resource updateResource(PerunSession sess, Resource resource) throws ResourceNotExistsException, PrivilegeException, ResourceExistsException Description copied from interface:ResourcesManager
Updates Resource.- Specified by:
updateResource
in interfaceResourcesManager
- Parameters:
sess
-resource
-- Returns:
- returns updated Resource
- Throws:
ResourceNotExistsException
PrivilegeException
ResourceExistsException
-
updateResourceTag
public ResourceTag updateResourceTag(PerunSession perunSession, ResourceTag resourceTag) throws PrivilegeException, ResourceTagNotExistsException, VoNotExistsException Description copied from interface:ResourcesManager
Update existing Resource tag.- Specified by:
updateResourceTag
in interfaceResourcesManager
- Parameters:
perunSession
-resourceTag
-- Returns:
- updated ResourceTag
- Throws:
PrivilegeException
ResourceTagNotExistsException
VoNotExistsException
-