serviceFactory Class Reference

A factory to create 'service' objects for a specified protocol. More...

List of all members.

Classes

class  registeredService
 Information about a registered service. More...

Public Member Functions

void registerService (ref< registeredService > reg)
ref< servicecreate (ref< session > sess, const string &protocol, ref< security::authenticator > auth=NULL)
ref< servicecreate (ref< session > sess, const utility::url &u, ref< security::authenticator > auth=NULL)
ref< const registeredServicegetServiceByProtocol (const string &protocol) const
int getServiceCount () const
ref< const registeredServicegetServiceAt (const int pos) const
const std::vector< ref< const
registeredService > > 
getServiceList () const

Static Public Member Functions

static serviceFactorygetInstance ()

Detailed Description

A factory to create 'service' objects for a specified protocol.


Member Function Documentation

ref< service > create ( ref< session sess,
const utility::url u,
ref< security::authenticator auth = NULL 
)

Create a new service instance from a URL.

Parameters:
sess session
u full URL with at least protocol and server (you can also specify port, username and password)
auth authenticator used to provide credentials (can be NULL if not used)
Returns:
a new service instance for the specified protocol
Exceptions:
exceptions::no_service_available if no service is registered for this protocol

References serviceFactory::create(), url::getHost(), url::getPassword(), url::getPath(), url::getPort(), url::getProtocol(), url::getUsername(), and url::UNSPECIFIED_PORT.

ref< service > create ( ref< session sess,
const string protocol,
ref< security::authenticator auth = NULL 
)

Create a new service instance from a protocol name.

Parameters:
sess session
protocol protocol name (eg. "pop3")
auth authenticator used to provide credentials (can be NULL if not used)
Returns:
a new service instance for the specified protocol
Exceptions:
exceptions::no_service_available if no service is registered for this protocol

References serviceFactory::getServiceByProtocol().

Referenced by serviceFactory::create(), session::getStore(), and session::getTransport().

serviceFactory * getInstance (  )  [static]
ref< const serviceFactory::registeredService > getServiceAt ( const int  pos  )  const

Return the registered service at the specified position.

Parameters:
pos position of the registered service to return
Returns:
registered service at the specified position
ref< const serviceFactory::registeredService > getServiceByProtocol ( const string protocol  )  const

Return information about a registered protocol.

Parameters:
protocol protocol name
Returns:
information about this protocol
Exceptions:
exceptions::no_service_available if no service is registered for this protocol

Referenced by serviceFactory::create().

int getServiceCount (  )  const

Return the number of registered services.

Returns:
number of registered services
const std::vector< ref< const serviceFactory::registeredService > > getServiceList (  )  const

Return a list of all registered services.

Returns:
list of registered services
void registerService ( ref< registeredService reg  ) 

Register a new service by its protocol name.

Parameters:
reg service registration infos

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

Generated by  doxygen 1.6.2