Class AzureFunctionHttpTriggerHandler
TODO: multipart post is not yet supported but could be implemented: https://stackoverflow.com/questions/54473126/azure-functions-how-to-use-the-multiparthttpservletrequest-class-from-the-de
Similar functionality for AWS Lambdas is provided by io.inversion.lambda.AwsApiGatewayLambdaRequestStreamHandler
- See Also:
- Java Azure Functions
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected io.inversion.ApibuildApi(com.microsoft.azure.functions.HttpRequestMessage<Optional<String>> request, com.microsoft.azure.functions.ExecutionContext context)Optional subclass override hook to supply your own custom wired up Api.protected io.inversion.EnginebuildEngine(com.microsoft.azure.functions.HttpRequestMessage<Optional<String>> request, com.microsoft.azure.functions.ExecutionContext context)Optional subclass override hook to allow for advanced Engine configuration.protected com.microsoft.azure.functions.HttpResponseMessagebuildHttpResponseMessage(com.microsoft.azure.functions.HttpRequestMessage<Optional<String>> azReq, io.inversion.Request req, io.inversion.Response res)protected io.inversion.RequestbuildRequest(com.microsoft.azure.functions.HttpRequestMessage<Optional<String>> request)io.inversion.ApigetApi()io.inversion.Enginecom.microsoft.azure.functions.HttpResponseMessagerun(com.microsoft.azure.functions.HttpRequestMessage<Optional<String>> request, com.microsoft.azure.functions.ExecutionContext context)voidsetApi(io.inversion.Api api)voidsetEngine(io.inversion.Engine engine)
-
Field Details
-
engine
protected io.inversion.Engine engine -
api
protected io.inversion.Api api
-
-
Constructor Details
-
AzureFunctionHttpTriggerHandler
public AzureFunctionHttpTriggerHandler()
-
-
Method Details
-
run
-
buildRequest
-
buildHttpResponseMessage
protected com.microsoft.azure.functions.HttpResponseMessage buildHttpResponseMessage(com.microsoft.azure.functions.HttpRequestMessage<Optional<String>> azReq, io.inversion.Request req, io.inversion.Response res) throws Exception- Throws:
Exception
-
buildEngine
protected io.inversion.Engine buildEngine(com.microsoft.azure.functions.HttpRequestMessage<Optional<String>> request, com.microsoft.azure.functions.ExecutionContext context)Optional subclass override hook to allow for advanced Engine configuration.Simple embeddings can leave this alone. Complex embeddings can either set the engine via setEngine() or override this method to construct/configure as needed.
This default implementation constructs an Engine with the supplied configProfile and adds
apito it ifapiis not null.If
apiis null, it calls buildApi() which by default does nothing and is itself designed as an override hook.- Parameters:
request- the request to servicecontext- the execution context- Returns:
- an Engine with an Api already set if one was supplied otherwise an empty Engine that will be configured via via Confg/Configurator.
- See Also:
buildApi(HttpRequestMessage, ExecutionContext)
-
buildApi
protected io.inversion.Api buildApi(com.microsoft.azure.functions.HttpRequestMessage<Optional<String>> request, com.microsoft.azure.functions.ExecutionContext context)Optional subclass override hook to supply your own custom wired up Api.If you don't set your
apiviasetApi()and you don't overridebuildApi()to supply an Api or otherwise wire your custom Api and Engine in an overridden buildEngine() method, you will need to define your Api in inversion.properties files for autowiring via Confg/Configurator.- Parameters:
request- the request to servicecontext- the execution context- Returns:
- null unless you override this method to construct an Api.
- See Also:
buildEngine(com.microsoft.azure.functions.HttpRequestMessage<java.util.Optional<java.lang.String>>, com.microsoft.azure.functions.ExecutionContext)
-
getEngine
public io.inversion.Engine getEngine() -
setEngine
public void setEngine(io.inversion.Engine engine) -
getApi
public io.inversion.Api getApi() -
setApi
public void setApi(io.inversion.Api api)
-