|
fipa_services
|
Implementation of a distributed service directory using the functionality of Avahi. More...
#include <DistributedServiceDirectory.hpp>
Static Public Member Functions | |
| static servicediscovery::avahi::ServiceDescription | convert (const ServiceDirectoryEntry &entry) |
| static ServiceDirectoryEntry | convert (const servicediscovery::avahi::ServiceDescription &description) |
| static ServiceDirectoryList | convert (const std::map< std::string, servicediscovery::avahi::ServiceDescription > &servicesMap) |
Additional Inherited Members | |
Public Types inherited from fipa::services::ServiceDirectory | |
| typedef boost::shared_ptr< ServiceDirectory > | Ptr |
Protected Attributes inherited from fipa::services::ServiceDirectory | |
| boost::mutex | mMutex |
Implementation of a distributed service directory using the functionality of Avahi.
The distributed service directory allows to register services which are then published in a given avahi domain (default is _fipa_service_directory._udp). Each service can be associated with information on how to access the service. This is done constructing a ServiceLocator object and specifying a service locator.
#include <fipa_services/DistributedServiceDirectory.hpp>
using namespace fipa::services;
DistributedServiceDirectory directory;
ServiceLocator locator;
locator.addLocation("tcp://192.168.1.1:2000","agent-signature-type","agent-service-signature");
ServiceDirectoryEntry client("local-agent","type-of-agent",locator, "Description of local-agent");
directory.registerService(client);
fipa::services::ServiceDirectory list = directory.search("other-agent", ServiceDirectoryEntry::NAME, false); | fipa::services::DistributedServiceDirectory::DistributedServiceDirectory | ( | const std::string & | scope = DEFAULT_SERVICE_SCOPE | ) |
Default constructor using the default listening scope for that service discovery
| fipa::services::DistributedServiceDirectory::DistributedServiceDirectory | ( | const std::vector< std::string > & | scopes | ) |
Constructor to allow setting of multiple listening scopes
|
virtual |
Virtual Destructor
|
static |
Convert a ServiceDirectoryEntry to a avahi description
| entry | ServiceDirectoryEntry |
|
static |
Convert an avahi ServiceDescription to a ServiceDirectoryEntry
| description | avahi ServiceDescription |
|
static |
Convert map of avahi ServiceDescriptions to a ServiceDirectoryList
| servicesMap | Map of avahi ServiceDescriptions |
|
virtual |
Looks up services that have been registered with this instance and deregisters them
| NotFound | If the service has not been locally deregistered and thus cannot be deregistered |
Reimplemented from fipa::services::ServiceDirectory.
|
inlinevirtual |
RegisterService
Reimplemented from fipa::services::ServiceDirectory.
| void fipa::services::DistributedServiceDirectory::registerService | ( | const ServiceDirectoryEntry & | entry, |
| const std::string & | publishDomain, | ||
| uint32_t | ttlInMS = 30000 |
||
| ) |
Register a service
| entry | The ServiceDirectoryEntry which describes the service that shall be registered |
| publishDomain | Default domain under which services will be published |
| ttlInMS | TimeToLive in Milliseconds |
|
virtual |
Search for a given service based on the field information
| regex | Regular expression which will be applied to the selected field |
| field | Field selection which the regex shall be applied on |
| doThrow | If set to true, the function will throw an exception if no entry could be found |
Reimplemented from fipa::services::ServiceDirectory.
1.8.11