01: /*
02: * $Id: SessionDetails.java 10489 2008-01-23 17:53:38Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
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: private Session session;
22: private URLName url;
23:
24: public SessionDetails(Session session, URLName url) {
25: this .session = session;
26: this .url = url;
27: }
28:
29: public Session getSession() {
30: return session;
31: }
32:
33: public URLName getUrl() {
34: return url;
35: }
36:
37: public Store newStore() throws NoSuchProviderException {
38: return session.getStore(url);
39: }
40:
41: public Transport newTransport() throws NoSuchProviderException {
42: return session.getTransport(url);
43: }
44:
45: }
|