MembershipTypeHandler mtHandler = service.getMembershipTypeHandler();
User user = service.getUserHandler().findUserByName(user_);
for (Membership membership : membership_) {
if (user == null)
user = service.getUserHandler().findUserByName(membership.getUserName());
Group group = groupHandler.findGroupById(membership.getGroupId());
MembershipType mt = mtHandler.findMembershipType(membership.getMembershipType());
if (service.getMembershipHandler() != null) {
service.getMembershipHandler().linkMembership(user, group, mt, broadcast);
}
}