Package org.opencustomer.connector.mail.messages

Examples of org.opencustomer.connector.mail.messages.EventReminderMail


                if(event.getReminderDate() != null && event.getReminderDate().before(endDate) && event.getReminderDate().after(startDate))
                {
                    if(log.isDebugEnabled())
                        log.debug("generating job for event: " + event);
                   
                    EventReminderMail reminderMail;
                    try
                    {
                        reminderMail = new EventReminderMail();
                    }
                    catch (AddressException e1)
                    {
                        log.warn("cannot create reminder mail, incorrect sender address",e1);
                        return;
                    }
                    reminderMail.setEvent(event.getEvent());
                    try
                    {
                        reminderMail.setUser(user);
                       
                        MailJob mailJob = new MailJob(reminderMail);
                       
                        for(Object obj :  manager.getAlarmManager().getAllAlarms())
                        {
                            AlarmEntry alarmEntry = (AlarmEntry) obj;
                            String name;
                            if(event.getRecurrenceNumber() != null)
                                name = "EVENT"+event.getEvent().getId()+"."+event.getRecurrenceNumber();
                            else
                                name = "EVENT" + event.getEvent().getId();
                            if(alarmEntry.getName().equals(name)){
                                if(log.isDebugEnabled())
                                    log.debug("removing mail job for: " + event);
                                manager.getAlarmManager().removeAlarm(alarmEntry);
                            }
                        }
                        try
                        {
                            if(log.isInfoEnabled())
                                log.info("adding mailJob for: " + event);
                            String name;
                            if(event.getRecurrenceNumber() != null)
                                name = "EVENT"+event.getEvent().getId()+"."+event.getRecurrenceNumber();
                            else
                                name = "EVENT" + event.getEvent().getId();
                            AlarmEntry alarmEntry = new AlarmEntry(name,event.getReminderDate(),mailJob);
                            alarmEntry.setRingInNewThead();
                            manager.getAlarmManager().addAlarm(alarmEntry);
                        }
                        catch (PastDateException e)
                        {
                            if(log.isInfoEnabled())
                                log.info("ignoring old event alarm: " + event);
                        }
                    }catch(NoValidSenderException e)
                    {
                        log.warn("no person for user: " + user);
                    }
                }
                else
                {
                    if(log.isInfoEnabled())
                        log.info("no reminder date of old reminder date for: " + event);
                }
            }
           
            List<JobVO> jobs = new JobDAO().getByUser(user, startDate, endDate);
            if(log.isDebugEnabled())
                log.debug(jobs.size() + " job jobs found");
            for(JobVO job : jobs)
            {
                if(log.isDebugEnabled())
                    log.debug("generating jobs for job: " + job);
               
                JobReminderMail reminderMail;
                try
                {
                    reminderMail = new JobReminderMail();
                }
                catch (AddressException e1)
                {
                    log.warn("cannot create reminder mail, incorrect sender address",e1);
                    return;
                }
                reminderMail.setJob(job);
                try
                {
                    reminderMail.setUser(user);

               
                    MailJob mailJob = new MailJob(reminderMail);
                   
                    for(Object obj :  manager.getAlarmManager().getAllAlarms())
View Full Code Here

TOP

Related Classes of org.opencustomer.connector.mail.messages.EventReminderMail

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.