AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::acl::test::MockMimeResponseSink Class Reference

#include <MockMimeResponseSink.h>

Inheritance diagram for alexaClientSDK::acl::test::MockMimeResponseSink:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acl::test::MockMimeResponseSink:
Collaboration graph
[legend]

Public Member Functions

 MockMimeResponseSink ()
 
virtual ~MockMimeResponseSink ()=default
 
std::vector< char > getMimePart (unsigned part)
 
unsigned getCountOfMimeParts ()
 
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
 

Detailed Description

A mock class of HTTP2MimeResponseSinkInterface that stores the contents of parsed of a MIME message.

Constructor & Destructor Documentation

◆ MockMimeResponseSink()

alexaClientSDK::acl::test::MockMimeResponseSink::MockMimeResponseSink ( )

Constructor.

◆ ~MockMimeResponseSink()

virtual alexaClientSDK::acl::test::MockMimeResponseSink::~MockMimeResponseSink ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getCountOfMimeParts()

unsigned alexaClientSDK::acl::test::MockMimeResponseSink::getCountOfMimeParts ( )

Get the total number of MIME parts parsed.

Returns
The number of MIME parts parsed.

◆ getMimePart()

std::vector< char > alexaClientSDK::acl::test::MockMimeResponseSink::getMimePart ( unsigned  part)

Get the contents of a MIME part.

Parameters
partThe index of MIME part starting from 0.
Returns
A buffer that contains the MIME part.

◆ onBeginMimePart()

bool alexaClientSDK::acl::test::MockMimeResponseSink::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::acl::test::MockMimeResponseSink::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::acl::test::MockMimeResponseSink::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()

avsCommon::utils::http2::HTTP2ReceiveDataStatus alexaClientSDK::acl::test::MockMimeResponseSink::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()

avsCommon::utils::http2::HTTP2ReceiveDataStatus alexaClientSDK::acl::test::MockMimeResponseSink::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::acl::test::MockMimeResponseSink::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::acl::test::MockMimeResponseSink::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.


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