log.info("event ignored: " + event);
}
}
else if(saveOrUpdateEvent.getEntity() instanceof JobVO)
{
JobVO job = (JobVO)saveOrUpdateEvent.getEntity();
SchedulingManager manager = SchedulingManager.getInstance();
JobReminderMail reminderMail;
try
{
reminderMail = new JobReminderMail();
reminderMail.setUser(job.getAssignedUser());
}
catch (NoValidSenderException e1)
{
log.warn("no person for user: " + job.getAssignedUser());
return;
}
catch (AddressException e1)
{
log.warn("cannot create reminder mail, incorrect sender address");
return;
}
reminderMail.setJob(job);
MailJob mailJob = new MailJob(reminderMail);
for(Object obj : manager.getAlarmManager().getAllAlarms())
{
AlarmEntry alarmEntry = (AlarmEntry) obj;
String name;
if(alarmEntry.getName().equals("JOB" + job.getId())){
if(log.isDebugEnabled())
log.debug("removing mail job for [job]: " + job);
manager.getAlarmManager().removeAlarm(alarmEntry);
}
}
try
{
if(log.isInfoEnabled())
log.info("adding mailJob for [job]: " + job);
String name;
Calendar reminderDate = GregorianCalendar.getInstance();
reminderDate.setTime(job.getDueDate());
reminderDate.add(Calendar.MINUTE, -1 * Settings.getInstance().getAlarmBeforeJob());
AlarmEntry alarmEntry = new AlarmEntry("JOB" + job.getId(),reminderDate.getTime(),mailJob);
alarmEntry.setRingInNewThead();
manager.getAlarmManager().addAlarm(alarmEntry);
}
catch (PastDateException e)
{