VMime
session Class Reference

#include <session.hpp>

Inheritance diagram for session:
Collaboration diagram for session:

Public Member Functions

 ~session ()
shared_ptr< transportgetTransport (shared_ptr< security::authenticator > auth=null)
shared_ptr< transportgetTransport (const string &protocol, shared_ptr< security::authenticator > auth=null)
shared_ptr< transportgetTransport (const utility::url &url, shared_ptr< security::authenticator > auth=null)
shared_ptr< storegetStore (shared_ptr< security::authenticator > auth=null)
shared_ptr< storegetStore (const string &protocol, shared_ptr< security::authenticator > auth=null)
shared_ptr< storegetStore (const utility::url &url, shared_ptr< security::authenticator > auth=null)
const propertySetgetProperties () const
propertySetgetProperties ()
void setTLSProperties (shared_ptr< tls::TLSProperties > tlsProps)
shared_ptr< tls::TLSPropertiesgetTLSProperties () const

Static Public Member Functions

static shared_ptr< session > create ()
static shared_ptr< session > create (const propertySet &props)

Additional Inherited Members

Protected Member Functions inherited from object
 object ()
 object (const object &)
objectoperator= (const object &)
virtual ~object ()

Detailed Description

An object that contains all the information needed for connection to a service.

Constructor & Destructor Documentation

◆ ~session()

~session ( )

References ~session().

Referenced by ~session().

Member Function Documentation

◆ create() [1/2]

shared_ptr< session > create ( )
static

Construct a new session.

Returns
pointer to a new session

References create().

Referenced by create(), and create().

◆ create() [2/2]

shared_ptr< session > create ( const propertySet & props)
static

Construct a new session given properties.

Parameters
propssession properties
Returns
pointer to a new session

References create().

◆ getProperties() [1/2]

propertySet & getProperties ( )

Properties for the session and for the services.

References getProperties().

◆ getProperties() [2/2]

const propertySet & getProperties ( ) const

Properties for the session and for the services.

References getProperties().

Referenced by getProperties(), and getProperties().

◆ getStore() [1/3]

shared_ptr< store > getStore ( const string & protocol,
shared_ptr< security::authenticator > auth = null )

Return a store service instance for the specified protocol.

Parameters
protocolstore protocol to use (eg. "imap")
authauthenticator object to use for the new store service. If NULL, a default one is used. The default authenticator simply return user credentials by reading the session properties "auth.username" and "auth.password".
Returns
a new store service, or NULL if no service is registered for this protocol or is not a store protocol

References serviceFactory::getInstance(), getStore(), and service::TYPE_STORE.

◆ getStore() [2/3]

shared_ptr< store > getStore ( const utility::url & url,
shared_ptr< security::authenticator > auth = null )

Return a store service instance for the specified URL.

Parameters
urlfull URL with at least the protocol to use (eg: "imap://username:password@myserver.com/")
authauthenticator object to use for the new store service. If NULL, a default one is used. The default authenticator simply return user credentials by reading the session properties "auth.username" and "auth.password".
Returns
a new store service, or NULL if no service is registered for this protocol or is not a store protocol

References serviceFactory::getInstance(), getStore(), and service::TYPE_STORE.

◆ getStore() [3/3]

shared_ptr< store > getStore ( shared_ptr< security::authenticator > auth = null)

Return a transport service instance for the protocol specified in the session properties.

The property "store.protocol" specify the protocol to use.

Parameters
authauthenticator object to use for the new store service. If NULL, a default one is used. The default authenticator simply return user credentials by reading the session properties "auth.username" and "auth.password".
Returns
a new store service, or NULL if no service is registered for this protocol or is not a store protocol

References getStore().

Referenced by getStore(), getStore(), and getStore().

◆ getTLSProperties()

shared_ptr< tls::TLSProperties > getTLSProperties ( ) const

Get properties for SSL/TLS secured connections in this session.

Returns
SSL/TLS properties

References getTLSProperties().

Referenced by getTLSProperties().

◆ getTransport() [1/3]

shared_ptr< transport > getTransport ( const string & protocol,
shared_ptr< security::authenticator > auth = null )

Return a transport service instance for the specified protocol.

Parameters
protocoltransport protocol to use (eg. "smtp")
authauthenticator object to use for the new transport service. If NULL, a default one is used. The default authenticator simply return user credentials by reading the session properties "auth.username" and "auth.password".
Returns
a new transport service, or NULL if no service is registered for this protocol or is not a transport protocol

References serviceFactory::getInstance(), getTransport(), and service::TYPE_TRANSPORT.

◆ getTransport() [2/3]

shared_ptr< transport > getTransport ( const utility::url & url,
shared_ptr< security::authenticator > auth = null )

Return a transport service instance for the specified URL.

Parameters
urlfull URL with at least the protocol to use (eg: "smtp://myserver.com/")
authauthenticator object to use for the new transport service. If NULL, a default one is used. The default authenticator simply return user credentials by reading the session properties "auth.username" and "auth.password".
Returns
a new transport service, or NULL if no service is registered for this protocol or is not a transport protocol

References serviceFactory::getInstance(), getTransport(), and service::TYPE_TRANSPORT.

◆ getTransport() [3/3]

shared_ptr< transport > getTransport ( shared_ptr< security::authenticator > auth = null)

Return a transport service instance for the protocol specified in the session properties.

The property "transport.protocol" specify the protocol to use.

Parameters
authauthenticator object to use for the new transport service. If NULL, a default one is used. The default authenticator simply return user credentials by reading the session properties "auth.username" and "auth.password".
Returns
a new transport service, or NULL if no service is registered for this protocol or is not a transport protocol

References getTransport().

Referenced by getTransport(), getTransport(), and getTransport().

◆ setTLSProperties()

void setTLSProperties ( shared_ptr< tls::TLSProperties > tlsProps)

Set properties for SSL/TLS secured connections in this session.

Parameters
tlsPropsSSL/TLS properties

References setTLSProperties().

Referenced by setTLSProperties().


The documentation for this class was generated from the following files: