public class ImpersonationServiceImpl extends Object implements ImpersonationService
Modifier and Type | Field and Description |
---|---|
static String |
USER_TOKEN_KEY |
Constructor and Description |
---|
ImpersonationServiceImpl(BambooUserManager bambooUserManager) |
Modifier and Type | Method and Description |
---|---|
<V> Callable<V> |
runAsUser(String username,
Callable<V> callable)
Delegates the given callable so that it can run in the context of the given user.
|
void |
runWith(org.acegisecurity.Authentication authentication,
BambooRunnables.NotThrowing notThrowing)
Runs a given Bamboo runnable with supplied Authentication.
|
<V> Callable<V> |
runWithAuthenticationImpersonation(org.acegisecurity.Authentication authentication,
Callable<V> delegate)
Delegates the given runnable so that it can run in the context of a given authentication.
|
<V> Callable<V> |
runWithOptionalUserImpersonation(String username,
Callable<V> callable)
Delegates the given runnable so that it can run in the context of the given user.
|
public static final String USER_TOKEN_KEY
public ImpersonationServiceImpl(BambooUserManager bambooUserManager)
@NotNull public <V> Callable<V> runAsUser(@NotNull String username, @NotNull Callable<V> callable)
ImpersonationService
runAsUser
in interface ImpersonationService
username
- username to set the authentication context to.callable
- callable to execute in the new context@NotNull public <V> Callable<V> runWithOptionalUserImpersonation(@Nullable String username, @NotNull Callable<V> callable)
ImpersonationService
runWithOptionalUserImpersonation
in interface ImpersonationService
username
- (optional) to set the authentication context tocallable
- callable to execute in the new context@NotNull public <V> Callable<V> runWithAuthenticationImpersonation(@NotNull org.acegisecurity.Authentication authentication, @NotNull Callable<V> delegate)
ImpersonationService
runWithAuthenticationImpersonation
in interface ImpersonationService
authentication
- to set the authentication context todelegate
- callable to execute in the new contextpublic void runWith(@NotNull org.acegisecurity.Authentication authentication, @NotNull BambooRunnables.NotThrowing notThrowing)
ImpersonationService
runWith
in interface ImpersonationService
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.