View Javadoc

1   /*
2    * Copyright 2001-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
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  }