Search in sources :

Example 1 with MemberDisabled

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

the class MembersManagerBlImpl method disableMember.

@Override
public Member disableMember(PerunSession sess, Member member) throws MemberNotValidYetException {
    if (this.haveStatus(sess, member, Status.DISABLED)) {
        log.debug("Trying to disable member who is already disabled. " + member);
        return member;
    }
    if (this.haveStatus(sess, member, Status.INVALID))
        throw new MemberNotValidYetException(member);
    getMembersManagerImpl().setStatus(sess, member, Status.DISABLED);
    member.setStatus(Status.DISABLED);
    getPerunBl().getAuditer().log(sess, new MemberDisabled(member));
    return member;
}
Also used : MemberNotValidYetException(cz.metacentrum.perun.core.api.exceptions.MemberNotValidYetException) MemberDisabled(cz.metacentrum.perun.audit.events.MembersManagerEvents.MemberDisabled)

Example 2 with MemberDisabled

use of cz.metacentrum.perun.audit.events.MembersManagerEvents.MemberDisabled 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)

Aggregations

MemberDisabled (cz.metacentrum.perun.audit.events.MembersManagerEvents.MemberDisabled)2 MemberExpired (cz.metacentrum.perun.audit.events.MembersManagerEvents.MemberExpired)1 MemberValidated (cz.metacentrum.perun.audit.events.MembersManagerEvents.MemberValidated)1 Member (cz.metacentrum.perun.core.api.Member)1 MemberNotValidYetException (cz.metacentrum.perun.core.api.exceptions.MemberNotValidYetException)1 ArrayList (java.util.ArrayList)1