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 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 interface com.amazonaws.services.lambda.runtime.RequestStreamHandler
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getApplicationContext

      public io.micronaut.context.ApplicationContext getApplicationContext()
      Specified by:
      getApplicationContext in interface io.micronaut.context.ApplicationContextProvider