AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Public Attributes | List of all members
alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink Class Reference

#include <MockHTTP2MimeResponseDecodeSink.h>

Inheritance diagram for alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink:
Collaboration graph
[legend]

Public Member Functions

 MockHTTP2MimeResponseDecodeSink ()
 
bool hasSameContentAs (std::shared_ptr< MockHTTP2MimeRequestEncodeSource > source)
 
 ~MockHTTP2MimeResponseDecodeSink ()=default
 
HTTP2MimeResponseSinkInterface methods.
bool onReceiveResponseCode (long responseCode) override
 
bool onReceiveHeaderLine (const std::string &line) override
 
bool onBeginMimePart (const std::multimap< std::string, std::string > &headers) override
 
avsCommon::utils::http2::HTTP2ReceiveDataStatus onReceiveMimeData (const char *bytes, size_t size) override
 
bool onEndMimePart () override
 
avsCommon::utils::http2::HTTP2ReceiveDataStatus onReceiveNonMimeData (const char *bytes, size_t size) override
 
void onResponseFinished (avsCommon::utils::http2::HTTP2ResponseFinishedStatus status) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface
virtual ~HTTP2MimeResponseSinkInterface ()=default
 

Public Attributes

std::vector< std::string > m_data
 MIME data parts received. More...
 
std::vector< std::multimap< std::string, std::string > > m_headers
 MIME headers received for every part. More...
 
size_t m_index {0}
 current MIME part index More...
 
bool m_slowSink {false}
 enable sending PAUSE intermittently More...
 
bool m_abort {false}
 If ABORT is to be sent. More...
 
size_t m_pauseCount {0}
 PAUSE count. More...
 
std::string m_nonMimeData
 Non mime data received. More...
 

Constructor & Destructor Documentation

◆ MockHTTP2MimeResponseDecodeSink()

alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::MockHTTP2MimeResponseDecodeSink ( )

Constructor to provide the HTTP headers and data to be passed onto the decoder

◆ ~MockHTTP2MimeResponseDecodeSink()

alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::~MockHTTP2MimeResponseDecodeSink ( )
default

Destructor

Member Function Documentation

◆ hasSameContentAs()

bool alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::hasSameContentAs ( std::shared_ptr< MockHTTP2MimeRequestEncodeSource source)

Helper method to compare data with source

Parameters
sourceRequestSource used to generate the original encoded message
Returns
true if data is same

◆ onBeginMimePart()

bool alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::onBeginMimePart ( const std::multimap< std::string, std::string > &  headers)
overridevirtual

Notification of the start of a new mime part.

Note
Calls to this method may block network operations for the associated instance of HTTP2ConnectionInterface, so they should return quickly.
Parameters
headersA multimap from header names to header values.
Returns
Whether receipt of the response should continue.

Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface.

◆ onEndMimePart()

bool alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::onEndMimePart ( )
overridevirtual

Notification of the end of the current mime part.

Note
Calls to this method may block network operations for the associated instance of HTTP2ConnectionInterface, so they should return quickly.
Returns
Whether receipt of the response should continue.

Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface.

◆ onReceiveHeaderLine()

bool alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::onReceiveHeaderLine ( const std::string &  line)
overridevirtual

Notification that an HTTP header line was received.

Note
Calls to this method may block network operations for the associated instance of HTTP2ConnectionInterface, so they should return quickly.
Parameters
lineThe HTTP response header line that was received.
Returns
Whether receipt of the response should continue.

Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface.

◆ onReceiveMimeData()

HTTP2ReceiveDataStatus alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::onReceiveMimeData ( const char *  bytes,
size_t  size 
)
overridevirtual

Notification of new body data received from an HTTP2 response.

Note
Calls to this method may block network operations for the associated instance of HTTP2ConnectionInterface, so they should return quickly.
Parameters
bytesThe buffer containing the bytes to consume.
sizeThe number of bytes to consume.
Returns
Status of the operation.
See also
HTTP2ReceiveDataStatus

Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface.

◆ onReceiveNonMimeData()

HTTP2ReceiveDataStatus alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::onReceiveNonMimeData ( const char *  bytes,
size_t  size 
)
overridevirtual

Notification of receipt of non-mime body data in an HTTP2 response.

Note
Calls to this method may block network operations for the associated instance of HTTP2ConnectionInterface, so they should return quickly.
Parameters
bytesThe buffer containing the bytes to consume.
sizeThe number of bytes to consume.
Returns
Status of the operation.
See also
HTTP2ReceiveDataStatus.

Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface.

◆ onReceiveResponseCode()

bool alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::onReceiveResponseCode ( long  responseCode)
overridevirtual

Notification that an HTTP response code was returned for the request.

Note
Calls to this method may block network operations for the associated instance of HTTP2ConnectionInterface, so they should return quickly.
Parameters
responseCodeThe response code received for the request.
Returns
Whether receipt of the response should continue.

Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface.

◆ onResponseFinished()

void alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::onResponseFinished ( avsCommon::utils::http2::HTTP2ResponseFinishedStatus  status)
overridevirtual

Notification that the request/response cycle has finished and no further notifications will be provided.

Note
Calls to this method may block network operations for the associated instance of HTTP2ConnectionInterface, so they should return quickly.
Parameters
statusThe status with which the response finished.
See also
HTTP2ResponseFinishedStatus.

Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface.

Member Data Documentation

◆ m_abort

bool alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::m_abort {false}

If ABORT is to be sent.

◆ m_data

std::vector<std::string> alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::m_data

MIME data parts received.

These will be kept public to help testing

◆ m_headers

std::vector<std::multimap<std::string, std::string> > alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::m_headers

MIME headers received for every part.

◆ m_index

size_t alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::m_index {0}

current MIME part index

◆ m_nonMimeData

std::string alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::m_nonMimeData

Non mime data received.

◆ m_pauseCount

size_t alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::m_pauseCount {0}

PAUSE count.

◆ m_slowSink

bool alexaClientSDK::avsCommon::utils::http2::MockHTTP2MimeResponseDecodeSink::m_slowSink {false}

enable sending PAUSE intermittently


The documentation for this class was generated from the following files:

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