Search in sources :

Example 1 with UserExtSourceUpdated

use of cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceUpdated in project perun by CESNET.

the class UsersManagerBlImpl method updateUserExtSourceLastAccess.

@Override
public void updateUserExtSourceLastAccess(PerunSession sess, UserExtSource userExtSource) {
    getUsersManagerImpl().updateUserExtSourceLastAccess(sess, userExtSource);
    getPerunBl().getAuditer().log(sess, new UserExtSourceUpdated(userExtSource));
}
Also used : UserExtSourceUpdated(cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceUpdated)

Example 2 with UserExtSourceUpdated

use of cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceUpdated in project perun by CESNET.

the class urn_perun_user_attribute_def_virt_loa method resolveVirtualAttributeValueChange.

@Override
public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl sess, AuditEvent message) throws AttributeNotExistsException, WrongAttributeAssignmentException {
    List<AuditEvent> resolvingMessages = new ArrayList<>();
    if (message == null)
        return resolvingMessages;
    User user = null;
    try {
        if (message instanceof UserExtSourceAddedToUser) {
            user = ((UserExtSourceAddedToUser) message).getUser();
            sess.getPerunBl().getUsersManagerBl().checkUserExists(sess, user);
            resolvingMessages.add(resolveEvent(sess, user));
        } else if (message instanceof UserExtSourceRemovedFromUser) {
            user = ((UserExtSourceRemovedFromUser) message).getUser();
            sess.getPerunBl().getUsersManagerBl().checkUserExists(sess, user);
            resolvingMessages.add(resolveEvent(sess, user));
        } else if (message instanceof UserExtSourceUpdated) {
            resolvingMessages.add(resolveEvent(sess, sess.getPerunBl().getUsersManagerBl().getUserById(sess, ((UserExtSourceUpdated) message).getUserExtSource().getUserId())));
        }
    } catch (UserNotExistsException e) {
        log.warn("User {} associated with event {} no longer exists while resolving virtual attribute value change for LoA.", user, message.getName());
    }
    return resolvingMessages;
}
Also used : UserExtSourceAddedToUser(cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceAddedToUser) AttributeChangedForUser(cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeChangedForUser) User(cz.metacentrum.perun.core.api.User) UserExtSourceRemovedFromUser(cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceRemovedFromUser) UserExtSourceAddedToUser(cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceAddedToUser) UserNotExistsException(cz.metacentrum.perun.core.api.exceptions.UserNotExistsException) UserExtSourceUpdated(cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceUpdated) ArrayList(java.util.ArrayList) AuditEvent(cz.metacentrum.perun.audit.events.AuditEvent) UserExtSourceRemovedFromUser(cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceRemovedFromUser)

Example 3 with UserExtSourceUpdated

use of cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceUpdated in project perun by CESNET.

the class UsersManagerBlImpl method updateUserExtSource.

@Override
public UserExtSource updateUserExtSource(PerunSession sess, UserExtSource userExtSource) throws UserExtSourceExistsException {
    UserExtSource updatedUes = getUsersManagerImpl().updateUserExtSource(sess, userExtSource);
    getPerunBl().getAuditer().log(sess, new UserExtSourceUpdated(userExtSource));
    return updatedUes;
}
Also used : RichUserExtSource(cz.metacentrum.perun.core.api.RichUserExtSource) UserExtSource(cz.metacentrum.perun.core.api.UserExtSource) UserExtSourceUpdated(cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceUpdated)

Aggregations

UserExtSourceUpdated (cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceUpdated)3 AttributeChangedForUser (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeChangedForUser)1 AuditEvent (cz.metacentrum.perun.audit.events.AuditEvent)1 UserExtSourceAddedToUser (cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceAddedToUser)1 UserExtSourceRemovedFromUser (cz.metacentrum.perun.audit.events.UserManagerEvents.UserExtSourceRemovedFromUser)1 RichUserExtSource (cz.metacentrum.perun.core.api.RichUserExtSource)1 User (cz.metacentrum.perun.core.api.User)1 UserExtSource (cz.metacentrum.perun.core.api.UserExtSource)1 UserNotExistsException (cz.metacentrum.perun.core.api.exceptions.UserNotExistsException)1 ArrayList (java.util.ArrayList)1