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