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));
}
Aggregations