Class FunctionInvoker

java.lang.Object
org.springframework.cloud.function.adapter.gcp.FunctionInvoker
All Implemented Interfaces:
com.google.cloud.functions.HttpFunction, com.google.cloud.functions.RawBackgroundFunction

public class FunctionInvoker extends Object implements com.google.cloud.functions.HttpFunction, com.google.cloud.functions.RawBackgroundFunction
Implementation of HttpFunction and RawBackgroundFunction for Google Cloud Function (GCF). This is the Spring Cloud Function adapter for GCF HTTP and Raw Background function.
Since:
3.0.4
Author:
Dmitry Solomakha, Mike Eltsufin, Oleg Zhurakousky, Biju Kunjummen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected FunctionCatalog
     
    static final String
    Constant specifying Http Status Code.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    FunctionInvoker(Class<?> configurationClass)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(String json, com.google.cloud.functions.Context context)
    The implementation of a GCF RawBackgroundFunction that will be used as the entry point from GCF.
    void
    service(com.google.cloud.functions.HttpRequest httpRequest, com.google.cloud.functions.HttpResponse httpResponse)
    The implementation of a GCF HttpFunction that will be used as the entry point from GCF.

    Methods inherited from class java.lang.Object

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

    • HTTP_STATUS_CODE

      public static final String HTTP_STATUS_CODE
      Constant specifying Http Status Code. Accessible to users by calling 'FunctionInvoker.HTTP_STATUS_CODE'
      See Also:
    • catalog

      protected FunctionCatalog catalog
  • Constructor Details

    • FunctionInvoker

      public FunctionInvoker()
    • FunctionInvoker

      public FunctionInvoker(Class<?> configurationClass)
  • Method Details

    • service

      public void service(com.google.cloud.functions.HttpRequest httpRequest, com.google.cloud.functions.HttpResponse httpResponse) throws Exception
      The implementation of a GCF HttpFunction that will be used as the entry point from GCF.
      Specified by:
      service in interface com.google.cloud.functions.HttpFunction
      Throws:
      Exception
    • accept

      public void accept(String json, com.google.cloud.functions.Context context)
      The implementation of a GCF RawBackgroundFunction that will be used as the entry point from GCF.
      Specified by:
      accept in interface com.google.cloud.functions.RawBackgroundFunction
      Parameters:
      json - the payload.
      context - event context.
      Since:
      3.0.5