Class ImpersonationServiceImpl

    • Constructor Detail

      • ImpersonationServiceImpl

        public ImpersonationServiceImpl​(BambooUserManager bambooUserManager)
    • Method Detail

      • runAsUser

        @NotNull
        public <V> @NotNull Callable<V> runAsUser​(@NotNull
                                                  @NotNull String username,
                                                  @NotNull
                                                  @NotNull Callable<V> callable)
        Description copied from interface: ImpersonationService
        Delegates the given callable so that it can run in the context of the given user. If the context can not be set to the given user it will fail.
        Specified by:
        runAsUser in interface ImpersonationService
        Parameters:
        username - username to set the authentication context to.
        callable - callable to execute in the new context
        Returns:
        callable
      • runWithOptionalUserImpersonation

        @NotNull
        public <V> @NotNull Callable<V> runWithOptionalUserImpersonation​(@Nullable
                                                                         @Nullable String username,
                                                                         @NotNull
                                                                         @NotNull Callable<V> callable)
        Description copied from interface: ImpersonationService
        Delegates the given runnable so that it can run in the context of the given user. If use context can not be set it will execute the callable regardless.
        Specified by:
        runWithOptionalUserImpersonation in interface ImpersonationService
        Parameters:
        username - (optional) to set the authentication context to
        callable - callable to execute in the new context
        Returns:
        callable
      • runWithAuthenticationImpersonation

        @NotNull
        public <V> @NotNull Callable<V> runWithAuthenticationImpersonation​(@NotNull
                                                                           @NotNull org.acegisecurity.Authentication authentication,
                                                                           @NotNull
                                                                           @NotNull Callable<V> delegate)
        Description copied from interface: ImpersonationService
        Delegates the given runnable so that it can run in the context of a given authentication.
        Specified by:
        runWithAuthenticationImpersonation in interface ImpersonationService
        Parameters:
        authentication - to set the authentication context to
        delegate - callable to execute in the new context
        Returns:
        callable