AlexaClientSDK  1.23.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Namespaces | Classes | Functions | Variables
alexaClientSDK::acl Namespace Reference

Namespaces

 test
 
 transport
 

Classes

class  AVSConnectionManager
 
class  DownchannelHandler
 
class  ExchangeHandler
 
class  ExchangeHandlerContextInterface
 
class  HTTP2Transport
 
class  HTTP2TransportFactory
 
class  LegacyProviderRegistrar
 
class  MessageConsumerInterface
 
class  MessageRequestHandler
 
class  MessageRequestQueue
 
class  MessageRequestQueueInterface
 
class  MessageRouter
 
class  MessageRouterFactory
 
class  MessageRouterFactoryInterface
 
class  MessageRouterInterface
 
class  MessageRouterObserverInterface
 
class  MimeResponseSink
 
class  MimeResponseStatusHandlerInterface
 
class  PingHandler
 
class  PostConnectFactoryInterface
 
class  PostConnectInterface
 
class  PostConnectObserverInterface
 
struct  PostConnectOperationPriorityCompare
 
class  PostConnectSequencer
 
class  PostConnectSequencerFactory
 
class  SynchronizedMessageRequestQueue
 
class  TransportDefines
 
class  TransportFactoryInterface
 
class  TransportInterface
 
class  TransportObserverInterface
 

Functions

static const std::string TAG ("AVSConnectionManager")
 String to identify log entries originating from this file. More...
 
static const std::string TAG ("DownchannelHandler")
 String to identify log entries originating from this file. More...
 
static const std::string TAG ("ExchangeHandler")
 String to identify log entries originating from this file. More...
 
static const std::string TAG ("HTTP2Transport")
 String to identify log entries originating from this file. More...
 
std::ostream & operator<< (std::ostream &stream, HTTP2Transport::State state)
 
static const std::string TAG ("HTTP2TransportFactory")
 String to identify log entries originating from this file. More...
 
static const std::string TAG ("MessageRequestHandler")
 String to identify log entries originating from this file. More...
 
static void collectSendDataResultMetric (const std::shared_ptr< MetricRecorderInterface > &metricRecorder, int count, const std::string &readStatus)
 
static const std::string TAG ("MessageRequestQueue")
 String to identify log entries originating from this file. More...
 
static const std::string TAG ("MessageRouter")
 String to identify log entries originating from this file. More...
 
static const std::string TAG ("MimeResponseSink")
 String to identify log entries originating from this file. More...
 
static std::string sanitizeContentId (const std::string &mimeContentId)
 
static const std::chrono::milliseconds PING_TRANSFER_TIMEOUT (15000)
 Max time to wait for a ping reply. More...
 
static const std::string TAG ("PingHandler")
 String to identify log entries originating from this file. More...
 
static const std::string TAG ("PostConnectSequencer")
 String to identify log entries originating form this file. More...
 
static const std::string TAG ("PostConnectSequencerFactory")
 String to identify log entries originating from this file. More...
 
static const std::string TAG ("SynchronizedMessageRequestQueue")
 String to identify log entries originating from this file. More...
 

Variables

static const std::string AVS_DOWNCHANNEL_URL_PATH_EXTENSION = "/v20160207/directives"
 Downchannel URL. More...
 
static const std::string DOWNCHANNEL_ID_PREFIX = "AVSDownChannel-"
 Prefix for the ID of downchannel requests. More...
 
static const std::chrono::seconds ESTABLISH_CONNECTION_TIMEOUT = std::chrono::seconds(60)
 How long to wait for a downchannel request to connect to AVS. More...
 
static const std::string AUTHORIZATION_HEADER = "Authorization: Bearer "
 HTTP Header key for the bearer token. More...
 
static const int MAX_STREAMS = 10
 
static const int MAX_MESSAGE_HANDLERS = MAX_STREAMS - 2
 Max number of message requests MAX_STREAMS - 2 (for the downchannel stream and the ping stream) More...
 
static std::chrono::minutes INACTIVITY_TIMEOUT {5}
 Timeout to send a ping to AVS if there has not been any other acitivity on the connection. More...
 
static const std::chrono::seconds MESSAGE_QUEUE_TIMEOUT = std::chrono::seconds(15)
 Max time a MessageRequest should linger unprocessed before it should be consider TIMEDOUT. More...
 
static const std::string AVS_EVENT_URL_PATH_EXTENSION = "/v20160207/events"
 URL to send events to. More...
 
static const std::string MIME_BOUNDARY = "WhooHooZeerOoonie="
 Boundary for mime encoded requests. More...
 
static const std::chrono::seconds STREAM_PROGRESS_TIMEOUT = std::chrono::seconds(15)
 Timeout for transmission of data on a given stream. More...
 
static const std::vector< std::string > JSON_MIME_PART_HEADER_LINES
 Mime header strings for mime parts containing json payloads. More...
 
static const std::string CONTENT_DISPOSITION_PREFIX = "Content-Disposition: form-data; name=\""
 Mime Content-Disposition line before name. More...
 
static const std::string CONTENT_DISPOSITION_SUFFIX = "\""
 Mime Content-Disposition line after name. More...
 
static const std::string ATTACHMENT_CONTENT_TYPE = "Content-Type: application/octet-stream"
 Mime Content-Type for attchments. More...
 
static const std::string MESSAGEREQUEST_ID_PREFIX = "AVSEvent-"
 Prefix for the ID of message requests. More...
 
static const std::string ACL_METRIC_SOURCE_PREFIX = "ACL-"
 Prefix used to identify metrics published by this module. More...
 
static const std::string SEND_DATA_ERROR = "ERROR.SEND_DATA_ERROR"
 Metric identifier for send mime data error. More...
 
static const std::string READ_STATUS_TAG = "READ_STATUS"
 Read status tag. More...
 
static const std::string ERROR_READ_OVERRUN = "READ_OVERRUN"
 Read overrun error. More...
 
static const std::string ERROR_INTERNAL = "INTERNAL_ERROR"
 Internal error. More...
 
static const std::string SEND_COMPLETED = "SEND_COMPLETED"
 Send completed. More...
 
static const std::string HTTP_KEY_VALUE_SEPARATOR = ": "
 
static const std::string EMPTY_QUEUE_NAME = ""
 
static constexpr const char * KEY_SIZEOF_TRANSPORTS = "sizeOf m_transports"
 String for logging purpose as the key for the size of m_transports. More...
 
static const std::string X_AMZN_REQUESTID_PREFIX = "x-amzn-requestid:"
 The prefix of request IDs passed back in the header of AVS replies. More...
 
static const std::string MIME_CONTENT_TYPE_FIELD_NAME = "Content-Type"
 MIME field name for a part's MIME type. More...
 
static const std::string MIME_CONTENT_ID_FIELD_NAME = "Content-ID"
 MIME field name for a part's reference id. More...
 
static const std::string MIME_JSON_CONTENT_TYPE = "application/json"
 MIME type for JSON payloads. More...
 
static const std::string MIME_OCTET_STREAM_CONTENT_TYPE = "application/octet-stream"
 MIME type for binary streams. More...
 
static const size_t NON_MIME_BODY_MAX_SIZE = 4096
 Maximum size of non-mime body to accumulate. More...
 
static const std::string AVS_PING_URL_PATH_EXTENSION = "/ping"
 URL to send pings to. More...
 
static const uint8_t PING_PRIORITY = 200
 Priority for ping requests (high, default is 16). More...
 
static const std::string PING_ID_PREFIX = "AVSPing-"
 Prefix for the ID of ping requests. More...
 

Function Documentation

◆ collectSendDataResultMetric()

static void alexaClientSDK::acl::collectSendDataResultMetric ( const std::shared_ptr< MetricRecorderInterface > &  metricRecorder,
int  count,
const std::string &  readStatus 
)
static

Capture metric for the last send data result.

Parameters
metricRecorderThe metric recorder object.
countNumber of errors.
readStatusThe read status.

◆ operator<<()

std::ostream& alexaClientSDK::acl::operator<< ( std::ostream &  stream,
HTTP2Transport::State  state 
)

Write a HTTP2Transport::State value to an ostream as a string.

Parameters
streamThe stream to write the value to.
stateThe state to write to the ostream as a string.
Returns
The ostream that was passed in and written to.

◆ PING_TRANSFER_TIMEOUT()

static const std::chrono::milliseconds alexaClientSDK::acl::PING_TRANSFER_TIMEOUT ( 15000  )
static

Max time to wait for a ping reply.

◆ sanitizeContentId()

static std::string alexaClientSDK::acl::sanitizeContentId ( const std::string &  mimeContentId)
static

Sanitize the Content-ID field in MIME header.

This function is necessary per RFC-2392: A "cid" URL is converted to the corresponding Content-ID message header MIME by removing the "cid:" prefix, and enclosing the remaining parts with an angle bracket pair, "<" and ">". For example, "cid:foo4%25foo1@bar.net" corresponds to Content-ID: <foo4%25foo.nosp@m.1@ba.nosp@m.r.net>

Parameters
mimeContentIdThe raw content ID value in MIME header.
Returns
The sanitized content ID.

◆ TAG() [1/13]

static const std::string alexaClientSDK::acl::TAG ( "MessageRequestQueue"  )
static

String to identify log entries originating from this file.

◆ TAG() [2/13]

static const std::string alexaClientSDK::acl::TAG ( "SynchronizedMessageRequestQueue"  )
static

String to identify log entries originating from this file.

◆ TAG() [3/13]

static const std::string alexaClientSDK::acl::TAG ( "AVSConnectionManager"  )
static

String to identify log entries originating from this file.

◆ TAG() [4/13]

static const std::string alexaClientSDK::acl::TAG ( "PostConnectSequencerFactory"  )
static

String to identify log entries originating from this file.

◆ TAG() [5/13]

static const std::string alexaClientSDK::acl::TAG ( "HTTP2TransportFactory"  )
static

String to identify log entries originating from this file.

◆ TAG() [6/13]

static const std::string alexaClientSDK::acl::TAG ( "ExchangeHandler"  )
static

String to identify log entries originating from this file.

◆ TAG() [7/13]

static const std::string alexaClientSDK::acl::TAG ( "PostConnectSequencer"  )
static

String to identify log entries originating form this file.

◆ TAG() [8/13]

static const std::string alexaClientSDK::acl::TAG ( "MessageRouter"  )
static

String to identify log entries originating from this file.

◆ TAG() [9/13]

static const std::string alexaClientSDK::acl::TAG ( "DownchannelHandler"  )
static

String to identify log entries originating from this file.

◆ TAG() [10/13]

static const std::string alexaClientSDK::acl::TAG ( "HTTP2Transport"  )
static

String to identify log entries originating from this file.

◆ TAG() [11/13]

static const std::string alexaClientSDK::acl::TAG ( "PingHandler"  )
static

String to identify log entries originating from this file.

◆ TAG() [12/13]

static const std::string alexaClientSDK::acl::TAG ( "MimeResponseSink"  )
static

String to identify log entries originating from this file.

◆ TAG() [13/13]

static const std::string alexaClientSDK::acl::TAG ( "MessageRequestHandler"  )
static

String to identify log entries originating from this file.

Variable Documentation

◆ ACL_METRIC_SOURCE_PREFIX

const std::string alexaClientSDK::acl::ACL_METRIC_SOURCE_PREFIX = "ACL-"
static

Prefix used to identify metrics published by this module.

◆ ATTACHMENT_CONTENT_TYPE

const std::string alexaClientSDK::acl::ATTACHMENT_CONTENT_TYPE = "Content-Type: application/octet-stream"
static

Mime Content-Type for attchments.

◆ AUTHORIZATION_HEADER

const std::string alexaClientSDK::acl::AUTHORIZATION_HEADER = "Authorization: Bearer "
static

HTTP Header key for the bearer token.

◆ AVS_DOWNCHANNEL_URL_PATH_EXTENSION

const std::string alexaClientSDK::acl::AVS_DOWNCHANNEL_URL_PATH_EXTENSION = "/v20160207/directives"
static

Downchannel URL.

◆ AVS_EVENT_URL_PATH_EXTENSION

const std::string alexaClientSDK::acl::AVS_EVENT_URL_PATH_EXTENSION = "/v20160207/events"
static

URL to send events to.

◆ AVS_PING_URL_PATH_EXTENSION

const std::string alexaClientSDK::acl::AVS_PING_URL_PATH_EXTENSION = "/ping"
static

URL to send pings to.

◆ CONTENT_DISPOSITION_PREFIX

const std::string alexaClientSDK::acl::CONTENT_DISPOSITION_PREFIX = "Content-Disposition: form-data; name=\""
static

Mime Content-Disposition line before name.

◆ CONTENT_DISPOSITION_SUFFIX

const std::string alexaClientSDK::acl::CONTENT_DISPOSITION_SUFFIX = "\""
static

Mime Content-Disposition line after name.

◆ DOWNCHANNEL_ID_PREFIX

const std::string alexaClientSDK::acl::DOWNCHANNEL_ID_PREFIX = "AVSDownChannel-"
static

Prefix for the ID of downchannel requests.

◆ EMPTY_QUEUE_NAME

const std::string alexaClientSDK::acl::EMPTY_QUEUE_NAME = ""
static

◆ ERROR_INTERNAL

const std::string alexaClientSDK::acl::ERROR_INTERNAL = "INTERNAL_ERROR"
static

Internal error.

◆ ERROR_READ_OVERRUN

const std::string alexaClientSDK::acl::ERROR_READ_OVERRUN = "READ_OVERRUN"
static

Read overrun error.

◆ ESTABLISH_CONNECTION_TIMEOUT

const std::chrono::seconds alexaClientSDK::acl::ESTABLISH_CONNECTION_TIMEOUT = std::chrono::seconds(60)
static

How long to wait for a downchannel request to connect to AVS.

◆ HTTP_KEY_VALUE_SEPARATOR

const std::string alexaClientSDK::acl::HTTP_KEY_VALUE_SEPARATOR = ": "
static

◆ INACTIVITY_TIMEOUT

std::chrono::minutes alexaClientSDK::acl::INACTIVITY_TIMEOUT {5}
static

Timeout to send a ping to AVS if there has not been any other acitivity on the connection.

◆ JSON_MIME_PART_HEADER_LINES

const std::vector<std::string> alexaClientSDK::acl::JSON_MIME_PART_HEADER_LINES
static
Initial value:
= {
"Content-Disposition: form-data; name=\"metadata\"",
"Content-Type: application/json"}

Mime header strings for mime parts containing json payloads.

◆ KEY_SIZEOF_TRANSPORTS

constexpr const char* alexaClientSDK::acl::KEY_SIZEOF_TRANSPORTS = "sizeOf m_transports"
static

String for logging purpose as the key for the size of m_transports.

◆ MAX_MESSAGE_HANDLERS

const int alexaClientSDK::acl::MAX_MESSAGE_HANDLERS = MAX_STREAMS - 2
static

Max number of message requests MAX_STREAMS - 2 (for the downchannel stream and the ping stream)

◆ MAX_STREAMS

const int alexaClientSDK::acl::MAX_STREAMS = 10
static

The maximum number of streams we can have active at once. Please see here for more information: https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/docs/managing-an-http-2-connection

◆ MESSAGE_QUEUE_TIMEOUT

const std::chrono::seconds alexaClientSDK::acl::MESSAGE_QUEUE_TIMEOUT = std::chrono::seconds(15)
static

Max time a MessageRequest should linger unprocessed before it should be consider TIMEDOUT.

◆ MESSAGEREQUEST_ID_PREFIX

const std::string alexaClientSDK::acl::MESSAGEREQUEST_ID_PREFIX = "AVSEvent-"
static

Prefix for the ID of message requests.

◆ MIME_BOUNDARY

const std::string alexaClientSDK::acl::MIME_BOUNDARY = "WhooHooZeerOoonie="
static

Boundary for mime encoded requests.

◆ MIME_CONTENT_ID_FIELD_NAME

const std::string alexaClientSDK::acl::MIME_CONTENT_ID_FIELD_NAME = "Content-ID"
static

MIME field name for a part's reference id.

◆ MIME_CONTENT_TYPE_FIELD_NAME

const std::string alexaClientSDK::acl::MIME_CONTENT_TYPE_FIELD_NAME = "Content-Type"
static

MIME field name for a part's MIME type.

◆ MIME_JSON_CONTENT_TYPE

const std::string alexaClientSDK::acl::MIME_JSON_CONTENT_TYPE = "application/json"
static

MIME type for JSON payloads.

◆ MIME_OCTET_STREAM_CONTENT_TYPE

const std::string alexaClientSDK::acl::MIME_OCTET_STREAM_CONTENT_TYPE = "application/octet-stream"
static

MIME type for binary streams.

◆ NON_MIME_BODY_MAX_SIZE

const size_t alexaClientSDK::acl::NON_MIME_BODY_MAX_SIZE = 4096
static

Maximum size of non-mime body to accumulate.

◆ PING_ID_PREFIX

const std::string alexaClientSDK::acl::PING_ID_PREFIX = "AVSPing-"
static

Prefix for the ID of ping requests.

◆ PING_PRIORITY

const uint8_t alexaClientSDK::acl::PING_PRIORITY = 200
static

Priority for ping requests (high, default is 16).

◆ READ_STATUS_TAG

const std::string alexaClientSDK::acl::READ_STATUS_TAG = "READ_STATUS"
static

Read status tag.

◆ SEND_COMPLETED

const std::string alexaClientSDK::acl::SEND_COMPLETED = "SEND_COMPLETED"
static

Send completed.

◆ SEND_DATA_ERROR

const std::string alexaClientSDK::acl::SEND_DATA_ERROR = "ERROR.SEND_DATA_ERROR"
static

Metric identifier for send mime data error.

◆ STREAM_PROGRESS_TIMEOUT

const std::chrono::seconds alexaClientSDK::acl::STREAM_PROGRESS_TIMEOUT = std::chrono::seconds(15)
static

Timeout for transmission of data on a given stream.

◆ X_AMZN_REQUESTID_PREFIX

const std::string alexaClientSDK::acl::X_AMZN_REQUESTID_PREFIX = "x-amzn-requestid:"
static

The prefix of request IDs passed back in the header of AVS replies.

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