16 #ifndef ALEXA_CLIENT_SDK_CERTIFIEDSENDER_INCLUDE_CERTIFIEDSENDER_CERTIFIEDSENDER_H_ 17 #define ALEXA_CLIENT_SDK_CERTIFIEDSENDER_INCLUDE_CERTIFIEDSENDER_CERTIFIEDSENDER_H_ 37 namespace certifiedSender {
61 ,
public std::enable_shared_from_this<CertifiedSender>
73 static std::shared_ptr<CertifiedSender>
create(
74 std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface> messageSender,
75 std::shared_ptr<avsCommon::sdkInterfaces::AVSConnectionManagerInterface> connection,
76 std::shared_ptr<MessageStorageInterface> storage,
77 std::shared_ptr<registrationManager::CustomerDataManagerInterface> dataManager);
117 CertifiedMessageRequest(
const std::string& jsonContent,
int dbId,
const std::string& uriPathExtension =
"");
119 void exceptionReceived(
const std::string& exceptionMessage)
override;
147 bool m_responseReceived;
149 std::mutex m_requestMutex;
155 bool m_isRequestShuttingDown;
169 std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface> messageSender,
170 std::shared_ptr<avsCommon::sdkInterfaces::AVSConnectionManagerInterface> connection,
171 std::shared_ptr<MessageStorageInterface> storage,
172 std::shared_ptr<registrationManager::CustomerDataManagerInterface> dataManager,
173 int queueSizeWarnLimit = CERTIFIED_SENDER_QUEUE_SIZE_WARN_LIMIT,
174 int queueSizeHardLimit = CERTIFIED_SENDER_QUEUE_SIZE_HARD_LIMIT);
176 void onConnectionStatusChanged(
197 void doShutdown()
override;
205 int m_queueSizeWarnLimit;
207 int m_queueSizeHardLimit;
210 std::thread m_workerThread;
213 bool m_isShuttingDown;
228 std::deque<std::shared_ptr<CertifiedMessageRequest>> m_messagesToSend;
231 std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface> m_messageSender;
234 std::shared_ptr<CertifiedMessageRequest> m_currentMessage;
237 std::shared_ptr<avsCommon::sdkInterfaces::AVSConnectionManagerInterface> m_connection;
240 std::shared_ptr<MessageStorageInterface> m_storage;
243 std::shared_ptr<avsCommon::utils::power::PowerResource> m_powerResource;
255 #endif // ALEXA_CLIENT_SDK_CERTIFIEDSENDER_INCLUDE_CERTIFIEDSENDER_CERTIFIEDSENDER_H_ static std::shared_ptr< CertifiedSender > create(std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > messageSender, std::shared_ptr< avsCommon::sdkInterfaces::AVSConnectionManagerInterface > connection, std::shared_ptr< MessageStorageInterface > storage, std::shared_ptr< registrationManager::CustomerDataManagerInterface > dataManager)
Definition: ConditionVariableWrapper.h:40
ChangedReason
Definition: ConnectionStatusObserverInterface.h:50
std::future< bool > sendJSONMessage(const std::string &jsonMessage, const std::string &uriPathExtension="")
Definition: MessageRequest.h:40
::std::string string
Definition: gtest-port.h:1097
Single-thread executor implementation.
Definition: Executor.h:45
Definition: ConnectionStatusObserverInterface.h:31
Definition: RequiresShutdown.h:32
static const int CERTIFIED_SENDER_QUEUE_SIZE_WARN_LIMIT
The number of items we can store for sending without emitting a warning.
Definition: CertifiedSender.h:40
Definition: CertifiedSender.h:58
void clearData() override
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Status
Definition: MessageRequestObserverInterface.h:33
virtual ~CertifiedSender()
Definition: CustomerDataHandler.h:34
Definition: RetryTimer.h:30
Status
Definition: ConnectionStatusObserverInterface.h:36
static const int CERTIFIED_SENDER_QUEUE_SIZE_HARD_LIMIT
The maximum number of items we can store for sending.
Definition: CertifiedSender.h:42