RTC Toolkit 5.0.0
Loading...
Searching...
No Matches
serviceRegistryIf.hpp
Go to the documentation of this file.
1
13#ifndef RTCTK_COMPONENTFRAMEWORK_SERVICEREGISTRYIF_HPP
14#define RTCTK_COMPONENTFRAMEWORK_SERVICEREGISTRYIF_HPP
15
16#include <memory>
17#include <string>
18
19#include <mal/Cii.hpp>
20
22
24
32public:
41 using AdapterIdType = elt::mal::Uri;
42
43 using ServiceEndpoint = elt::mal::Uri;
44
49 static const std::string REQ_REP_ENDPOINT;
50
54 static const std::string PUB_SUB_ENDPOINT;
55
60 static const std::string COMPONENT_TYPE;
61
63 public:
64 explicit InvalidComponent(const std::string& component, const std::string& service);
65 explicit InvalidComponent(const std::string& component,
66 const std::string& service,
67 const std::string& reason);
68 };
70 public:
71 explicit InvalidService(const std::string& service);
72 explicit InvalidService(const std::string& service, const std::string& reason);
73 };
75 public:
76 explicit ConsulUnavailable(const std::string& message, const std::string& service);
77 };
81 virtual ~ServiceRegistryIf() = default;
82
91 virtual std::vector<std::string>
92 ListComponents(const std::string& service_type = COMPONENT_TYPE) = 0;
93
106
120 virtual ServiceEndpoint Get(const std::string& comp_name,
121 const std::string& service_name,
122 const std::string& service_type = COMPONENT_TYPE,
123 const bool health_check = true) = 0;
124
145 static std::unique_ptr<ServiceRegistryIf> CreateAdapter(const elt::mal::Uri& uri);
146};
147
148} // namespace rtctk::componentFramework
149
150#endif // RTCTK_COMPONENTFRAMEWORK_SERVICEREGISTRYIF_HPP
The RtctkException class is the base class for all Rtctk exceptions.
Definition exceptions.hpp:211
ConsulUnavailable(const std::string &message, const std::string &service)
Definition serviceRegistryIf.cpp:58
InvalidComponent(const std::string &component, const std::string &service)
Definition serviceRegistryIf.cpp:33
InvalidService(const std::string &service)
Definition serviceRegistryIf.cpp:49
Class that implements a service registry to be used by the service discovery.
Definition serviceRegistryIf.hpp:31
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:49
elt::mal::Uri AdapterIdType
The type used to distinguish between different adapters implementing ServiceRegistryIf.
Definition serviceRegistryIf.hpp:41
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:60
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:54
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:43
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:64
Provides macros and utilities for exception handling.
Definition commandReplier.cpp:22
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23