Package io.fusionauth.http.server
Class HTTP11Processor
java.lang.Object
io.fusionauth.http.server.HTTP11Processor
- All Implemented Interfaces:
HTTPProcessor
A worker that handles a single request/response from a client.
- Author:
- Brian Pontarelli
-
Constructor Summary
ConstructorsConstructorDescriptionHTTP11Processor(HTTPServerConfiguration configuration, HTTPListenerConfiguration listener, Notifier notifier, ByteBuffer preambleBuffer, ThreadPool threadPool, String ipAddress) -
Method Summary
Modifier and TypeMethodDescriptionclose(boolean endOfStream) Closes the processing.voidSignals to the processor that the request handling failed in some way.intNon-TLS so always start by reading from the client.longlastUsed()voidmarkUsed()read(ByteBuffer buffer) Allows the HTTPProcessor to handle bytes that were read.longstate()longwrote(long num) Called by the selector to tell the HTTPProcessor that bytes were written back to the client.
-
Constructor Details
-
HTTP11Processor
public HTTP11Processor(HTTPServerConfiguration configuration, HTTPListenerConfiguration listener, Notifier notifier, ByteBuffer preambleBuffer, ThreadPool threadPool, String ipAddress)
-
-
Method Details
-
close
Description copied from interface:HTTPProcessorCloses the processing. In some cases, the process of closing a connection might require additional work, like shutting down TLS. Therefore, this method can interrupt a normal shutdown.- Specified by:
closein interfaceHTTPProcessor- Parameters:
endOfStream- True if the stream is being closed due to an unexpected end-of-stream.- Returns:
- The new state of the processor.
-
failure
Description copied from interface:HTTPProcessorSignals to the processor that the request handling failed in some way.- Specified by:
failurein interfaceHTTPProcessor- Parameters:
t- The exception that caused the failure, it there was one.
-
initialKeyOps
public int initialKeyOps()Non-TLS so always start by reading from the client.- Specified by:
initialKeyOpsin interfaceHTTPProcessor- Returns:
SelectionKey.OP_READ- See Also:
-
lastUsed
public long lastUsed()- Specified by:
lastUsedin interfaceHTTPProcessor- Returns:
- The instant that this processor was last used.
-
markUsed
public void markUsed() -
read
Description copied from interface:HTTPProcessorAllows the HTTPProcessor to handle bytes that were read.- Specified by:
readin interfaceHTTPProcessor- Parameters:
buffer- The bytes read from the client.- Returns:
- The new state of the HTTPProcessor.
- Throws:
IOException- If any I/O operations failed.
-
readBuffer
- Specified by:
readBufferin interfaceHTTPProcessor- Returns:
- The current read buffer or null if the state has changed or there we aren't expecting to read.
-
readThroughput
public long readThroughput()- Specified by:
readThroughputin interfaceHTTPProcessor- Returns:
- The bytes per second throughput read by this processor.
-
state
- Specified by:
statein interfaceHTTPProcessor- Returns:
- The current state of the HTTPProcessor.
-
writeBuffers
- Specified by:
writeBuffersin interfaceHTTPProcessor- Returns:
- The current write buffer(s) and never null.
-
writeThroughput
public long writeThroughput()- Specified by:
writeThroughputin interfaceHTTPProcessor- Returns:
- The bytes per second throughput wrote by this processor.
-
wrote
Description copied from interface:HTTPProcessorCalled by the selector to tell the HTTPProcessor that bytes were written back to the client.- Specified by:
wrotein interfaceHTTPProcessor- Parameters:
num- The number of bytes written.- Returns:
- The new state of the HTTPProcessor.
-