1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jdiagnose.library.smtp;
17
18 import java.text.SimpleDateFormat;
19
20 import org.jdiagnose.library.logging.LoggingExceptionListener;
21 import org.jdiagnose.remote.ExceptionListener;
22 import org.springframework.mail.MailSender;
23
24 /***
25 * @author jmccrindle
26 */
27 public class SmtpSupport {
28
29 private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(SmtpListener.class);
30
31 private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
32
33 private MailSender mailSender = null;
34 private MessageProvider messageProvider = null;
35 private SmtpConfig smtpConfig = null;
36 protected ExceptionListener exceptionListener = LoggingExceptionListener.DEFAULT_LOGGING_EXCEPTION_LISTENER;
37
38
39 /***
40 * @return
41 */
42 public MailSender getMailSender() {
43 return mailSender;
44 }
45
46 /***
47 * @param sender
48 */
49 public void setMailSender(MailSender sender) {
50 mailSender = sender;
51 }
52
53 /***
54 * @return
55 */
56 public MessageProvider getMessageProvider() {
57 return messageProvider;
58 }
59
60 /***
61 * @param provider
62 */
63 public void setMessageProvider(MessageProvider provider) {
64 messageProvider = provider;
65 }
66
67 public void setExceptionListener(ExceptionListener exceptionListener) {
68 this.exceptionListener = exceptionListener;
69 }
70
71 public SmtpConfig getSmtpConfig() {
72 return smtpConfig;
73 }
74
75 public void setSmtpConfig(SmtpConfig smtpConfig) {
76 this.smtpConfig = smtpConfig;
77 }
78 }