Class AzureFunctionHttpTriggerHandler
- java.lang.Object
-
- io.inversion.azure.functions.AzureFunctionHttpTriggerHandler
-
public class AzureFunctionHttpTriggerHandler extends java.lang.ObjectAdapter to run an Inversion API as an Azure FunctionTODO: 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
-
-
Constructor Summary
Constructors Constructor Description AzureFunctionHttpTriggerHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected io.inversion.ApibuildApi(com.microsoft.azure.functions.HttpRequestMessage<java.util.Optional<java.lang.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<java.util.Optional<java.lang.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<java.util.Optional<java.lang.String>> azReq, io.inversion.Request req, io.inversion.Response res)protected io.inversion.RequestbuildRequest(com.microsoft.azure.functions.HttpRequestMessage<java.util.Optional<java.lang.String>> request)io.inversion.ApigetApi()io.inversion.EnginegetEngine()com.microsoft.azure.functions.HttpResponseMessagerun(com.microsoft.azure.functions.HttpRequestMessage<java.util.Optional<java.lang.String>> request, com.microsoft.azure.functions.ExecutionContext context)voidsetApi(io.inversion.Api api)voidsetEngine(io.inversion.Engine engine)
-
-
-
Method Detail
-
run
public com.microsoft.azure.functions.HttpResponseMessage run(com.microsoft.azure.functions.HttpRequestMessage<java.util.Optional<java.lang.String>> request, com.microsoft.azure.functions.ExecutionContext context)
-
buildRequest
protected io.inversion.Request buildRequest(com.microsoft.azure.functions.HttpRequestMessage<java.util.Optional<java.lang.String>> request)
-
buildHttpResponseMessage
protected com.microsoft.azure.functions.HttpResponseMessage buildHttpResponseMessage(com.microsoft.azure.functions.HttpRequestMessage<java.util.Optional<java.lang.String>> azReq, io.inversion.Request req, io.inversion.Response res) throws java.lang.Exception- Throws:
java.lang.Exception
-
buildEngine
protected io.inversion.Engine buildEngine(com.microsoft.azure.functions.HttpRequestMessage<java.util.Optional<java.lang.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/Wirer.
- See Also:
buildApi(HttpRequestMessage, ExecutionContext)
-
buildApi
protected io.inversion.Api buildApi(com.microsoft.azure.functions.HttpRequestMessage<java.util.Optional<java.lang.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/Wirer.- 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)
-
-