javax.mail
public final class Session extends Object
Method Summary | |
---|---|
boolean | getDebug()
Get the debug setting for this session.
|
PrintStream | getDebugOut()
Return the debug output stream.
|
static Session | getDefaultInstance(Properties properties)
Get the "default" instance assuming no authenticator is required.
|
static Session | getDefaultInstance(Properties properties, Authenticator authenticator)
Get the "default" session.
|
Folder | getFolder(URLName name)
Return a closed folder for the supplied URLName, or null if it cannot be obtained.
|
static Session | getInstance(Properties properties, Authenticator authenticator)
Create a new session initialized with the supplied properties which uses the supplied authenticator.
|
static Session | getInstance(Properties properties)
Create a new session initialized with the supplied properties with no authenticator.
|
PasswordAuthentication | getPasswordAuthentication(URLName name)
Get the password authentication associated with a URL
|
Properties | getProperties()
Return the properties object for this Session; this is a live collection.
|
String | getProperty(String property)
Return the specified property.
|
Provider | getProvider(String protocol)
Return the provider for a specific protocol.
|
Provider[] | getProviders()
Return the list of providers available to this application.
|
Store | getStore()
Return a Store for the default protocol defined by the mail.store.protocol property.
|
Store | getStore(String protocol)
Return a Store for the specified protocol.
|
Store | getStore(URLName url)
Return a Store for the protocol specified in the given URL
|
Store | getStore(Provider provider)
Return the Store specified by the given provider.
|
Transport | getTransport()
Return a Transport for the default protocol specified by the
mail.transport.protocol property.
|
Transport | getTransport(String protocol)
Return a Transport for the specified protocol.
|
Transport | getTransport(URLName name)
Return a transport for the protocol specified in the URL.
|
Transport | getTransport(Address address)
Return a transport for the protocol associated with the type of this address.
|
Transport | getTransport(Provider provider)
Return the Transport specified by a Provider
|
PasswordAuthentication | requestPasswordAuthentication(InetAddress host, int port, String protocol, String prompt, String defaultUserName)
Call back to the application supplied authenticator to get the needed username add password.
|
void | setDebug(boolean debug)
Enable debugging for this session.
|
void | setDebugOut(PrintStream out)
Set the output stream where debug information should be sent.
|
void | setPasswordAuthentication(URLName name, PasswordAuthentication authenticator)
Set the password authentication associated with a URL.
|
void | setProvider(Provider provider)
Make the supplied Provider the default for its protocol.
|
Returns: the debug setting
Returns: the debug output stream
Parameters: properties the session properties
Returns: if "default" session
Throws: SecurityException if the does not have permission to access the default session
Parameters: properties authenticator
Returns: if "default" session
Throws: SecurityException if the does not have permission to access the default session
Parameters: name the location of the folder
Returns: the requested folder, or null if it is unavailable
Throws: NoSuchProviderException if there is no provider MessagingException if there was a problem accessing the Store
Parameters: properties the session properties authenticator an authenticator for callbacks to the user
Returns: a new session
Parameters: properties the session properties
Returns: a new session
See Also: Session
Parameters: name the URL
Returns: any authenticator for that url, or null if none
Returns: the properties for the Session
Parameters: property the property to get
Returns: its value, or null if not present
Parameters: protocol the protocol to get a provider for
Returns: a provider for that protocol
Throws: NoSuchProviderException
Returns: an array of providers
Returns: the store for the default protocol
Throws: NoSuchProviderException
Parameters: protocol the protocol to get a Store for
Returns: a Store
Throws: NoSuchProviderException if no provider is defined for the specified protocol
Parameters: url the URL of the Store
Returns: a Store
Throws: NoSuchProviderException if no provider is defined for the specified protocol
Parameters: provider the provider to create from
Returns: a Store
Throws: NoSuchProviderException if there was a problem creating the Store
mail.transport.protocol
property.
Returns: a Transport
Throws: NoSuchProviderException
Parameters: protocol the protocol to use
Returns: a Transport
Throws: NoSuchProviderException
Parameters: name the URL whose scheme specifies the protocol
Returns: a Transport
Throws: NoSuchProviderException
Parameters: address the address we are trying to deliver to
Returns: a Transport
Throws: NoSuchProviderException
Parameters: provider the defining Provider
Returns: a Transport
Throws: NoSuchProviderException
Parameters: host the host we are trying to connect to, may be null port the port on that host protocol the protocol trying to be used prompt a String to show as part of the prompt, may be null defaultUserName the default username, may be null
Returns: the authentication information collected by the authenticator; may be null
Parameters: debug the debug setting
Parameters: out the stream to write debug information to
Parameters: name the url authenticator the authenticator
Parameters: provider the new default Provider
Throws: NoSuchProviderException