Package com.enonic.xp.web.handler
Class BaseWebHandler
- java.lang.Object
-
- com.enonic.xp.web.handler.BaseWebHandler
-
- All Implemented Interfaces:
WebHandler
- Direct Known Subclasses:
BasePortalHandler,EndpointHandler,OncePerRequestHandler
@PublicApi public abstract class BaseWebHandler extends Object implements WebHandler
-
-
Field Summary
-
Fields inherited from interface com.enonic.xp.web.handler.WebHandler
MAX_ORDER, MIN_ORDER
-
-
Constructor Summary
Constructors Constructor Description BaseWebHandler()BaseWebHandler(int order)BaseWebHandler(int order, EnumSet<HttpMethod> methodsAllowed)BaseWebHandler(EnumSet<HttpMethod> methodsAllowed)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddTraceInfo(Trace trace, WebResponse webResponse)protected WebExceptionbadRequest(String message, Object... args)Deprecated.protected abstract booleancanHandle(WebRequest webRequest)protected abstract WebResponsedoHandle(WebRequest webRequest, WebResponse webResponse, WebHandlerChain webHandlerChain)protected LonggetBodyLength(Object body)intgetOrder()protected LonggetSize(WebResponse webResponse)WebResponsehandle(WebRequest webRequest, WebResponse webResponse, WebHandlerChain webHandlerChain)protected WebExceptionmethodNotAllowed(String message, Object... args)Deprecated.protected WebExceptionnotFound(String message, Object... args)Deprecated.
-
-
-
Constructor Detail
-
BaseWebHandler
public BaseWebHandler()
-
BaseWebHandler
public BaseWebHandler(int order)
-
BaseWebHandler
public BaseWebHandler(EnumSet<HttpMethod> methodsAllowed)
-
BaseWebHandler
public BaseWebHandler(int order, EnumSet<HttpMethod> methodsAllowed)
-
-
Method Detail
-
getOrder
public int getOrder()
- Specified by:
getOrderin interfaceWebHandler
-
handle
public WebResponse handle(WebRequest webRequest, WebResponse webResponse, WebHandlerChain webHandlerChain) throws Exception
- Specified by:
handlein interfaceWebHandler- Throws:
Exception
-
canHandle
protected abstract boolean canHandle(WebRequest webRequest)
-
doHandle
protected abstract WebResponse doHandle(WebRequest webRequest, WebResponse webResponse, WebHandlerChain webHandlerChain) throws Exception
- Throws:
Exception
-
badRequest
@Deprecated protected final WebException badRequest(String message, Object... args)
Deprecated.
-
notFound
@Deprecated protected final WebException notFound(String message, Object... args)
Deprecated.
-
methodNotAllowed
@Deprecated protected final WebException methodNotAllowed(String message, Object... args)
Deprecated.
-
getSize
protected Long getSize(WebResponse webResponse)
-
getBodyLength
protected Long getBodyLength(Object body) throws IOException
- Throws:
IOException
-
addTraceInfo
protected void addTraceInfo(Trace trace, WebResponse webResponse)
-
-