Package io.quarkus.amazon.lambda.runtime
Class AbstractLambdaPollLoop
- java.lang.Object
-
- io.quarkus.amazon.lambda.runtime.AbstractLambdaPollLoop
-
public abstract class AbstractLambdaPollLoop extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected HttpURLConnectionrequestConnection
-
Constructor Summary
Constructors Constructor Description AbstractLambdaPollLoop(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.databind.ObjectReader cognitoIdReader, com.fasterxml.jackson.databind.ObjectReader clientCtxReader, LaunchMode launchMode)
-
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 voidrequeue(String baseUrl, String requestId)protected HttpURLConnectionresponseStream(URL url)protected booleanshouldLog(Exception e)voidstartPollLoop(ShutdownContext context)
-
-
-
Field Detail
-
requestConnection
protected HttpURLConnection requestConnection
-
-
Constructor Detail
-
AbstractLambdaPollLoop
public AbstractLambdaPollLoop(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.databind.ObjectReader cognitoIdReader, com.fasterxml.jackson.databind.ObjectReader clientCtxReader, LaunchMode launchMode)
-
-
Method Detail
-
shouldLog
protected boolean shouldLog(Exception e)
-
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
-
requeue
protected void requeue(String baseUrl, String requestId) 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)
-
-