View Javadoc

1   /*
2    * $Id: SessionDetails.java 20321 2010-11-24 15:21:24Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.transport.email;
12  
13  import javax.mail.NoSuchProviderException;
14  import javax.mail.Session;
15  import javax.mail.Store;
16  import javax.mail.Transport;
17  import javax.mail.URLName;
18  
19  public class SessionDetails
20  {
21  
22      private Session session;
23      private URLName url;
24      
25      public SessionDetails(Session session, URLName url)
26      {
27          this.session = session;
28          this.url = url;
29      }
30      
31      public Session getSession()
32      {
33          return session;
34      }
35      
36      public URLName getUrl()
37      {
38          return url;
39      }
40      
41      public Store newStore() throws NoSuchProviderException
42      {
43          return session.getStore(url);
44      }
45      
46      public Transport newTransport() throws NoSuchProviderException
47      {
48          return session.getTransport(url);
49      }
50      
51  }