A factory to create 'service' objects for a specified protocol. More...
Classes | |
| class | registeredService |
| Information about a registered service. More... | |
Public Member Functions | |
| void | registerService (ref< registeredService > reg) |
| ref< service > | create (ref< session > sess, const string &protocol, ref< security::authenticator > auth=NULL) |
| ref< service > | create (ref< session > sess, const utility::url &u, ref< security::authenticator > auth=NULL) |
| ref< const registeredService > | getServiceByProtocol (const string &protocol) const |
| int | getServiceCount () const |
| ref< const registeredService > | getServiceAt (const int pos) const |
| const std::vector< ref< const registeredService > > | getServiceList () const |
Static Public Member Functions | |
| static serviceFactory * | getInstance () |
A factory to create 'service' objects for a specified protocol.
| ref< service > create | ( | ref< session > | sess, | |
| const utility::url & | u, | |||
| ref< security::authenticator > | auth = NULL | |||
| ) |
Create a new service instance from a URL.
| 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) |
| 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.
| sess | session | |
| protocol | protocol name (eg. "pop3") | |
| auth | authenticator used to provide credentials (can be NULL if not used) |
| 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] |
Referenced by session::getStore(), and session::getTransport().
| ref< const serviceFactory::registeredService > getServiceAt | ( | const int | pos | ) | const |
Return the registered service at the specified position.
| pos | position of the registered service to return |
| ref< const serviceFactory::registeredService > getServiceByProtocol | ( | const string & | protocol | ) | const |
Return information about a registered protocol.
| protocol | protocol name |
| 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.
| const std::vector< ref< const serviceFactory::registeredService > > getServiceList | ( | ) | const |
Return a list of all registered services.
| void registerService | ( | ref< registeredService > | reg | ) |
Register a new service by its protocol name.
| reg | service registration infos |
1.6.2