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 void
addTraceInfo(Trace trace, WebResponse webResponse)
protected WebException
badRequest(String message, Object... args)
Deprecated.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)
Deprecated.protected WebException
notFound(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:
getOrder
in interfaceWebHandler
-
handle
public WebResponse handle(WebRequest webRequest, WebResponse webResponse, WebHandlerChain webHandlerChain) throws Exception
- Specified by:
handle
in 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)
-
-