@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 WebHandlerpublic WebResponse handle(WebRequest webRequest, WebResponse webResponse, WebHandlerChain webHandlerChain) throws Exception
handle in interface WebHandlerExceptionprotected abstract boolean canHandle(WebRequest webRequest)
protected abstract WebResponse doHandle(WebRequest webRequest, WebResponse webResponse, WebHandlerChain webHandlerChain) throws Exception
Exceptionprotected 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
IOExceptionprotected void addTraceInfo(Trace trace, WebResponse webResponse)