Package cz.metacentrum.perun.core.impl
Class ResourceAssignmentChecker
java.lang.Object
cz.metacentrum.perun.core.impl.ResourceAssignmentChecker
This component is periodically called to search for and fix inconsistencies in automatic group-resource assignments.
- Author:
- Johana Supikova invalid input: '<'xsupikov@fi.muni.cz>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
assignSubgroupsToResource
(Resource resource, List<AssignedGroup> automaticallyAssignedSubgroups, AssignedGroup sourceGroup) Filter subgroups of source group (with autoassign) which are not assigned and assign them.void
Waits for 10 minutes after Perun startup and then every hour checks, if all group-resource assignments are consistent, e.g. all subgroups are automatically assigned and no automatic subgroups assignments are kept after removing source group.void
removeSubgroupFromResource
(Resource resource, List<AssignedGroup> sourceGroups, AssignedGroup assignedSubgroup) Remove assigned subgroup which source group is not assigned as source group.void
setPerunBl
(PerunBl perunBl)
-
Constructor Details
-
ResourceAssignmentChecker
-
-
Method Details
-
assignSubgroupsToResource
public void assignSubgroupsToResource(Resource resource, List<AssignedGroup> automaticallyAssignedSubgroups, AssignedGroup sourceGroup) Filter subgroups of source group (with autoassign) which are not assigned and assign them. Runs in transaction.- Parameters:
resource
-automaticallyAssignedSubgroups
-sourceGroup
-
-
fixInconsistentGroupResourceAssignments
@Scheduled(initialDelay=600000L, fixedDelay=3600000L) public void fixInconsistentGroupResourceAssignments()Waits for 10 minutes after Perun startup and then every hour checks, if all group-resource assignments are consistent, e.g. all subgroups are automatically assigned and no automatic subgroups assignments are kept after removing source group. -
getPerunBl
-
removeSubgroupFromResource
public void removeSubgroupFromResource(Resource resource, List<AssignedGroup> sourceGroups, AssignedGroup assignedSubgroup) Remove assigned subgroup which source group is not assigned as source group. Runs in transaction.- Parameters:
resource
-sourceGroups
-assignedSubgroup
-
-
setPerunBl
-