use of cz.metacentrum.perun.core.api.exceptions.GroupResourceStatusException in project perun by CESNET.
the class ResourcesManagerBlImpl method deactivateGroupResourceAssignment.
@Override
public void deactivateGroupResourceAssignment(PerunSession sess, Group group, Resource resource) throws GroupNotDefinedOnResourceException, GroupResourceStatusException {
GroupResourceStatus status = getResourcesManagerImpl().getGroupResourceStatus(sess, group, resource);
if (status == GroupResourceStatus.PROCESSING) {
throw new GroupResourceStatusException("Cannot deactivate an assignment in PROCESSING state.");
}
getResourcesManagerImpl().setGroupResourceStatus(sess, group, resource, GroupResourceStatus.INACTIVE);
getPerunBl().getAuditer().log(sess, new GroupRemovedFromResource(group, resource));
// reset assignment failure cause
getResourcesManagerImpl().setFailedGroupResourceAssignmentCause(sess, group, resource, null);
}
Aggregations