Class ResourceAssignmentChecker

java.lang.Object
cz.metacentrum.perun.core.impl.ResourceAssignmentChecker

public class ResourceAssignmentChecker extends Object
This component is periodically called to search for and fix inconsistencies in automatic group-resource assignments.
Author:
Johana Supikova <xsupikov@fi.muni.cz>
  • Constructor Details

    • ResourceAssignmentChecker

      public ResourceAssignmentChecker(PerunBl perunBl)
  • 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

      public PerunBl 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

      public void setPerunBl(PerunBl perunBl)