public abstract class WebHandler extends Object implements Cloneable
| Modifier | Constructor and Description |
|---|---|
protected |
WebHandler(String path)
Constructs a new web handler for a given path.
|
| Modifier and Type | Method and Description |
|---|---|
WebHandler |
clone() |
String |
getPath() |
abstract io.netty.handler.codec.http.FullHttpResponse |
handleRequest(io.netty.channel.ChannelHandlerContext channelHandlerContext,
QueryDecoder queryDecoder,
PathProvider pathProvider,
io.netty.handler.codec.http.HttpRequest httpRequest)
Handle a request to the configured
path. |
io.netty.handler.codec.http.FullHttpResponse |
newResponse(io.netty.handler.codec.http.HttpVersion httpVersion)
Deprecated.
|
io.netty.handler.codec.http.FullHttpResponse |
newResponse(io.netty.handler.codec.http.HttpVersion httpVersion,
io.netty.buffer.ByteBuf content)
Creates and returns a new
HTTP 404 - Not found response with
content |
protected final String path
protected WebHandler(String path)
path - the path where this handler is available.public String getPath()
public abstract io.netty.handler.codec.http.FullHttpResponse handleRequest(io.netty.channel.ChannelHandlerContext channelHandlerContext,
QueryDecoder queryDecoder,
PathProvider pathProvider,
io.netty.handler.codec.http.HttpRequest httpRequest)
throws Exception
path.channelHandlerContext - the Netty context this request originates fromqueryDecoder - a decoder for possible query parameterspathProvider - a path provider with the provided parametershttpRequest - the HTTP request that was received and should be handledException - when any error occurred during the handling of the request@Deprecated public io.netty.handler.codec.http.FullHttpResponse newResponse(io.netty.handler.codec.http.HttpVersion httpVersion)
HTTP 404 - Not found response without
contenthttpVersion - the HTTP version to usepublic io.netty.handler.codec.http.FullHttpResponse newResponse(io.netty.handler.codec.http.HttpVersion httpVersion,
io.netty.buffer.ByteBuf content)
HTTP 404 - Not found response with
contenthttpVersion - the HTTP version to usecontent - the content to put inside the code 404 responsepublic WebHandler clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionCopyright © 2020. All rights reserved.