Interface PermissionMiddleware
-
- All Superinterfaces:
Middleware
,TimeProviderMiddleware
public interface PermissionMiddleware extends TimeProviderMiddleware
Permission middleware allows to check whether some permission is there for a given job,If the given job does not have the right permission than this job would be released back to pool for other consumers.
NOTE: User's role was changed between and the said is no longer be able to perform some action
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
REASON
-
Fields inherited from interface com.github.sonus21.rqueue.core.middleware.TimeProviderMiddleware
ONE_SECOND
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
handle(Job job, java.util.concurrent.Callable<java.lang.Void> next)
Middleware handles that would be calledboolean
hasPermission(Job job)
Checks whether given job has enough permission to execute-
Methods inherited from interface com.github.sonus21.rqueue.core.middleware.TimeProviderMiddleware
releaseIn
-
-
-
-
Field Detail
-
REASON
static final java.lang.String REASON
- See Also:
- Constant Field Values
-
-
Method Detail
-
hasPermission
boolean hasPermission(Job job)
Checks whether given job has enough permission to execute- Parameters:
job
- job that's going to be executed- Returns:
- true/false
-
handle
default void handle(Job job, java.util.concurrent.Callable<java.lang.Void> next) throws java.lang.Exception
Description copied from interface:Middleware
Middleware handles that would be called- Specified by:
handle
in interfaceMiddleware
- Parameters:
job
- job objectnext
- next middleware in chain- Throws:
java.lang.Exception
- any exception
-
-