VMime
service Class Referenceabstract

#include <service.hpp>

Inheritance diagram for service:
Collaboration diagram for service:

Public Types

enum  Type { TYPE_STORE = 0 , TYPE_TRANSPORT }
 

Public Member Functions

virtual ~service ()
 
virtual Type getType () const =0
 
virtual const string getProtocolName () const =0
 
shared_ptr< const sessiongetSession () const
 
shared_ptr< sessiongetSession ()
 
virtual const serviceInfosgetInfos () const =0
 
virtual void connect ()=0
 
virtual void disconnect ()=0
 
virtual bool isConnected () const =0
 
virtual void noop ()=0
 
shared_ptr< const security::authenticatorgetAuthenticator () const
 
shared_ptr< security::authenticatorgetAuthenticator ()
 
void setAuthenticator (shared_ptr< security::authenticator > auth)
 
void setCertificateVerifier (shared_ptr< security::cert::certificateVerifier > cv)
 
shared_ptr< security::cert::certificateVerifiergetCertificateVerifier ()
 
void setSocketFactory (shared_ptr< socketFactory > sf)
 
shared_ptr< socketFactorygetSocketFactory ()
 
void setTimeoutHandlerFactory (shared_ptr< timeoutHandlerFactory > thf)
 
shared_ptr< timeoutHandlerFactorygetTimeoutHandlerFactory ()
 
void setTracerFactory (shared_ptr< tracerFactory > tf)
 
shared_ptr< tracerFactorygetTracerFactory ()
 
template<typename TYPE >
void setProperty (const string &name, const TYPE &value)
 
virtual bool isSecuredConnection () const =0
 
virtual shared_ptr< connectionInfosgetConnectionInfos () const =0
 

Protected Member Functions

 service (shared_ptr< session > sess, const serviceInfos &infos, shared_ptr< security::authenticator > auth)
 
- Protected Member Functions inherited from object
 object ()
 
 object (const object &)
 
objectoperator= (const object &)
 
virtual ~object ()
 

Detailed Description

Base class for messaging services.

Member Enumeration Documentation

◆ Type

Possible service types.

Enumerator
TYPE_STORE 

The service is a message store.

TYPE_TRANSPORT 

The service sends messages.

Constructor & Destructor Documentation

◆ service()

◆ ~service()

~service ( )
virtual

Member Function Documentation

◆ connect()

virtual void connect ( )
pure virtual

Connect to service.

Implemented in IMAPStore, maildirStore, POP3Store, sendmailTransport, and SMTPTransport.

◆ disconnect()

virtual void disconnect ( )
pure virtual

Disconnect from service.

Implemented in IMAPStore, maildirStore, POP3Store, sendmailTransport, and SMTPTransport.

◆ getAuthenticator() [1/2]

shared_ptr< security::authenticator > getAuthenticator ( )

Return the authenticator object used with this service instance.

Returns
authenticator object

◆ getAuthenticator() [2/2]

shared_ptr< const security::authenticator > getAuthenticator ( ) const

Return the authenticator object used with this service instance.

Returns
authenticator object

Referenced by IMAPStore::connect(), POP3Store::connect(), SMTPTransport::connect(), and IMAPFolder::open().

◆ getCertificateVerifier()

shared_ptr< security::cert::certificateVerifier > getCertificateVerifier ( )

Get the object responsible for verifying certificates when using secured connections (TLS/SSL).

Referenced by POP3Connection::connect(), and SMTPConnection::connect().

◆ getConnectionInfos()

virtual shared_ptr< connectionInfos > getConnectionInfos ( ) const
pure virtual

Get information about the connection.

Returns
information about the connection

Implemented in IMAPStore, maildirStore, POP3Store, sendmailTransport, and SMTPTransport.

◆ getInfos()

virtual const serviceInfos & getInfos ( ) const
pure virtual

Return information about this service.

Returns
information about the service

Implemented in IMAPSStore, IMAPStore, maildirStore, POP3SStore, POP3Store, sendmailTransport, SMTPSTransport, and SMTPTransport.

◆ getProtocolName()

virtual const string getProtocolName ( ) const
pure virtual

Return the protocol name of this service.

Returns
protocol name

Implemented in IMAPSStore, IMAPStore, maildirStore, POP3SStore, POP3Store, sendmailTransport, SMTPSTransport, and SMTPTransport.

◆ getSession() [1/2]

shared_ptr< session > getSession ( )

Return the session object associated with this service instance.

Returns
session object

◆ getSession() [2/2]

shared_ptr< const session > getSession ( ) const

Return the session object associated with this service instance.

Returns
session object

Referenced by POP3Connection::connect(), SMTPConnection::connect(), and SMTPTransport::send().

◆ getSocketFactory()

shared_ptr< socketFactory > getSocketFactory ( )

Return the factory used to create socket objects for this service.

Returns
socket factory

Referenced by POP3Connection::connect(), and SMTPConnection::connect().

◆ getTimeoutHandlerFactory()

shared_ptr< timeoutHandlerFactory > getTimeoutHandlerFactory ( )

Return the factory used to create timeoutHandler objects for this service.

Returns
timeoutHandler factory

Referenced by POP3Connection::connect(), and SMTPConnection::connect().

◆ getTracerFactory()

◆ getType()

virtual Type getType ( ) const
pure virtual

Return the type of service.

Returns
type of service

Implemented in store, and transport.

◆ isConnected()

virtual bool isConnected ( ) const
pure virtual

Test whether this service is connected.

Returns
true if the service is connected, false otherwise

Implemented in IMAPStore, maildirStore, POP3Store, sendmailTransport, and SMTPTransport.

◆ isSecuredConnection()

virtual bool isSecuredConnection ( ) const
pure virtual

Check whether the connection is secured.

Returns
true if the connection is secured, false otherwise

Implemented in IMAPStore, maildirStore, POP3Store, sendmailTransport, and SMTPTransport.

◆ noop()

virtual void noop ( )
pure virtual

Do nothing but ensure the server do not disconnect (for example, this can reset the auto-logout timer on the server, if one exists).

Implemented in IMAPStore, maildirStore, POP3Store, sendmailTransport, and SMTPTransport.

◆ setAuthenticator()

void setAuthenticator ( shared_ptr< security::authenticator auth)

Set the authenticator object used with this service instance.

Parameters
authauthenticator object

References vmime::dynamicCast().

◆ setCertificateVerifier()

void setCertificateVerifier ( shared_ptr< security::cert::certificateVerifier cv)

Set the object responsible for verifying certificates when using secured connections (TLS/SSL).

References vmime::dynamicCast().

◆ setProperty()

template<typename TYPE >
void setProperty ( const string name,
const TYPE value 
)

Set a property for this service (service prefix is added automatically).

WARNING: this sets the property on the session object, so all service instances created with the session object will inherit the property.

Parameters
nameproperty name
valueproperty value

◆ setSocketFactory()

void setSocketFactory ( shared_ptr< socketFactory sf)

Set the factory used to create socket objects for this service.

Parameters
sfsocket factory

References vmime::dynamicCast().

◆ setTimeoutHandlerFactory()

void setTimeoutHandlerFactory ( shared_ptr< timeoutHandlerFactory thf)

Set the factory used to create timeoutHandler objects for this service.

By default, the defaultTimeoutHandler class is used. Not all services support timeout handling.

Parameters
thftimeoutHandler factory

References vmime::dynamicCast().

◆ setTracerFactory()

void setTracerFactory ( shared_ptr< tracerFactory tf)

References vmime::dynamicCast().


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