Package io.quarkus.amazon.lambda.runtime
Class AbstractLambdaPollLoop
- java.lang.Object
-
- io.quarkus.amazon.lambda.runtime.AbstractLambdaPollLoop
-
public abstract class AbstractLambdaPollLoop extends Object
-
-
Constructor Summary
Constructors Constructor Description AbstractLambdaPollLoop(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.databind.ObjectReader cognitoIdReader, com.fasterxml.jackson.databind.ObjectReader clientCtxReader)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) booleanabortGracefully(Exception ex)protected AmazonLambdaContextcreateContext(HttpURLConnection requestConnection)protected abstract LambdaInputReadergetInputReader()protected abstract LambdaOutputWritergetOutputWriter()protected abstract booleanisStream()protected voidpostError(URL url, Object response)protected voidpostResponse(URL url, Object response)protected abstract voidprocessRequest(InputStream input, OutputStream output, AmazonLambdaContext context)protected abstract ObjectprocessRequest(Object input, AmazonLambdaContext context)Invoke actual app code with unmarshalled input.protected HttpURLConnectionresponseStream(URL url)voidstartPollLoop(ShutdownContext context)
-
-
-
Method Detail
-
isStream
protected abstract boolean isStream()
-
startPollLoop
public void startPollLoop(ShutdownContext context)
-
processRequest
protected abstract Object processRequest(Object input, AmazonLambdaContext context) throws Exception
Invoke actual app code with unmarshalled input.- Parameters:
input- unmarshalled input (probably from json)context-- Returns:
- Unmarshalled Java output (will probably be marshalled to json)
- Throws:
Exception
-
processRequest
protected abstract void processRequest(InputStream input, OutputStream output, AmazonLambdaContext context) throws Exception
- Throws:
Exception
-
getInputReader
protected abstract LambdaInputReader getInputReader()
-
getOutputWriter
protected abstract LambdaOutputWriter getOutputWriter()
-
createContext
protected AmazonLambdaContext createContext(HttpURLConnection requestConnection) throws IOException
- Throws:
IOException
-
postResponse
protected void postResponse(URL url, Object response) throws IOException
- Throws:
IOException
-
postError
protected void postError(URL url, Object response) throws IOException
- Throws:
IOException
-
responseStream
protected HttpURLConnection responseStream(URL url) throws IOException
- Throws:
IOException
-
abortGracefully
boolean abortGracefully(Exception ex)
-
-