Class HttpFunction

java.lang.Object
io.micronaut.function.executor.AbstractExecutor
io.micronaut.function.executor.FunctionInitializer
io.micronaut.gcp.function.http.HttpFunction
All Implemented Interfaces:
com.google.cloud.functions.HttpFunction, io.micronaut.context.ApplicationContextProvider, Closeable, AutoCloseable

public class HttpFunction extends io.micronaut.function.executor.FunctionInitializer implements com.google.cloud.functions.HttpFunction
Entry point into the Micronaut + GCP integration.
Since:
1.2.0
Author:
graemerocher
  • Nested Class Summary

    Nested classes/interfaces inherited from class io.micronaut.function.executor.FunctionInitializer

    io.micronaut.function.executor.FunctionInitializer.ParseContext
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final org.slf4j.Logger
     

    Fields inherited from class io.micronaut.function.executor.FunctionInitializer

    closeContext

    Fields inherited from class io.micronaut.function.executor.AbstractExecutor

    applicationContext
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    HttpFunction(io.micronaut.context.ApplicationContext context)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    invoke(com.google.cloud.functions.HttpRequest request)
    Invoke the function directly with the given request object.
    invoke(io.micronaut.http.HttpMethod method, String uri)
    Invoke the function directly with the given request object.
    invoke(io.micronaut.http.HttpMethod method, String uri, Object body)
    Invoke the function directly with the given request object.
    invoke(io.micronaut.http.HttpRequest<?> request)
    Invoke the function directly with the given request object.
    protected @NonNull io.micronaut.context.ApplicationContextBuilder
     
    void
    service(com.google.cloud.functions.HttpRequest request, com.google.cloud.functions.HttpResponse response)
     
    protected void
    startThis(io.micronaut.context.ApplicationContext applicationContext)
     

    Methods inherited from class io.micronaut.function.executor.FunctionInitializer

    close, injectThis, run

    Methods inherited from class io.micronaut.function.executor.AbstractExecutor

    buildApplicationContext, getApplicationContext, resolveFunction, resolveFunctionName, startEnvironment

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
  • Constructor Details

    • HttpFunction

      public HttpFunction()
      Default constructor.
    • HttpFunction

      public HttpFunction(io.micronaut.context.ApplicationContext context)
  • Method Details

    • startThis

      protected void startThis(io.micronaut.context.ApplicationContext applicationContext)
      Overrides:
      startThis in class io.micronaut.function.executor.FunctionInitializer
    • newApplicationContextBuilder

      @NonNull protected @NonNull io.micronaut.context.ApplicationContextBuilder newApplicationContextBuilder()
      Overrides:
      newApplicationContextBuilder in class io.micronaut.function.executor.AbstractExecutor
    • service

      public void service(com.google.cloud.functions.HttpRequest request, com.google.cloud.functions.HttpResponse response) throws Exception
      Specified by:
      service in interface com.google.cloud.functions.HttpFunction
      Throws:
      Exception
    • invoke

      public GoogleHttpResponse invoke(com.google.cloud.functions.HttpRequest request)
      Invoke the function directly with the given request object.
      Parameters:
      request - The request object
      Returns:
      The response object
    • invoke

      public GoogleHttpResponse invoke(io.micronaut.http.HttpMethod method, String uri)
      Invoke the function directly with the given request object.
      Parameters:
      method - The method
      uri - The URI
      Returns:
      The response object
    • invoke

      public GoogleHttpResponse invoke(io.micronaut.http.HttpMethod method, String uri, Object body)
      Invoke the function directly with the given request object.
      Parameters:
      method - The method
      uri - The URI
      body - The body
      Returns:
      The response object
    • invoke

      public GoogleHttpResponse invoke(io.micronaut.http.HttpRequest<?> request)
      Invoke the function directly with the given request object.
      Parameters:
      request - The request object
      Returns:
      The response object