|
RTC Toolkit 5.1.0
|
Class that implements a service registry to be used by the service discovery. More...
#include <rtctk/componentFramework/serviceRegistryIf.hpp>
Classes | |
| class | ConsulUnavailable |
| class | InvalidComponent |
| class | InvalidService |
Public Types | |
| using | AdapterIdType = elt::mal::Uri |
| The type used to distinguish between different adapters implementing ServiceRegistryIf. | |
| using | ServiceEndpoint = elt::mal::Uri |
Public Member Functions | |
| virtual | ~ServiceRegistryIf ()=default |
| virtual destructor | |
| virtual std::vector< std::string > | ListComponents (const std::string &service_type=COMPONENT_TYPE)=0 |
| Get known components. | |
| virtual ServiceEndpoint | GetOldbEndpoint ()=0 |
| Get the Oldb Endpoint from the service registry. | |
| virtual ServiceEndpoint | GetRuntimeRepoEndpoint ()=0 |
| Get the Runtime Repository Endpoint from the service registry. | |
| virtual ServiceEndpoint | GetPersistentRepoEndpoint ()=0 |
| Get the Persistent Repository Endpoint from the service registry. | |
| virtual ServiceEndpoint | Get (const std::string &comp_name, const std::string &service_name, const std::string &service_type=COMPONENT_TYPE, const bool health_check=true)=0 |
| Get endpoint of specific service of a specific component. | |
Static Public Member Functions | |
| 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. | |
Static Public Attributes | |
| 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) | |
Class that implements a service registry to be used by the service discovery.
| using rtctk::componentFramework::ServiceRegistryIf::AdapterIdType = elt::mal::Uri |
The type used to distinguish between different adapters implementing ServiceRegistryIf.
This is used to specialise the FactoryRegistry to make it suitable for adapter factories discriminated using a URI to select different backend implementations of the repository service.
| using rtctk::componentFramework::ServiceRegistryIf::ServiceEndpoint = elt::mal::Uri |
|
virtualdefault |
virtual destructor
|
static |
Factory method used to create the appropriate service registry adapter depending on the URI scheme.
The URI schemes supported by the factory method include the following:
| [in] | uri | The URI of the registry that needs to be accessed. |
| UnsupportedUriException | If the URI is not supported. |
| AdapterCreationException | If the factory failed to create a new instance. This will contain nested exceptions caught from the adapter class constructor. |
|
pure virtual |
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 |
Implemented in rtctk::componentFramework::ConsulServiceRegistryAdapter, and rtctk::componentFramework::FileServiceRegistryAdapter.
|
pure virtual |
Get the Oldb Endpoint from the service registry.
Implemented in rtctk::componentFramework::ConsulServiceRegistryAdapter, and rtctk::componentFramework::FileServiceRegistryAdapter.
|
pure virtual |
Get the Persistent Repository Endpoint from the service registry.
Implemented in rtctk::componentFramework::ConsulServiceRegistryAdapter, and rtctk::componentFramework::FileServiceRegistryAdapter.
|
pure virtual |
Get the Runtime Repository Endpoint from the service registry.
Implemented in rtctk::componentFramework::ConsulServiceRegistryAdapter, and rtctk::componentFramework::FileServiceRegistryAdapter.
|
pure virtual |
Get known components.
Use this method to retrieve all components known to the service registry
| service_type | type of service e.g. rtctk_component |
Implemented in rtctk::componentFramework::ConsulServiceRegistryAdapter, and rtctk::componentFramework::FileServiceRegistryAdapter.
|
static |
the string for component type (default)
|
static |
the string used to identify the PubSub endpoint of a service when using the Get function.
|
static |
the string used to identify the Request/Reply endpoint of a service when using the Get function.