RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
serviceRegistryIf.hpp
Go to the documentation of this file.
1
11
12#ifndef RTCTK_COMPONENTFRAMEWORK_SERVICEREGISTRYIF_HPP
13#define RTCTK_COMPONENTFRAMEWORK_SERVICEREGISTRYIF_HPP
14
15#include <memory>
16#include <string>
17
18#include <mal/Cii.hpp>
19
21
23
31public:
40 using AdapterIdType = elt::mal::Uri;
41
42 using ServiceEndpoint = elt::mal::Uri;
43
48 static const std::string REQ_REP_ENDPOINT;
49
53 static const std::string PUB_SUB_ENDPOINT;
54
59 static const std::string COMPONENT_TYPE;
60
62 public:
63 explicit InvalidComponent(const std::string& component, const std::string& service);
64 explicit InvalidComponent(const std::string& component,
65 const std::string& service,
66 const std::string& reason);
67 };
69 public:
70 explicit InvalidService(const std::string& service);
71 explicit InvalidService(const std::string& service, const std::string& reason);
72 };
74 public:
75 explicit ConsulUnavailable(const std::string& message, const std::string& service);
76 };
77
80 virtual ~ServiceRegistryIf() = default;
81
90 virtual std::vector<std::string>
91 ListComponents(const std::string& service_type = COMPONENT_TYPE) = 0;
92
109
123 virtual ServiceEndpoint Get(const std::string& comp_name,
124 const std::string& service_name,
125 const std::string& service_type = COMPONENT_TYPE,
126 const bool health_check = true) = 0;
127
148 static std::unique_ptr<ServiceRegistryIf> CreateAdapter(const elt::mal::Uri& uri);
149};
150
151} // namespace rtctk::componentFramework
152
153#endif // RTCTK_COMPONENTFRAMEWORK_SERVICEREGISTRYIF_HPP
RtctkException() noexcept
Definition exceptions.cpp:112
ConsulUnavailable(const std::string &message, const std::string &service)
Definition serviceRegistryIf.cpp:57
InvalidComponent(const std::string &component, const std::string &service)
Definition serviceRegistryIf.cpp:32
InvalidService(const std::string &service)
Definition serviceRegistryIf.cpp:48
Class that implements a service registry to be used by the service discovery.
Definition serviceRegistryIf.hpp:30
virtual ServiceEndpoint GetOldbEndpoint()=0
Get the Oldb Endpoint from the service registry.
static const std::string REQ_REP_ENDPOINT
the string used to identify the Request/Reply endpoint of a service when using the Get function.
Definition serviceRegistryIf.hpp:48
elt::mal::Uri AdapterIdType
The type used to distinguish between different adapters implementing ServiceRegistryIf.
Definition serviceRegistryIf.hpp:40
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.
virtual std::vector< std::string > ListComponents(const std::string &service_type=COMPONENT_TYPE)=0
Get known components.
static const std::string COMPONENT_TYPE
the string for component type (default)
Definition serviceRegistryIf.hpp:59
virtual ServiceEndpoint GetRuntimeRepoEndpoint()=0
Get the Runtime Repository Endpoint from the service registry.
static const std::string PUB_SUB_ENDPOINT
the string used to identify the PubSub endpoint of a service when using the Get function.
Definition serviceRegistryIf.hpp:53
virtual ~ServiceRegistryIf()=default
virtual destructor
virtual ServiceEndpoint GetPersistentRepoEndpoint()=0
Get the Persistent Repository Endpoint from the service registry.
elt::mal::Uri ServiceEndpoint
Definition serviceRegistryIf.hpp:42
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.
Definition serviceRegistryIf.cpp:63
virtual ServiceEndpoint GetTelegrafEndpoint()=0
Get the Telegraf Endpoint from the service registry.
Provides macros and utilities for exception handling.
Definition commandReplier.cpp:21