public interface Interceptor
extends sirius.kernel.di.std.Priorized
Controller
)Modifier and Type | Method and Description |
---|---|
boolean |
before(WebContext ctx,
boolean jsonCall,
Controller controller,
Method method)
Invoked before the call to the given method would be performed.
|
boolean |
beforePermissionError(String permission,
WebContext ctx,
boolean jsonCall,
Controller controller,
Method method)
Invoked before the request is aborted due to a missing permission.
|
default int |
getPriority() |
boolean |
shouldExecuteRoute(WebContext ctx,
boolean jsonCall,
Controller controller)
Determines if a matched routing should be executed.
|
boolean before(WebContext ctx, boolean jsonCall, Controller controller, Method method) throws Exception
ctx
- provides access to the current web contextjsonCall
- determines if this is a JSON call or a regular wb request (probably serving html).controller
- the controller which is activemethod
- the method which will be calledException
- in case of an error. Throw a HandledException
to
signal, that all logging and handling has already been performed.
Any other exception will be logged and reported as system error.boolean beforePermissionError(String permission, WebContext ctx, boolean jsonCall, Controller controller, Method method) throws Exception
permission
- the permission which wasn't granted to the user and therefore caused the errorctx
- provides access to the current web contextjsonCall
- determines if this is a JSON call or a regular wb request (probably serving html).controller
- the controller which is activemethod
- the method which would have been calledException
- in case of an error. Throw a HandledException
to
signal, that all logging and handling has already been performed.
Any other exception will be logged and reported as system error.default int getPriority()
getPriority
in interface sirius.kernel.di.std.Priorized
boolean shouldExecuteRoute(WebContext ctx, boolean jsonCall, Controller controller)
By default this should most probably return true to invoke the Controller
. However,
false can be returned to skip this routing.
ctx
- the current requestjsonCall
- determines if this is a JSON call (true) or a plain requestcontroller
- the controller which contains the matching routeCopyright © 2018. All rights reserved.