Search in sources :

Example 1 with MemberExpired

use of cz.metacentrum.perun.audit.events.MembersManagerEvents.MemberExpired in project perun by CESNET.

the class urn_perun_member_attribute_def_def_suspensionInfo method resolveVirtualAttributeValueChange.

@Override
public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl session, AuditEvent message) throws WrongReferenceAttributeValueException, WrongAttributeAssignmentException {
    Member member = null;
    if (message instanceof MemberValidated) {
        member = ((MemberValidated) message).getMember();
    } else if (message instanceof MemberDisabled) {
        member = ((MemberDisabled) message).getMember();
    } else if (message instanceof MemberExpired) {
        member = ((MemberExpired) message).getMember();
    }
    clearSuspensionInfo(session, member);
    return new ArrayList<>();
}
Also used : MemberValidated(cz.metacentrum.perun.audit.events.MembersManagerEvents.MemberValidated) ArrayList(java.util.ArrayList) MemberExpired(cz.metacentrum.perun.audit.events.MembersManagerEvents.MemberExpired) MemberDisabled(cz.metacentrum.perun.audit.events.MembersManagerEvents.MemberDisabled) Member(cz.metacentrum.perun.core.api.Member)

Example 2 with MemberExpired

use of cz.metacentrum.perun.audit.events.MembersManagerEvents.MemberExpired in project perun by CESNET.

the class MembersManagerBlImpl method expireMember.

@Override
public Member expireMember(PerunSession sess, Member member) throws WrongReferenceAttributeValueException, WrongAttributeValueException {
    // this method run in nested transaction
    if (this.haveStatus(sess, member, Status.EXPIRED)) {
        log.debug("Trying to set member expired but he's already expired. " + member);
        return member;
    }
    Status oldStatus = member.getStatus();
    getMembersManagerImpl().setStatus(sess, member, Status.EXPIRED);
    member.setStatus(Status.EXPIRED);
    getPerunBl().getAuditer().log(sess, new MemberExpired(member));
    // We need to check validity of attributes first (expired member has to have valid attributes)
    if (oldStatus.equals(Status.INVALID) || oldStatus.equals(Status.DISABLED)) {
        try {
            getPerunBl().getAttributesManagerBl().doTheMagic(sess, member);
        } catch (Exception ex) {
            // return old status to object to prevent incorrect result in higher methods
            member.setStatus(oldStatus);
            throw ex;
        }
    }
    return member;
}
Also used : MemberGroupStatus(cz.metacentrum.perun.core.api.MemberGroupStatus) Status(cz.metacentrum.perun.core.api.Status) MemberExpired(cz.metacentrum.perun.audit.events.MembersManagerEvents.MemberExpired) NamespaceRulesNotExistsException(cz.metacentrum.perun.core.api.exceptions.NamespaceRulesNotExistsException) RelationExistsException(cz.metacentrum.perun.core.api.exceptions.RelationExistsException) MemberAlreadyRemovedException(cz.metacentrum.perun.core.api.exceptions.MemberAlreadyRemovedException) PasswordCreationFailedException(cz.metacentrum.perun.core.api.exceptions.PasswordCreationFailedException) ExtSourceNotExistsException(cz.metacentrum.perun.core.api.exceptions.ExtSourceNotExistsException) AttributeNotExistsException(cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException) RoleCannotBeManagedException(cz.metacentrum.perun.core.api.exceptions.RoleCannotBeManagedException) IntrospectionException(java.beans.IntrospectionException) InvocationTargetException(java.lang.reflect.InvocationTargetException) GroupResourceMismatchException(cz.metacentrum.perun.core.api.exceptions.GroupResourceMismatchException) MemberNotSponsoredException(cz.metacentrum.perun.core.api.exceptions.MemberNotSponsoredException) AlreadySponsorException(cz.metacentrum.perun.core.api.exceptions.AlreadySponsorException) WrongAttributeAssignmentException(cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException) MemberResourceMismatchException(cz.metacentrum.perun.core.api.exceptions.MemberResourceMismatchException) ExtSourceUnsupportedOperationException(cz.metacentrum.perun.core.api.exceptions.ExtSourceUnsupportedOperationException) GroupNotExistsException(cz.metacentrum.perun.core.api.exceptions.GroupNotExistsException) MemberGroupMismatchException(cz.metacentrum.perun.core.api.exceptions.MemberGroupMismatchException) IllegalArgumentException(cz.metacentrum.perun.core.api.exceptions.IllegalArgumentException) UserExtSourceExistsException(cz.metacentrum.perun.core.api.exceptions.UserExtSourceExistsException) AlreadyAdminException(cz.metacentrum.perun.core.api.exceptions.AlreadyAdminException) IOException(java.io.IOException) AlreadyMemberException(cz.metacentrum.perun.core.api.exceptions.AlreadyMemberException) ExtendMembershipException(cz.metacentrum.perun.core.api.exceptions.ExtendMembershipException) InvalidLoginException(cz.metacentrum.perun.core.api.exceptions.InvalidLoginException) RoleManagementRulesNotExistsException(cz.metacentrum.perun.core.api.exceptions.RoleManagementRulesNotExistsException) BanAlreadyExistsException(cz.metacentrum.perun.core.api.exceptions.BanAlreadyExistsException) InvalidSponsoredUserDataException(cz.metacentrum.perun.core.api.exceptions.InvalidSponsoredUserDataException) UserExtSourceNotExistsException(cz.metacentrum.perun.core.api.exceptions.UserExtSourceNotExistsException) InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException) MemberNotExistsException(cz.metacentrum.perun.core.api.exceptions.MemberNotExistsException) AlreadySponsoredMemberException(cz.metacentrum.perun.core.api.exceptions.AlreadySponsoredMemberException) LoginNotExistsException(cz.metacentrum.perun.core.api.exceptions.LoginNotExistsException) MemberNotValidYetException(cz.metacentrum.perun.core.api.exceptions.MemberNotValidYetException) SubjectNotExistsException(cz.metacentrum.perun.core.api.exceptions.SubjectNotExistsException) CandidateNotExistsException(cz.metacentrum.perun.core.api.exceptions.CandidateNotExistsException) ConsistencyErrorException(cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException) PasswordStrengthException(cz.metacentrum.perun.core.api.exceptions.PasswordStrengthException) ParentGroupNotExistsException(cz.metacentrum.perun.core.api.exceptions.ParentGroupNotExistsException) NotGroupMemberException(cz.metacentrum.perun.core.api.exceptions.NotGroupMemberException) SponsorshipDoesNotExistException(cz.metacentrum.perun.core.api.exceptions.SponsorshipDoesNotExistException) AttributeValueException(cz.metacentrum.perun.core.api.exceptions.AttributeValueException) UserNotInRoleException(cz.metacentrum.perun.core.api.exceptions.UserNotInRoleException) WrongReferenceAttributeValueException(cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException) WrongAttributeValueException(cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException) BanNotExistsException(cz.metacentrum.perun.core.api.exceptions.BanNotExistsException) VoNotExistsException(cz.metacentrum.perun.core.api.exceptions.VoNotExistsException) UserNotExistsException(cz.metacentrum.perun.core.api.exceptions.UserNotExistsException)

Aggregations

MemberExpired (cz.metacentrum.perun.audit.events.MembersManagerEvents.MemberExpired)2 MemberDisabled (cz.metacentrum.perun.audit.events.MembersManagerEvents.MemberDisabled)1 MemberValidated (cz.metacentrum.perun.audit.events.MembersManagerEvents.MemberValidated)1 Member (cz.metacentrum.perun.core.api.Member)1 MemberGroupStatus (cz.metacentrum.perun.core.api.MemberGroupStatus)1 Status (cz.metacentrum.perun.core.api.Status)1 AlreadyAdminException (cz.metacentrum.perun.core.api.exceptions.AlreadyAdminException)1 AlreadyMemberException (cz.metacentrum.perun.core.api.exceptions.AlreadyMemberException)1 AlreadySponsorException (cz.metacentrum.perun.core.api.exceptions.AlreadySponsorException)1 AlreadySponsoredMemberException (cz.metacentrum.perun.core.api.exceptions.AlreadySponsoredMemberException)1 AttributeNotExistsException (cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException)1 AttributeValueException (cz.metacentrum.perun.core.api.exceptions.AttributeValueException)1 BanAlreadyExistsException (cz.metacentrum.perun.core.api.exceptions.BanAlreadyExistsException)1 BanNotExistsException (cz.metacentrum.perun.core.api.exceptions.BanNotExistsException)1 CandidateNotExistsException (cz.metacentrum.perun.core.api.exceptions.CandidateNotExistsException)1 ConsistencyErrorException (cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException)1 ExtSourceNotExistsException (cz.metacentrum.perun.core.api.exceptions.ExtSourceNotExistsException)1 ExtSourceUnsupportedOperationException (cz.metacentrum.perun.core.api.exceptions.ExtSourceUnsupportedOperationException)1 ExtendMembershipException (cz.metacentrum.perun.core.api.exceptions.ExtendMembershipException)1 GroupNotExistsException (cz.metacentrum.perun.core.api.exceptions.GroupNotExistsException)1