delegate.rescheduleAppointment(appointment, responsibleUser);
}
@Override
public void register(User user, Lva appointment, User responsibleUser) throws RegisterPeriodOverException, AlreadyRegisteredException, MaximumMemberCountExceededException, RequirementsNotFullfilledException, AppointmentNotFoundException, NotAllowedException {
Lva real = getRealAppointment(appointment);
if (real == null || real.isDeleted()) {
throw new AppointmentNotFoundException();
}
if (!(user instanceof Student)) {
throw new IllegalArgumentException("Only students can register to a Lva!");
}
if (real.getRequirement() != null && responsibleUser != User.ADMIN) {
@SuppressWarnings("unchecked")
Map<Student, Map<Rateable, List<Rating>>> ratings = PersistenceContext.getInstance().getPersistentMap("ratings");
checkRequirement(real.getRequirement(), getAppointments(User.ADMIN), ratings.get((Student) user));
}
delegate.register(user, appointment, responsibleUser);
}