Package org.jenkinsci.remoting
Interface RoleSensitive
-
- All Known Subinterfaces:
Callable<V,T>
,DelegatingCallable<V,T>
public interface RoleSensitive
Used byCallable
-like objects to designate the intended recipient of the callable, to help verify callables are running in JVMs that it is intended to run.This interface is defined separately from
Callable
so that other callable-like interfaces can reuse this.- Since:
- 2.47
- Author:
- Kohsuke Kawaguchi
- See Also:
RoleChecker
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
checkRoles(RoleChecker checker)
Verifies the roles expected by this callable by invokingRoleChecker.check(RoleSensitive, Collection)
method (or its variants), to provide an opportunity forRoleChecker
to reject this object.
-
-
-
Method Detail
-
checkRoles
void checkRoles(RoleChecker checker) throws SecurityException
Verifies the roles expected by this callable by invokingRoleChecker.check(RoleSensitive, Collection)
method (or its variants), to provide an opportunity forRoleChecker
to reject this object.Do not implement this method unless you know what you are doing. If you have a Jenkins
Callable
orFileCallable
, use the standard abstract base classes instead, such asMasterToSlaveCallable
,MasterToSlaveFileCallable
,NotReallyRoleSensitiveCallable
, etc. See this document for details.If the method returns normally, the check has passed.
- Throws:
SecurityException
- If there's a mismatch in the expected roles and the actual roles that should prevent the execution of this callable.AbstractMethodError
- In the history of this library, this interface was added rather later, so there's lots ofCallable
s out there that do not implement this method. For this reason, code that calls this method should be prepared to receiveAbstractMethodError
, and treat that as if the invocation ofchecker.check(this,Role.UNKNOWN)
has happened.
-
-