public abstract class ClientInboundWay extends InboundWay
Constructor and Description |
---|
ClientInboundWay(Connection<?> connection,
int bufferSize)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
copyResponseTransportHeaders(Series<Header> headers,
Response response)
Copies headers into a response.
|
protected abstract Response |
createResponse(Status status)
Creates a response object for the given status.
|
protected Status |
createStatus(int code)
Returns the status corresponding to a given status code.
|
Message |
getActualMessage()
Returns the actual message, request or response.
|
Connection<Client> |
getConnection()
Returns the parent connection.
|
ClientConnectionHelper |
getHelper()
Returns the parent connector helper.
|
int |
getInterestOperations()
Returns the operations of interest.
|
protected void |
onHeadersCompleted()
Callback invoked when a message has been received.
|
void |
onMessageCompleted(boolean endDetected)
Callback method invoked when the current message has been completely
received or sent.
|
protected void |
onReceived(Response message)
Call back invoked when the message is received.
|
protected void |
readStartLine()
Read the start line of the current message received.
|
clear, createEntity, fillLine, getBuilderIndex, getEntityRegistration, isLineReadable, onDrain, onError, onFill, onFillEof, onPostProcessing, onTimeOut, processIoBuffer, readHeader, setBuilderIndex, setEntityRegistration, updateState
canLoop, clearLineBuilder, couldDrain, couldFill, getBuffer, getHeaders, getIoState, getLineBuilder, getLineBuilderState, getLoadScore, getLogger, getMessage, getMessageState, getRegistration, hasIoInterest, isAvailable, isEmpty, onClosed, onSelected, postProcess, preProcess, setHeaders, setIoState, setLineBuilderState, setMessage, setMessageState, setRegistration, toString
public ClientInboundWay(Connection<?> connection, int bufferSize)
connection
- The parent connection.bufferSize
- The byte buffer size.protected void copyResponseTransportHeaders(Series<Header> headers, Response response)
headers
- The headers to copy.response
- The response to update.protected abstract Response createResponse(Status status)
status
- The response status.protected Status createStatus(int code)
code
- The status code.public Message getActualMessage()
Way
getActualMessage
in class Way
public Connection<Client> getConnection()
Way
getConnection
in class Way
public ClientConnectionHelper getHelper()
Way
public int getInterestOperations()
Way
getInterestOperations
in class InboundWay
protected void onHeadersCompleted() throws IOException
InboundWay
onHeadersCompleted
in class InboundWay
IOException
public void onMessageCompleted(boolean endDetected) throws IOException
Way
onMessageCompleted
in interface CompletionListener
onMessageCompleted
in class InboundWay
endDetected
- Indicates if the end of the socket channel was detected.IOException
protected void onReceived(Response message) throws IOException
InboundWay
onReceived
in class InboundWay
message
- The new message received.IOException
protected void readStartLine() throws IOException
InboundWay
readStartLine
in class InboundWay
IOException
Copyright © 2005–2015. All rights reserved.