Package io.micronaut.function.aws.alexa
Class AlexaFunction
java.lang.Object
io.micronaut.function.aws.alexa.AlexaFunction
- All Implemented Interfaces:
com.amazonaws.services.lambda.runtime.RequestStreamHandler
,io.micronaut.context.ApplicationContextProvider
,Closeable
,AutoCloseable
public class AlexaFunction
extends Object
implements com.amazonaws.services.lambda.runtime.RequestStreamHandler, AutoCloseable, Closeable, io.micronaut.context.ApplicationContextProvider
This is the base function you extend for Alexa skills support. For now you have to override apply but just call super() in it.
Your skill itself goes in implementing getSkill() and adding handlers for your intents.
- Author:
- Ryan Vanderwerf, Graeme Rocher, sdelamo
-
Field Summary
Modifier and TypeFieldDescriptionprotected io.micronaut.context.ApplicationContext
protected com.amazon.ask.SkillStreamHandler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected @NonNull io.micronaut.context.ApplicationContext
void
close()
io.micronaut.context.ApplicationContext
void
handleRequest
(InputStream input, OutputStream output, com.amazonaws.services.lambda.runtime.Context context) protected @NonNull io.micronaut.context.ApplicationContextBuilder
Builds a new builder.
-
Field Details
-
applicationContext
protected io.micronaut.context.ApplicationContext applicationContext -
skillStreamHandler
protected com.amazon.ask.SkillStreamHandler skillStreamHandler
-
-
Constructor Details
-
AlexaFunction
public AlexaFunction()Default constructor.
-
-
Method Details
-
newApplicationContextBuilder
@NonNull protected @NonNull io.micronaut.context.ApplicationContextBuilder newApplicationContextBuilder()Builds a new builder.- Returns:
- The
ApplicationContextBuilder
-
buildApplicationContext
@NonNull protected @NonNull io.micronaut.context.ApplicationContext buildApplicationContext()- Returns:
- returns the current application context or starts a new one.
-
handleRequest
public void handleRequest(InputStream input, OutputStream output, com.amazonaws.services.lambda.runtime.Context context) throws IOException - Specified by:
handleRequest
in interfacecom.amazonaws.services.lambda.runtime.RequestStreamHandler
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
getApplicationContext
public io.micronaut.context.ApplicationContext getApplicationContext()- Specified by:
getApplicationContext
in interfaceio.micronaut.context.ApplicationContextProvider
-