for ( Deadline deadline : task.getDeadlines().getStartDeadlines() ) {
if ( !deadline.isEscalated() ) {
// only escalate when true - typically this would only be true
// if the user is requested that the notification should never be escalated
Date date = deadline.getDate();
service.schedule( new ScheduledTaskDeadline( task.getId(),
deadline.getId(),
service ),
date.getTime() - now );
}
}
}
if ( task.getDeadlines().getEndDeadlines() != null ) {
for ( Deadline deadline : task.getDeadlines().getEndDeadlines() ) {
// only escalate when true - typically this would only be true
// if the user is requested that the notification should never be escalated
if ( !deadline.isEscalated() ) {
Date date = deadline.getDate();
service.schedule( new ScheduledTaskDeadline( task.getId(),
deadline.getId(),
service ),
date.getTime() - now );
}
}