|
RTC Toolkit 5.1.0
|
Class that implements a very basic service discovery mechanism using Consul. More...
#include <rtctk/componentFramework/consulServiceRegistryAdapter.hpp>
Public Member Functions | |
| ConsulServiceRegistryAdapter (const elt::mal::Uri &endpoint) | |
| std::vector< std::string > | ListComponents (const std::string &service_type=COMPONENT_TYPE) override |
| Get known components. | |
| ServiceEndpoint | Get (const std::string &comp_name, const std::string &service_name, const std::string &service_type, const bool health_check) override |
| Get endpoint of specific service of a specific component. | |
| ServiceEndpoint | GetOldbEndpoint () override |
| Get the Oldb Endpoint from the service registry. | |
| ServiceEndpoint | GetRuntimeRepoEndpoint () override |
| Get the Runtime Repository Endpoint from the service registry. | |
| ServiceEndpoint | GetPersistentRepoEndpoint () override |
| Get the Persistent Repository Endpoint from the service registry. | |
| bool | IsComponent (const ppconsul::ServiceInfo &service_info, const std::string &service_type=COMPONENT_TYPE) |
| ppconsul::ServiceInfo | GetComponentDefinedInConsul (const std::string &comp_name, const std::string &service_name, const std::string &service_type) |
Public Member Functions inherited from rtctk::componentFramework::ServiceRegistryIf | |
| virtual | ~ServiceRegistryIf ()=default |
| virtual destructor | |
Static Public Attributes | |
| static const std::string | SUPPORTED_URI_SCHEME = "consul" |
Static Public Attributes inherited from rtctk::componentFramework::ServiceRegistryIf | |
| static const std::string | REQ_REP_ENDPOINT = "req_rep_endpoint" |
| the string used to identify the Request/Reply endpoint of a service when using the Get function. | |
| static const std::string | PUB_SUB_ENDPOINT = "pub_sub_endpoint" |
| the string used to identify the PubSub endpoint of a service when using the Get function. | |
| static const std::string | COMPONENT_TYPE = "rtctk_component" |
| the string for component type (default) | |
Additional Inherited Members | |
Public Types inherited from rtctk::componentFramework::ServiceRegistryIf | |
| using | AdapterIdType = elt::mal::Uri |
| The type used to distinguish between different adapters implementing ServiceRegistryIf. | |
| using | ServiceEndpoint = elt::mal::Uri |
Static Public Member Functions inherited from rtctk::componentFramework::ServiceRegistryIf | |
| static std::unique_ptr< ServiceRegistryIf > | CreateAdapter (const elt::mal::Uri &uri) |
| Factory method used to create the appropriate service registry adapter depending on the URI scheme. | |
Class that implements a very basic service discovery mechanism using Consul.
| rtctk::componentFramework::ConsulServiceRegistryAdapter::ConsulServiceRegistryAdapter | ( | const elt::mal::Uri & | endpoint | ) |
|
overridevirtual |
Get endpoint of specific service of a specific component.
| comp_name | name of the (component) instance |
| service_name | name of the service, Must be one of the REQ_REP_ENDPOINT or PUB_SUB_ENDPOINT contants defined in ServiceRegistryIf |
| service_type | type of service e.g. rtctk_component |
| health_check | if should be checked for the health of component before returning a valid endpoint |
| InvalidService | if service_name or InvalidComponent if comp_name invalid |
Implements rtctk::componentFramework::ServiceRegistryIf.
| ppconsul::ServiceInfo rtctk::componentFramework::ConsulServiceRegistryAdapter::GetComponentDefinedInConsul | ( | const std::string & | comp_name, |
| const std::string & | service_name, | ||
| const std::string & | service_type ) |
|
overridevirtual |
Get the Oldb Endpoint from the service registry.
Implements rtctk::componentFramework::ServiceRegistryIf.
|
overridevirtual |
Get the Persistent Repository Endpoint from the service registry.
Implements rtctk::componentFramework::ServiceRegistryIf.
|
overridevirtual |
Get the Runtime Repository Endpoint from the service registry.
Implements rtctk::componentFramework::ServiceRegistryIf.
| bool rtctk::componentFramework::ConsulServiceRegistryAdapter::IsComponent | ( | const ppconsul::ServiceInfo & | service_info, |
| const std::string & | service_type = COMPONENT_TYPE ) |
|
overridevirtual |
Get known components.
Use this method to retrieve all components known to the service registry
| service_type | type of service e.g. rtctk_component |
Implements rtctk::componentFramework::ServiceRegistryIf.
|
inlinestatic |