public class NettyServerCall extends ServerCall
Constructor and Description |
---|
NettyServerCall(Server server,
org.jboss.netty.channel.MessageEvent messageEvent,
org.jboss.netty.buffer.ChannelBuffer contentBuffer,
org.jboss.netty.handler.codec.http.HttpRequest request,
InetSocketAddress clientAddress,
boolean isConfidential,
SSLEngine sslEngine)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
abort()
Closes the socket.
|
String |
getClientAddress()
Returns the client address.
Corresponds to the IP address of the requesting client. |
int |
getClientPort()
Returns the client port.
Corresponds to the TCP/IP port of the requesting client. |
String |
getMethod()
Returns the request method.
|
ReadableByteChannel |
getRequestEntityChannel(long size)
Returns the request entity channel if it exists.
|
InputStream |
getRequestEntityStream(long size)
Returns the request entity stream if it exists.
|
ReadableByteChannel |
getRequestHeadChannel()
Returns the request head channel if it exists.
|
Series<Parameter> |
getRequestHeaders()
Returns the modifiable list of request headers.
|
InputStream |
getRequestHeadStream()
Returns the request head stream if it exists.
|
String |
getRequestUri()
Returns the URI on the request line (most like a relative reference, but
not necessarily).
|
org.jboss.netty.handler.codec.http.HttpResponse |
getResponse()
Get response.
|
WritableByteChannel |
getResponseEntityChannel()
Returns the response channel if it exists.
|
OutputStream |
getResponseEntityStream()
Returns the response entity stream if it exists.
|
Response |
getRestletResponse()
Returns the Restlet response.
|
String |
getSslCipherSuite()
Returns the SSL Cipher Suite, if available and accessible.
|
List<Certificate> |
getSslClientCertificates()
Returns the chain of client certificates, if available and accessible.
|
protected byte[] |
getSslSessionIdBytes()
Returns the SSL session ID, as a byte array, if available and accessible
in that format (to be used by getSslSessionId).
|
String |
getVersion()
Returns the protocol version used.
|
protected boolean |
isClientKeepAlive()
Indicates if the client wants a persistent connection.
|
void |
sendResponse(Response response)
Sends the response back to the client.
|
void |
setRestletResponse(Response restletResponse)
Sets the Restlet response.
|
void |
writeResponseHead(Response restletResponse)
Writes the response status line and headers.
|
complete, getContentLength, getHostDomain, getHostPort, getRequestEntity, getSslKeySize, getSslSessionId, isServerKeepAlive, readRequestHead, shouldResponseBeChunked, writeResponseBody, writeResponseHead
getLogger, getProtocol, getReasonPhrase, getRepresentation, getRepresentation, getResponseHeaders, getServerAddress, getServerPort, getStatusCode, getUserPrincipal, isBroken, isConfidential, isConnectionBroken, isKeepAlive, isRequestChunked, isResponseChunked, setClientAddress, setClientPort, setConfidential, setHostDomain, setHostPort, setMethod, setProtocol, setReasonPhrase, setRequestUri, setServerAddress, setServerPort, setStatusCode, setUserPrincipal, setVersion
public NettyServerCall(Server server, org.jboss.netty.channel.MessageEvent messageEvent, org.jboss.netty.buffer.ChannelBuffer contentBuffer, org.jboss.netty.handler.codec.http.HttpRequest request, InetSocketAddress clientAddress, boolean isConfidential, SSLEngine sslEngine)
server
- The helped server.messageEvent
- The message event received.contentBuffer
- The content buffer.request
- The Netty request.clientAddress
- client information.isConfidential
- Indicates if the call is confidential or not.sslEngine
- The SSL engine.public boolean abort()
abort
in class ServerCall
public String getClientAddress()
Call
getClientAddress
in class Call
public int getClientPort()
Call
getClientPort
in class Call
public ReadableByteChannel getRequestEntityChannel(long size)
ServerCall
getRequestEntityChannel
in class ServerCall
size
- The expected entity size or -1 if unknown.public InputStream getRequestEntityStream(long size)
ServerCall
getRequestEntityStream
in class ServerCall
size
- The expected entity size or -1 if unknown.public ReadableByteChannel getRequestHeadChannel()
ServerCall
getRequestHeadChannel
in class ServerCall
public Series<Parameter> getRequestHeaders()
Call
getRequestHeaders
in class Call
public InputStream getRequestHeadStream()
ServerCall
getRequestHeadStream
in class ServerCall
public String getRequestUri()
Call
getRequestUri
in class Call
public org.jboss.netty.handler.codec.http.HttpResponse getResponse()
public WritableByteChannel getResponseEntityChannel()
ServerCall
getResponseEntityChannel
in class ServerCall
public OutputStream getResponseEntityStream()
ServerCall
getResponseEntityStream
in class ServerCall
public Response getRestletResponse()
public String getSslCipherSuite()
ServerCall
getSslCipherSuite
in class ServerCall
public List<Certificate> getSslClientCertificates()
ServerCall
getSslClientCertificates
in class ServerCall
protected byte[] getSslSessionIdBytes()
ServerCall
getSslSessionIdBytes
in class ServerCall
public String getVersion()
Call
getVersion
in class Call
protected boolean isClientKeepAlive()
Call
isClientKeepAlive
in class ServerCall
public void sendResponse(Response response) throws IOException
ServerCall
sendResponse
in class ServerCall
response
- The high-level response.IOException
- if the Response could not be written to the network.public void setRestletResponse(Response restletResponse)
restletResponse
- The Restlet response.public void writeResponseHead(Response restletResponse) throws IOException
ServerCall
writeResponseHead
in class ServerCall
restletResponse
- The response.IOException
Copyright © 2005–2016. All rights reserved.