|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.engine.http.connector.Connection<Client>
org.restlet.engine.http.connector.ClientConnection
public class ClientConnection
Generic HTTP-like client connection.
Constructor Summary | |
---|---|
ClientConnection(BaseHelper<Client> helper,
Socket socket,
SocketChannel socketChannel)
Constructor. |
Method Summary | |
---|---|
protected void |
addRequestHeaders(Request request,
Series<Parameter> headers)
Adds the request headers. |
boolean |
canEnqueue()
Indicates whether the client connection can accept a new message. |
boolean |
canRead()
Indicates if the connection's socket can be read for inbound data. |
boolean |
canWrite()
Indicates if the connection's socket can be written for outbound data. |
protected void |
copyResponseTransportHeaders(Series<Parameter> headers,
Response response)
Copies headers into a response. |
protected Status |
createStatus(int code)
Returns the status corresponding to a given status code. |
protected void |
readMessage()
Reads the next message received via the inbound stream or channel. |
protected void |
writeMessage(Response response)
Write the given response on the socket. |
protected void |
writeMessageHeadLine(Response message,
OutputStream headStream)
Writes the message head line to the given output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClientConnection(BaseHelper<Client> helper, Socket socket, SocketChannel socketChannel) throws IOException
helper
- The parent connector helper.socket
- The underlying BIO socket.socketChannel
- The underlying NIO socket channel.
IOException
Method Detail |
---|
protected void addRequestHeaders(Request request, Series<Parameter> headers)
request
- The request to inspect.headers
- The headers series to update.public boolean canEnqueue()
public boolean canRead()
Connection
canRead
in class Connection<Client>
public boolean canWrite()
Connection
canWrite
in class Connection<Client>
protected void copyResponseTransportHeaders(Series<Parameter> headers, Response response)
headers
- The headers to copy.response
- The response to update.protected Status createStatus(int code)
code
- The status code.
protected void readMessage() throws IOException
Connection
readMessage
in class Connection<Client>
IOException
protected void writeMessage(Response response)
writeMessage
in class Connection<Client>
response
- The response to write.protected void writeMessageHeadLine(Response message, OutputStream headStream) throws IOException
Connection
writeMessageHeadLine
in class Connection<Client>
message
- The source message.headStream
- The target stream.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |