@Beta public abstract class BaseWebHandler extends Object implements WebHandler
MAX_ORDER, MIN_ORDER
Constructor and Description |
---|
BaseWebHandler() |
BaseWebHandler(EnumSet<HttpMethod> methodsAllowed) |
BaseWebHandler(int order) |
BaseWebHandler(int order,
EnumSet<HttpMethod> methodsAllowed) |
Modifier and Type | Method and Description |
---|---|
protected void |
addTraceInfo(Trace trace,
WebResponse webResponse) |
protected WebException |
badRequest(String message,
Object... args) |
protected abstract boolean |
canHandle(WebRequest webRequest) |
protected abstract WebResponse |
doHandle(WebRequest webRequest,
WebResponse webResponse,
WebHandlerChain webHandlerChain) |
protected Long |
getBodyLength(Object body) |
int |
getOrder() |
protected Long |
getSize(WebResponse webResponse) |
WebResponse |
handle(WebRequest webRequest,
WebResponse webResponse,
WebHandlerChain webHandlerChain) |
protected WebException |
methodNotAllowed(String message,
Object... args) |
protected WebException |
notFound(String message,
Object... args) |
public BaseWebHandler()
public BaseWebHandler(int order)
public BaseWebHandler(EnumSet<HttpMethod> methodsAllowed)
public BaseWebHandler(int order, EnumSet<HttpMethod> methodsAllowed)
public int getOrder()
getOrder
in interface WebHandler
public WebResponse handle(WebRequest webRequest, WebResponse webResponse, WebHandlerChain webHandlerChain) throws Exception
handle
in interface WebHandler
Exception
protected abstract boolean canHandle(WebRequest webRequest)
protected abstract WebResponse doHandle(WebRequest webRequest, WebResponse webResponse, WebHandlerChain webHandlerChain) throws Exception
Exception
protected final WebException badRequest(String message, Object... args)
protected final WebException notFound(String message, Object... args)
protected final WebException methodNotAllowed(String message, Object... args)
protected Long getSize(WebResponse webResponse)
protected Long getBodyLength(Object body) throws IOException
IOException
protected void addTraceInfo(Trace trace, WebResponse webResponse)