Class AuthorizedTasks


  • public class AuthorizedTasks
    extends Object
    • Constructor Detail

      • AuthorizedTasks

        public AuthorizedTasks()
    • Method Detail

      • bind

        public static <V> Callable<V> bind​(Callable<V> task)
        Binds a Callable task to the current scope and user.
        Parameters:
        task - the task
        Returns:
        an equivalent Callable task bound to the current scope and user
      • bind

        public static <V> Runnable bind​(Runnable task)
        Binds a Runnable task to the current scope and user.
        Parameters:
        task - the task
        Returns:
        an equivalent Runnable task bound to the current scope and user
      • executeSafely

        public static void executeSafely​(Runnable task,
                                         Secret secret)
        Execute a runnable inline with set and reset of the SecretManagerProvider
        Parameters:
        task - the task
        secret - the secret that must be used in the function
      • executeSafely

        public static <T> T executeSafely​(Callable<T> task,
                                          Secret secret)
                                   throws Throwable
        Execute a callable inline with set and reset of the SecretManagerProvider
        Parameters:
        task - the task
        secret - the secret that must be used in the function
        Returns:
        an equivalent Runnable task bound to the current scope and user
        Throws:
        Throwable