public class NettyWebRequest extends java.lang.Object implements WebRequest
| Modifier and Type | Field and Description |
|---|---|
protected int |
contentLength |
protected java.lang.String |
contentType |
protected io.netty.channel.ChannelHandlerContext |
ctx |
protected io.netty.handler.codec.http.HttpHeaders |
headers |
protected io.netty.handler.codec.http.HttpVersion |
httpVersion |
protected java.lang.String |
method |
protected boolean |
multipart |
protected org.synchronoss.cloud.nio.multipart.NioMultipartParser |
parser |
protected java.lang.String |
path |
protected java.lang.String |
query |
protected services.moleculer.stream.PacketStream |
stream |
| Constructor and Description |
|---|
NettyWebRequest(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
io.netty.handler.codec.http.HttpHeaders headers,
services.moleculer.ServiceBroker broker,
java.lang.String path) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAddress()
Returns the Internet Protocol (IP) address of the client or last proxy
that sent the request.
|
services.moleculer.stream.PacketStream |
getBody()
Returns the request body as PacketStream.
|
int |
getContentLength()
Returns the length, in bytes, of the request body and made available by
the input stream, or -1 if the length is not known ir is greater than
Integer.MAX_VALUE.
|
java.lang.String |
getContentType()
Returns the MIME type of the body of the request, or null if the type is
not known.
|
java.lang.String |
getHeader(java.lang.String name)
Returns the value of the specified request header as a String.
|
java.util.Iterator<java.lang.String> |
getHeaders()
Returns an iterator of all the header names this request contains.
|
java.lang.Object |
getInternalObject()
Returns the internal object of this WebRequest.
|
java.lang.String |
getMethod()
Returns the name of the HTTP method with which this request was made, for
example, GET, POST, or PUT.
|
java.lang.String |
getPath()
Returns any extra path information associated with the URL the client
sent when it made this request.
|
java.lang.String |
getProtocol()
Returns the name and version of the protocol the request uses in the form
protocol/majorVersion.minorVersion.
|
java.lang.String |
getQuery()
Returns the query string that is contained in the request URL after the
path.
|
boolean |
isMultipart()
Checks if the Content-Type header defines a multipart request.
|
protected final io.netty.channel.ChannelHandlerContext ctx
protected final int contentLength
protected final java.lang.String contentType
protected final io.netty.handler.codec.http.HttpHeaders headers
protected final java.lang.String method
protected final java.lang.String path
protected final java.lang.String query
protected final io.netty.handler.codec.http.HttpVersion httpVersion
protected final boolean multipart
protected services.moleculer.stream.PacketStream stream
protected org.synchronoss.cloud.nio.multipart.NioMultipartParser parser
public NettyWebRequest(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
io.netty.handler.codec.http.HttpHeaders headers,
services.moleculer.ServiceBroker broker,
java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getAddress()
getAddress in interface WebRequestpublic java.lang.String getMethod()
getMethod in interface WebRequestpublic java.lang.String getPath()
getPath in interface WebRequestpublic java.lang.String getQuery()
getQuery in interface WebRequestpublic int getContentLength()
getContentLength in interface WebRequestpublic java.lang.String getContentType()
getContentType in interface WebRequestpublic services.moleculer.stream.PacketStream getBody()
getBody in interface WebRequestpublic java.lang.String getHeader(java.lang.String name)
getHeader in interface WebRequestname - name a String specifying the header namepublic java.util.Iterator<java.lang.String> getHeaders()
getHeaders in interface WebRequestpublic java.lang.String getProtocol()
getProtocol in interface WebRequestString containing the protocol name and version
numberpublic boolean isMultipart()
isMultipart in interface WebRequestpublic java.lang.Object getInternalObject()
getInternalObject in interface WebRequest