16 #ifndef ALEXA_CLIENT_SDK_CAPABILITIESDELEGATE_INCLUDE_CAPABILITIESDELEGATE_DISCOVERYEVENTSENDER_H_ 17 #define ALEXA_CLIENT_SDK_CAPABILITIESDELEGATE_INCLUDE_CAPABILITIESDELEGATE_DISCOVERYEVENTSENDER_H_ 22 #include <unordered_map> 37 namespace capabilitiesDelegate {
44 ,
public std::enable_shared_from_this<DiscoveryEventSender> {
59 static std::shared_ptr<DiscoveryEventSender>
create(
60 const std::unordered_map<std::string, std::string>& addOrUpdateReportEndpoints,
61 const std::unordered_map<std::string, std::string>& deleteReportEndpoints,
62 const std::shared_ptr<avsCommon::sdkInterfaces::AuthDelegateInterface>& authDelegate,
63 bool waitForEventProcessed =
true,
64 const std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface>&
metricRecorder =
nullptr,
65 bool postConnect =
false);
75 const std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface>& messageSender)
override;
104 const std::unordered_map<std::string, std::string>& addOrUpdateReportEndpoints,
105 const std::unordered_map<std::string, std::string>& deleteReportEndpoints,
106 const std::shared_ptr<avsCommon::sdkInterfaces::AuthDelegateInterface>& authDelegate,
107 bool waitForEventProcessed,
108 const std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface>&
metricRecorder,
121 bool sendDiscoveryEventWithRetries(
122 const std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface>& messageSender,
123 const std::vector<std::string>& endpointConfigurations,
124 bool isAddOrUpdateReportEvent =
true);
136 const std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface>& messageSender,
138 bool waitForEventProcessed =
true);
147 bool sendAddOrUpdateReportEvents(
148 const std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface>& messageSender);
157 bool sendDeleteReportEvents(
const std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface>& messageSender);
169 const std::vector<std::string>& endpointConfigurations,
170 const std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface>& messageSender,
171 bool isAddOrUpdateReportEvent =
true);
197 std::unordered_map<std::string, std::string> m_addOrUpdateReportEndpoints;
200 std::unordered_map<std::string, std::string> m_deleteReportEndpoints;
203 std::shared_ptr<avsCommon::sdkInterfaces::AuthDelegateInterface> m_authDelegate;
206 std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface> m_metricRecorder;
212 std::mutex m_authStatusMutex;
234 std::shared_ptr<avsCommon::avs::WaitableMessageRequest> m_messageRequest;
237 std::mutex m_observerMutex;
240 std::shared_ptr<DiscoveryStatusObserverInterface> m_observer;
243 std::mutex m_isSendDiscoveryEventsInvokedMutex;
246 bool m_isSendDiscoveryEventsInvoked;
249 const bool m_waitForEventProcessed;
252 const bool m_postConnect;
258 #endif // ALEXA_CLIENT_SDK_CAPABILITIESDELEGATE_INCLUDE_CAPABILITIESDELEGATE_DISCOVERYEVENTSENDER_H_ void addDiscoveryStatusObserver(const std::shared_ptr< DiscoveryStatusObserverInterface > &observer) override
Definition: DiscoveryEventSender.h:42
Definition: DiscoveryEventSenderInterface.h:29
Definition: ConditionVariableWrapper.h:40
::std::string string
Definition: gtest-port.h:1097
Definition: WaitEvent.h:32
static std::shared_ptr< DiscoveryEventSender > create(const std::unordered_map< std::string, std::string > &addOrUpdateReportEndpoints, const std::unordered_map< std::string, std::string > &deleteReportEndpoints, const std::shared_ptr< avsCommon::sdkInterfaces::AuthDelegateInterface > &authDelegate, bool waitForEventProcessed=true, const std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > &metricRecorder=nullptr, bool postConnect=false)
static std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder
Metric recorder shared ptr.
Definition: BaseAPLCapabilityAgentTest.cpp:261
bool sendDiscoveryEvents(const std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > &messageSender) override
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
void onAlexaEventProcessedReceived(const std::string &eventCorrelationToken) override
void onAuthStateChange(AuthObserverInterface::State newState, AuthObserverInterface::Error newError) override
void removeDiscoveryStatusObserver(const std::shared_ptr< DiscoveryStatusObserverInterface > &observer) override
State
Definition: State.h:35
Status
Definition: MessageRequestObserverInterface.h:33