public abstract class SpeechletRequestStreamHandler extends Object implements com.amazonaws.services.lambda.runtime.RequestStreamHandler
Lambda functions written in Java must have a RequestStreamHandler class for the handler.
That handler must include a zero argument constructor and implement RequestStreamHandler.
The SpeechletRequestStreamHandler abstract class can be used to create such a class.
Extend SpeechletRequestStreamHandler and implement a new zero-argument constructor. Pass
the appropriate SpeechletV2 and Set of supported ApplicationIds to the
super constructor from your new constructor.
When configuring your Lambda function in the AWS Lambda console, specify your new class as the Handler.
| Constructor and Description |
|---|
SpeechletRequestStreamHandler(Speechlet speechlet,
Set<String> supportedApplicationIds) |
SpeechletRequestStreamHandler(SpeechletV2 speechlet,
Set<String> supportedApplicationIds)
When extending this class, use a zero argument constructor and pass the appropriate
SpeechletV2 and Set of supported ApplicationIds to this method. |
| Modifier and Type | Method and Description |
|---|---|
void |
handleRequest(InputStream input,
OutputStream output,
com.amazonaws.services.lambda.runtime.Context context)
This method is the primary entry point when executing your Lambda function.
|
public SpeechletRequestStreamHandler(SpeechletV2 speechlet, Set<String> supportedApplicationIds)
SpeechletV2 and Set of supported ApplicationIds to this method.speechlet - the SpeechletV2 that handles the requestssupportedApplicationIds - a Set of supported ApplicationIds used to validate that the
requests are intended for your servicepublic final void handleRequest(InputStream input, OutputStream output, com.amazonaws.services.lambda.runtime.Context context) throws IOException
SpeechletRequestHandler determines the type of request and dispatches the request to
the configured SpeechletV2.
Any errors that occur in either the SpeechletV2 or the SpeechletRequestHandler
are converted into a RuntimeException, causing the Lambda call to fail. Details on
the failure are then available in the Lambda console logs within CloudWatch.
handleRequest in interface com.amazonaws.services.lambda.runtime.RequestStreamHandlerIOExceptionCopyright © 2016. All rights reserved.