Search in sources :

Example 1 with UserGroupRoleSetProjectEvent

use of ca.corefacility.bioinformatics.irida.model.event.UserGroupRoleSetProjectEvent in project irida by phac-nml.

the class ProjectEventHandler method handleUserGroupRoleSetProjectEvent.

/**
 * Create a {@link UserGroupRoleSetProjectEvent}. The method must have
 * returned a {@link UserGroupProjectJoin}
 *
 * @param event
 *            The {@link MethodEvent} that this event is being launched from
 */
private ProjectEvent handleUserGroupRoleSetProjectEvent(MethodEvent event) {
    Object returnValue = event.getReturnValue();
    if (!(returnValue instanceof UserGroupProjectJoin)) {
        throw new IllegalArgumentException("Method annotated with @LaunchesProjectEvent(UserGroupRoleSetProjectEvent.class) method must return UserGroupProjectJoin");
    }
    UserGroupProjectJoin join = (UserGroupProjectJoin) returnValue;
    return eventRepository.save(new UserGroupRoleSetProjectEvent(join));
}
Also used : UserGroupProjectJoin(ca.corefacility.bioinformatics.irida.model.user.group.UserGroupProjectJoin) UserGroupRoleSetProjectEvent(ca.corefacility.bioinformatics.irida.model.event.UserGroupRoleSetProjectEvent)

Aggregations

UserGroupRoleSetProjectEvent (ca.corefacility.bioinformatics.irida.model.event.UserGroupRoleSetProjectEvent)1 UserGroupProjectJoin (ca.corefacility.bioinformatics.irida.model.user.group.UserGroupProjectJoin)1