libqi-api
2.8.7.4
|
#include <servicedirectoryproxy.hpp>
Classes | |
struct | Status |
Public Types | |
enum | IdValidationStatus { IdValidationStatus::Done, IdValidationStatus::PendingCheckOnListen } |
enum | ListenStatus { ListenStatus::NotListening, ListenStatus::Listening, ListenStatus::Starting, ListenStatus::PendingConnection } |
enum | ConnectionStatus { ConnectionStatus::NotConnected, ConnectionStatus::Connected, ConnectionStatus::Starting } |
using | ServiceFilter = std::function< bool(boost::string_ref)> |
Public Member Functions | |
ServiceDirectoryProxy (bool enforceAuth=true) | |
~ServiceDirectoryProxy () | |
UrlVector | endpoints () const |
Future< ListenStatus > | listenAsync (const Url &url) |
Future< IdValidationStatus > | setValidateIdentity (const std::string &key, const std::string &crt) |
void | setAuthProviderFactory (AuthProviderFactoryPtr provider) |
qi::Future< void > | attachToServiceDirectory (const Url &serviceDirectoryUrl) |
void | close () |
Future< ServiceFilter > | setServiceFilter (ServiceFilter filter=ka::constant_function(false)) |
Public Attributes | |
Property< bool > & | connected |
Property< Status > & | status |
This class implements a proxy to a service directory that clients can connect to in order to access the service directory services. It does that by propagating the services from the service directory to itself and its own services back to the service directory.
It can also filter out some of the services to disable their access from clients.
The following diagram roughly explains how the service propagation is implemented:
Definition at line 50 of file servicedirectoryproxy.hpp.
using qi::ServiceDirectoryProxy::ServiceFilter = std::function<bool(boost::string_ref)> |
Definition at line 77 of file servicedirectoryproxy.hpp.
|
strong |
Definition at line 70 of file servicedirectoryproxy.hpp.
|
strong |
Enumerator | |
---|---|
Done |
The provided identity has been validated. |
PendingCheckOnListen |
The provided identity is stored and will be validated on next listen. |
Definition at line 55 of file servicedirectoryproxy.hpp.
|
strong |
Definition at line 61 of file servicedirectoryproxy.hpp.
qi::ServiceDirectoryProxy::ServiceDirectoryProxy | ( | bool | enforceAuth = true | ) |
enforceAuth | If set to true, rejects clients that try to skip the authentication step. If false, accepts all incoming connections whether or not they authentify. |
qi::ServiceDirectoryProxy::~ServiceDirectoryProxy | ( | ) |
qi::Future<void> qi::ServiceDirectoryProxy::attachToServiceDirectory | ( | const Url & | serviceDirectoryUrl | ) |
void qi::ServiceDirectoryProxy::close | ( | ) |
UrlVector qi::ServiceDirectoryProxy::endpoints | ( | ) | const |
Future<ListenStatus> qi::ServiceDirectoryProxy::listenAsync | ( | const Url & | url | ) |
void qi::ServiceDirectoryProxy::setAuthProviderFactory | ( | AuthProviderFactoryPtr | provider | ) |
Future<ServiceFilter> qi::ServiceDirectoryProxy::setServiceFilter | ( | ServiceFilter | filter = ka::constant_function(false) | ) |
filter | A function object that when passed the name of a service returns true if the service must be filtered and false if it must be made available. By default, this argument will be set to a function that always return false, thus filtering nothing. |
Future<IdValidationStatus> qi::ServiceDirectoryProxy::setValidateIdentity | ( | const std::string & | key, |
const std::string & | crt | ||
) |
Property<bool>& qi::ServiceDirectoryProxy::connected |
Definition at line 104 of file servicedirectoryproxy.hpp.
Definition at line 106 of file servicedirectoryproxy.hpp.