Class FunctionInvoker
- java.lang.Object
-
- org.springframework.cloud.function.context.AbstractSpringFunctionAdapterInitializer<com.google.cloud.functions.HttpRequest>
-
- org.springframework.cloud.function.adapter.gcp.FunctionInvoker
-
- All Implemented Interfaces:
com.google.cloud.functions.HttpFunction
,com.google.cloud.functions.RawBackgroundFunction
,Closeable
,AutoCloseable
public class FunctionInvoker extends AbstractSpringFunctionAdapterInitializer<com.google.cloud.functions.HttpRequest> implements com.google.cloud.functions.HttpFunction, com.google.cloud.functions.RawBackgroundFunction
Implementation ofHttpFunction
andRawBackgroundFunction
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
-
-
Field Summary
-
Fields inherited from class org.springframework.cloud.function.context.AbstractSpringFunctionAdapterInitializer
catalog, jsonMapper, TARGET_EXECUTION_CTX_NAME
-
-
Constructor Summary
Constructors Constructor Description FunctionInvoker()
FunctionInvoker(Class<?> configurationClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(String json, com.google.cloud.functions.Context context)
The implementation of a GCFRawBackgroundFunction
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 GCFHttpFunction
that will be used as the entry point from GCF.-
Methods inherited from class org.springframework.cloud.function.context.AbstractSpringFunctionAdapterInitializer
apply, clear, close, convertOutput, doResolveName, function, getContext, getFunction, getInputType, initialize, result
-
-
-
-
Constructor Detail
-
FunctionInvoker
public FunctionInvoker()
-
FunctionInvoker
public FunctionInvoker(Class<?> configurationClass)
-
-
Method Detail
-
service
public void service(com.google.cloud.functions.HttpRequest httpRequest, com.google.cloud.functions.HttpResponse httpResponse) throws Exception
The implementation of a GCFHttpFunction
that will be used as the entry point from GCF.- Specified by:
service
in interfacecom.google.cloud.functions.HttpFunction
- Throws:
Exception
-
accept
public void accept(String json, com.google.cloud.functions.Context context)
The implementation of a GCFRawBackgroundFunction
that will be used as the entry point from GCF.- Specified by:
accept
in interfacecom.google.cloud.functions.RawBackgroundFunction
- Parameters:
json
- the payload.context
- event context.- Since:
- 3.0.5
-
-