Class HttpFunction

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    @Singleton
    public class HttpFunction
    extends OciFunction
    An parent HttpFunction for authoring Project.fn gateway functions.
    Since:
    1.0.0
    Author:
    graemerocher
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        HttpFunction()
      Default constructor.
      protected HttpFunction​(io.micronaut.context.ApplicationContext applicationContext)
      Constructor for using a shared application context.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.micronaut.servlet.http.ServletHttpHandler<com.fnproject.fn.api.InputEvent,​com.fnproject.fn.api.OutputEvent> getHttpHandler()  
      com.fnproject.fn.api.OutputEvent handleRequest​(com.fnproject.fn.api.httpgateway.HTTPGatewayContext gatewayContext, com.fnproject.fn.api.InputEvent inputEvent)
      Main entry point for Gateway functions for Project.fn.
      protected void setup​(com.fnproject.fn.api.RuntimeContext ctx)
      Setup method that can be overridden by users to add customizations.
      protected void setupGateway​(com.fnproject.fn.api.RuntimeContext ctx)
      Method that subclasses can override to customize gateway setup.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HttpFunction

        public HttpFunction()
        Default constructor.
      • HttpFunction

        @Inject
        protected HttpFunction​(io.micronaut.context.ApplicationContext applicationContext)
        Constructor for using a shared application context.
        Parameters:
        applicationContext - The application context
    • Method Detail

      • setup

        protected final void setup​(com.fnproject.fn.api.RuntimeContext ctx)
        Description copied from class: OciFunction
        Setup method that can be overridden by users to add customizations.
        Overrides:
        setup in class OciFunction
        Parameters:
        ctx - The runtime context
      • setupGateway

        protected void setupGateway​(@NonNull
                                    com.fnproject.fn.api.RuntimeContext ctx)
        Method that subclasses can override to customize gateway setup.
        Parameters:
        ctx - The context
      • getHttpHandler

        @NonNull
        public final io.micronaut.servlet.http.ServletHttpHandler<com.fnproject.fn.api.InputEvent,​com.fnproject.fn.api.OutputEvent> getHttpHandler()
        Returns:
        The HTTP handler.
      • handleRequest

        public com.fnproject.fn.api.OutputEvent handleRequest​(com.fnproject.fn.api.httpgateway.HTTPGatewayContext gatewayContext,
                                                              com.fnproject.fn.api.InputEvent inputEvent)
        Main entry point for Gateway functions for Project.fn.
        Parameters:
        gatewayContext - The gateway context
        inputEvent - The input event
        Returns:
        The output event