AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
DownchannelHandler.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_ACL_INCLUDE_ACL_TRANSPORT_DOWNCHANNELHANDLER_H_
17 #define ALEXA_CLIENT_SDK_ACL_INCLUDE_ACL_TRANSPORT_DOWNCHANNELHANDLER_H_
18 
19 #include <memory>
20 
25 
29 
30 namespace alexaClientSDK {
31 namespace acl {
32 
33 class DownchannelHandler;
34 
39  : public ExchangeHandler
42  , public std::enable_shared_from_this<DownchannelHandler> {
43 public:
54  static std::shared_ptr<DownchannelHandler> create(
55  std::shared_ptr<ExchangeHandlerContextInterface> context,
56  const std::string& authToken,
57  std::shared_ptr<MessageConsumerInterface> messageConsumer,
58  std::shared_ptr<avsCommon::avs::attachment::AttachmentManagerInterface> attachmentManager,
59  const std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface>& metricRecorder);
60 
61 private:
70  std::shared_ptr<ExchangeHandlerContextInterface> context,
71  const std::string& authToken,
72  const std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface>& metricRecorder);
73 
76  std::vector<std::string> getRequestHeaderLines() override;
77  avsCommon::utils::http2::HTTP2SendDataResult onSendData(char* bytes, size_t size) override;
79 
82  void onActivity() override;
83  bool onReceiveResponseCode(long responseCode) override;
84  void onResponseFinished(avsCommon::utils::http2::HTTP2ResponseFinishedStatus status, const std::string& nonMimeBody)
85  override;
87 
89  std::shared_ptr<avsCommon::utils::power::PowerResource> m_powerResource;
90 
92  std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface> m_metricRecorder;
93 };
94 
95 } // namespace acl
96 } // namespace alexaClientSDK
97 
98 #endif // ALEXA_CLIENT_SDK_ACL_INCLUDE_ACL_TRANSPORT_DOWNCHANNELHANDLER_H_
static std::shared_ptr< DownchannelHandler > create(std::shared_ptr< ExchangeHandlerContextInterface > context, const std::string &authToken, std::shared_ptr< MessageConsumerInterface > messageConsumer, std::shared_ptr< avsCommon::avs::attachment::AttachmentManagerInterface > attachmentManager, const std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > &metricRecorder)
Definition: DownchannelHandler.h:38
::std::string string
Definition: gtest-port.h:1097
static std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder
Metric recorder shared ptr.
Definition: BaseAPLCapabilityAgentTest.cpp:261
HTTP2ResponseFinishedStatus
Definition: HTTP2ResponseFinishedStatus.h:29
Definition: ExchangeHandler.h:31
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Definition: MimeResponseStatusHandlerInterface.h:29

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0